mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-22 19:29:06 +08:00
Move builtins and compiler interface to RootDeviceEnvironment
Resolves: NEO-4355 Change-Id: Id1a3365673165d775a60a7e0a3f463e1b8f5a496 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
ab3ae5fea7
commit
7cf57e04f9
@@ -16,6 +16,7 @@
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
#include "shared/source/helpers/kernel_helpers.h"
|
||||
#include "shared/source/memory_manager/unified_memory_manager.h"
|
||||
#include "shared/source/os_interface/device_factory.h"
|
||||
#include "shared/source/os_interface/os_context.h"
|
||||
#include "shared/source/utilities/api_intercept.h"
|
||||
#include "shared/source/utilities/stackvec.h"
|
||||
|
||||
@@ -714,7 +714,7 @@ class BuiltInOp<EBuiltInOps::FillImage3d> : public BuiltinDispatchInfoBuilder {
|
||||
|
||||
BuiltinDispatchInfoBuilder &BuiltInDispatchBuilderOp::getBuiltinDispatchInfoBuilder(EBuiltInOps::Type operation, Device &device) {
|
||||
uint32_t operationId = static_cast<uint32_t>(operation);
|
||||
auto kernelsLib = device.getExecutionEnvironment()->getBuiltIns();
|
||||
auto kernelsLib = device.getBuiltIns();
|
||||
auto &operationBuilder = kernelsLib->BuiltinOpsBuilders[operationId];
|
||||
switch (operation) {
|
||||
case EBuiltInOps::CopyBufferToBuffer:
|
||||
|
||||
@@ -100,7 +100,7 @@ const char *getAdditionalBuiltinAsString(EBuiltInOps::Type builtin) {
|
||||
}
|
||||
|
||||
BuiltinDispatchInfoBuilder &Vme::getBuiltinDispatchInfoBuilder(EBuiltInOps::Type operation, Device &device) {
|
||||
auto &builtins = *device.getExecutionEnvironment()->getBuiltIns();
|
||||
auto &builtins = *device.getBuiltIns();
|
||||
uint32_t operationId = static_cast<uint32_t>(operation);
|
||||
auto &operationBuilder = builtins.BuiltinOpsBuilders[operationId];
|
||||
switch (operation) {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
namespace NEO {
|
||||
const SipKernel &initSipKernel(SipKernelType type, Device &device) {
|
||||
return device.getExecutionEnvironment()->getBuiltIns()->getSipKernel(type, device);
|
||||
return device.getBuiltIns()->getSipKernel(type, device);
|
||||
}
|
||||
Program *createProgramForSip(ExecutionEnvironment &executionEnvironment,
|
||||
Context *context,
|
||||
|
||||
@@ -164,12 +164,12 @@ bool Platform::initialize(std::vector<std::unique_ptr<Device>> devices) {
|
||||
}
|
||||
}
|
||||
|
||||
auto hwInfo = clDevices[0]->getHardwareInfo();
|
||||
|
||||
const bool debuggerActive = executionEnvironment.debugger && executionEnvironment.debugger->isDebuggerActive();
|
||||
if (clDevices[0]->getPreemptionMode() == PreemptionMode::MidThread || debuggerActive) {
|
||||
auto sipType = SipKernel::getSipKernelType(hwInfo.platform.eRenderCoreFamily, clDevices[0]->isDebuggerActive());
|
||||
initSipKernel(sipType, clDevices[0]->getDevice());
|
||||
for (auto &clDevice : clDevices) {
|
||||
auto hwInfo = clDevice->getHardwareInfo();
|
||||
if (clDevice->getPreemptionMode() == PreemptionMode::MidThread || clDevice->isDebuggerActive()) {
|
||||
auto sipType = SipKernel::getSipKernelType(hwInfo.platform.eRenderCoreFamily, clDevice->isDebuggerActive());
|
||||
initSipKernel(sipType, clDevice->getDevice());
|
||||
}
|
||||
}
|
||||
|
||||
this->fillGlobalDispatchTable();
|
||||
|
||||
@@ -70,7 +70,7 @@ cl_int Program::build(
|
||||
extractInternalOptions(options);
|
||||
applyAdditionalOptions();
|
||||
|
||||
CompilerInterface *pCompilerInterface = this->executionEnvironment.getCompilerInterface();
|
||||
CompilerInterface *pCompilerInterface = pDevice->getCompilerInterface();
|
||||
if (!pCompilerInterface) {
|
||||
retVal = CL_OUT_OF_HOST_MEMORY;
|
||||
break;
|
||||
|
||||
@@ -120,7 +120,7 @@ cl_int Program::compile(
|
||||
|
||||
std::vector<uint8_t> compileData = elfEncoder.encode();
|
||||
|
||||
CompilerInterface *pCompilerInterface = this->executionEnvironment.getCompilerInterface();
|
||||
CompilerInterface *pCompilerInterface = pDevice->getCompilerInterface();
|
||||
if (!pCompilerInterface) {
|
||||
retVal = CL_OUT_OF_HOST_MEMORY;
|
||||
break;
|
||||
|
||||
@@ -105,7 +105,7 @@ cl_int Program::link(
|
||||
|
||||
auto clLinkInput = elfEncoder.encode();
|
||||
|
||||
CompilerInterface *pCompilerInterface = this->executionEnvironment.getCompilerInterface();
|
||||
CompilerInterface *pCompilerInterface = pDevice->getCompilerInterface();
|
||||
if (!pCompilerInterface) {
|
||||
retVal = CL_OUT_OF_HOST_MEMORY;
|
||||
break;
|
||||
|
||||
@@ -224,7 +224,7 @@ cl_int Program::setProgramSpecializationConstant(cl_uint specId, size_t specSize
|
||||
std::lock_guard<std::mutex> lock(mutex);
|
||||
|
||||
if (!areSpecializationConstantsInitialized) {
|
||||
auto pCompilerInterface = this->executionEnvironment.getCompilerInterface();
|
||||
auto pCompilerInterface = this->pDevice->getCompilerInterface();
|
||||
if (nullptr == pCompilerInterface) {
|
||||
return CL_OUT_OF_HOST_MEMORY;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user