mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-09 22:43:00 +08:00
Revert "Check for context in appendMemoryCopy"
This reverts commit 32bab85f7e.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
1292ea26f5
commit
429755e0f4
@@ -7,7 +7,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "level_zero/core/source/context/context.h"
|
||||
#include <level_zero/ze_api.h>
|
||||
|
||||
#include <memory>
|
||||
@@ -20,7 +19,6 @@ namespace L0 {
|
||||
struct Device;
|
||||
struct ModuleBuildLog;
|
||||
struct KernelImmutableData;
|
||||
struct Context;
|
||||
|
||||
enum class ModuleType {
|
||||
Builtin,
|
||||
@@ -29,7 +27,7 @@ enum class ModuleType {
|
||||
|
||||
struct Module : _ze_module_handle_t {
|
||||
|
||||
static Module *create(Context *context, Device *device, const ze_module_desc_t *desc, ModuleBuildLog *moduleBuildLog, ModuleType type, ze_result_t *result);
|
||||
static Module *create(Device *device, const ze_module_desc_t *desc, ModuleBuildLog *moduleBuildLog, ModuleType type, ze_result_t *result);
|
||||
|
||||
virtual ~Module() = default;
|
||||
|
||||
@@ -65,16 +63,6 @@ struct Module : _ze_module_handle_t {
|
||||
static Module *fromHandle(ze_module_handle_t handle) { return static_cast<Module *>(handle); }
|
||||
|
||||
inline ze_module_handle_t toHandle() { return this; }
|
||||
|
||||
void setContext(Context *context) {
|
||||
this->context = context;
|
||||
}
|
||||
|
||||
Context *getContext() {
|
||||
return this->context;
|
||||
}
|
||||
|
||||
Context *context = nullptr;
|
||||
};
|
||||
|
||||
} // namespace L0
|
||||
|
||||
@@ -375,18 +375,13 @@ ze_result_t ModuleTranslationUnit::processUnpackedBinary() {
|
||||
return ZE_RESULT_ERROR_MODULE_BUILD_FAILURE;
|
||||
}
|
||||
|
||||
Context *context = nullptr;
|
||||
if (module) {
|
||||
context = module->getContext();
|
||||
}
|
||||
|
||||
auto svmAllocsManager = device->getDriverHandle()->getSvmAllocsManager();
|
||||
if (programInfo.globalConstants.size != 0) {
|
||||
this->globalConstBuffer = NEO::allocateGlobalsSurface(svmAllocsManager, *device->getNEODevice(), programInfo.globalConstants.size, true, programInfo.linkerInput.get(), programInfo.globalConstants.initData, context);
|
||||
this->globalConstBuffer = NEO::allocateGlobalsSurface(svmAllocsManager, *device->getNEODevice(), programInfo.globalConstants.size, true, programInfo.linkerInput.get(), programInfo.globalConstants.initData);
|
||||
}
|
||||
|
||||
if (programInfo.globalVariables.size != 0) {
|
||||
this->globalVarBuffer = NEO::allocateGlobalsSurface(svmAllocsManager, *device->getNEODevice(), programInfo.globalVariables.size, false, programInfo.linkerInput.get(), programInfo.globalVariables.initData, context);
|
||||
this->globalVarBuffer = NEO::allocateGlobalsSurface(svmAllocsManager, *device->getNEODevice(), programInfo.globalVariables.size, false, programInfo.linkerInput.get(), programInfo.globalVariables.initData);
|
||||
}
|
||||
|
||||
for (auto &kernelInfo : this->programInfo.kernelInfos) {
|
||||
@@ -468,7 +463,6 @@ ModuleImp::ModuleImp(Device *device, ModuleBuildLog *moduleBuildLog, ModuleType
|
||||
: device(device), translationUnit(std::make_unique<ModuleTranslationUnit>(device)),
|
||||
moduleBuildLog(moduleBuildLog), type(type) {
|
||||
productFamily = device->getHwInfo().platform.eProductFamily;
|
||||
translationUnit->module = this;
|
||||
}
|
||||
|
||||
ModuleImp::~ModuleImp() {
|
||||
@@ -1028,12 +1022,10 @@ ze_result_t ModuleImp::getGlobalPointer(const char *pGlobalName, size_t *pSize,
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
Module *Module::create(Context *context, Device *device, const ze_module_desc_t *desc,
|
||||
Module *Module::create(Device *device, const ze_module_desc_t *desc,
|
||||
ModuleBuildLog *moduleBuildLog, ModuleType type, ze_result_t *result) {
|
||||
auto module = new ModuleImp(device, moduleBuildLog, type);
|
||||
|
||||
module->setContext(context);
|
||||
|
||||
*result = module->initialize(desc, device->getNEODevice());
|
||||
if (*result != ZE_RESULT_SUCCESS) {
|
||||
module->destroy();
|
||||
|
||||
@@ -25,7 +25,6 @@ struct Segments;
|
||||
}
|
||||
} // namespace NEO
|
||||
namespace L0 {
|
||||
struct Module;
|
||||
|
||||
namespace BuildOptions {
|
||||
extern NEO::ConstStringRef optDisable;
|
||||
@@ -57,7 +56,6 @@ struct ModuleTranslationUnit {
|
||||
void updateBuildLog(const std::string &newLogEntry);
|
||||
void processDebugData();
|
||||
L0::Device *device = nullptr;
|
||||
L0::Module *module = nullptr;
|
||||
|
||||
NEO::GraphicsAllocation *globalConstBuffer = nullptr;
|
||||
NEO::GraphicsAllocation *globalVarBuffer = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user