2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2021-01-04 11:44:28 +00:00
|
|
|
* Copyright (C) 2017-2021 Intel Corporation
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
2018-09-18 09:11:08 +02:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2020-02-24 13:10:44 +01:00
|
|
|
#include "shared/source/built_ins/sip.h"
|
2019-02-27 11:39:32 +01:00
|
|
|
|
2020-02-24 13:10:44 +01:00
|
|
|
#include "shared/source/built_ins/built_ins.h"
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/device/device.h"
|
|
|
|
|
#include "shared/source/execution_environment/execution_environment.h"
|
|
|
|
|
#include "shared/source/helpers/debug_helpers.h"
|
|
|
|
|
#include "shared/source/helpers/hw_helper.h"
|
|
|
|
|
#include "shared/source/helpers/ptr_math.h"
|
|
|
|
|
#include "shared/source/helpers/string.h"
|
2020-12-02 10:22:27 +00:00
|
|
|
#include "shared/source/memory_manager/allocation_properties.h"
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/memory_manager/graphics_allocation.h"
|
2020-12-02 10:22:27 +00:00
|
|
|
#include "shared/source/memory_manager/memory_manager.h"
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2020-10-19 15:57:00 +02:00
|
|
|
const size_t SipKernel::maxDbgSurfaceSize = 0x1800000; // proper value should be taken from compiler when it's ready
|
2018-03-09 14:40:31 +01:00
|
|
|
|
2020-10-13 11:41:48 +02:00
|
|
|
SipKernel::~SipKernel() = default;
|
2018-03-09 11:52:14 +01:00
|
|
|
|
2020-12-02 10:22:27 +00:00
|
|
|
SipKernel::SipKernel(SipKernelType type, GraphicsAllocation *sipAlloc) : type(type), sipAllocation(sipAlloc) {
|
2018-03-09 11:52:14 +01:00
|
|
|
}
|
|
|
|
|
|
2020-12-02 10:22:27 +00:00
|
|
|
GraphicsAllocation *SipKernel::getSipAllocation() const {
|
|
|
|
|
return sipAllocation;
|
2018-03-08 15:52:08 +01:00
|
|
|
}
|
2018-04-06 14:25:22 +02:00
|
|
|
|
|
|
|
|
SipKernelType SipKernel::getSipKernelType(GFXCORE_FAMILY family, bool debuggingActive) {
|
|
|
|
|
auto &hwHelper = HwHelper::get(family);
|
|
|
|
|
return hwHelper.getSipKernelType(debuggingActive);
|
|
|
|
|
}
|
2020-01-20 19:10:01 +01:00
|
|
|
|
|
|
|
|
GraphicsAllocation *SipKernel::getSipKernelAllocation(Device &device) {
|
2020-10-27 16:00:56 +01:00
|
|
|
bool debuggingEnabled = device.getDebugger() != nullptr || device.isDebuggerActive();
|
|
|
|
|
auto sipType = SipKernel::getSipKernelType(device.getHardwareInfo().platform.eRenderCoreFamily, debuggingEnabled);
|
2020-03-05 07:11:11 +01:00
|
|
|
return device.getBuiltIns()->getSipKernel(sipType, device).getSipAllocation();
|
2020-01-20 19:10:01 +01:00
|
|
|
}
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|