Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions offload/plugins-nextgen/level_zero/src/L0DynWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ DLWRAP(zeMemGetAddressRange, 4)
DLWRAP(zeMemGetAllocProperties, 4)
DLWRAP(zeModuleDynamicLink, 3)
DLWRAP(zeModuleGetGlobalPointer, 4)
DLWRAP(zeModuleGetFunctionPointer, 3)
DLWRAP(zeModuleGetNativeBinary, 3)
DLWRAP(zesDeviceEnumMemoryModules, 3)
DLWRAP(zesMemoryGetState, 2)
Expand Down
9 changes: 5 additions & 4 deletions offload/plugins-nextgen/level_zero/src/L0Program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,19 +459,20 @@ Expected<void *> L0ProgramTy::getOffloadVarDeviceAddr(const char *CName) const {
return Plugin::error(ErrorCode::INVALID_ARGUMENT,
"Invalid arguments to getOffloadVarDeviceAddr");

std::string Name(CName);
size_t SizeDummy = 0;
void *DevicePtr = nullptr;
ze_result_t RC;
for (auto Module : Modules) {
CALL_ZE(RC, zeModuleGetGlobalPointer, Module, Name.c_str(), &SizeDummy,
CALL_ZE(RC, zeModuleGetGlobalPointer, Module, CName, &SizeDummy,
&DevicePtr);
if (RC == ZE_RESULT_SUCCESS && DevicePtr)
return DevicePtr;
CALL_ZE(RC, zeModuleGetFunctionPointer, Module, CName, &DevicePtr);
if (RC == ZE_RESULT_SUCCESS && DevicePtr)
return DevicePtr;
}
return Plugin::error(ErrorCode::INVALID_ARGUMENT,
"Global variable '%s' not found on device",
Name.c_str());
"Symbol '%s' not found on device", CName);
}

Error L0ProgramTy::readGlobalVariable(const char *Name, size_t Size,
Expand Down