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
12 changes: 1 addition & 11 deletions offload/plugins-nextgen/amdgpu/src/rtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2696,22 +2696,12 @@ struct AMDGPUDeviceTy : public GenericDeviceTy, AMDGenericDeviceTy {
Size / PatternSize);
}

/// Initialize the async info for interoperability purposes.
/// Initialize the async info
Error initAsyncInfoImpl(AsyncInfoWrapperTy &AsyncInfoWrapper) override {
// TODO: Implement this function.
return Plugin::success();
}

/// Initialize the device info for interoperability purposes.
Error initDeviceInfoImpl(__tgt_device_info *DeviceInfo) override {
DeviceInfo->Context = nullptr;

if (!DeviceInfo->Device)
DeviceInfo->Device = reinterpret_cast<void *>(Agent.handle);

return Plugin::success();
}

interop_spec_t selectInteropPreference(int32_t InteropType,
int32_t NumPrefers,
interop_spec_t *Prefers) override {
Expand Down
10 changes: 1 addition & 9 deletions offload/plugins-nextgen/common/include/PluginInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -951,14 +951,10 @@ struct GenericDeviceTy : public DeviceAllocatorTy {
Error launchKernel(void *EntryPtr, void **ArgPtrs, ptrdiff_t *ArgOffsets,
KernelArgsTy &KernelArgs, __tgt_async_info *AsyncInfo);

/// Initialize a __tgt_async_info structure. Related to interop features.
/// Initialize a __tgt_async_info structure.
Error initAsyncInfo(__tgt_async_info **AsyncInfoPtr);
virtual Error initAsyncInfoImpl(AsyncInfoWrapperTy &AsyncInfoWrapper) = 0;

/// Initialize a __tgt_device_info structure. Related to interop features.
Error initDeviceInfo(__tgt_device_info *DeviceInfo);
virtual Error initDeviceInfoImpl(__tgt_device_info *DeviceInfo) = 0;

/// Enqueue a host call to AsyncInfo
Error enqueueHostCall(void (*Callback)(void *), void *UserData,
__tgt_async_info *AsyncInfo);
Expand Down Expand Up @@ -1490,10 +1486,6 @@ struct GenericPluginTy {
/// Creates an asynchronous queue for the given plugin.
int32_t init_async_info(int32_t DeviceId, __tgt_async_info **AsyncInfoPtr);

/// Creates device information to be used for diagnostics.
int32_t init_device_info(int32_t DeviceId, __tgt_device_info *DeviceInfo,
const char **ErrStr);

/// Sets the offset into the devices for use by OMPT.
int32_t set_device_identifier(int32_t UserId, int32_t DeviceId);

Expand Down
21 changes: 0 additions & 21 deletions offload/plugins-nextgen/common/src/PluginInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1524,12 +1524,6 @@ Error GenericDeviceTy::enqueueHostCall(void (*Callback)(void *), void *UserData,
return Err;
}

Error GenericDeviceTy::initDeviceInfo(__tgt_device_info *DeviceInfo) {
assert(DeviceInfo && "Invalid device info");

return initDeviceInfoImpl(DeviceInfo);
}

Error GenericDeviceTy::printInfo() {
auto Info = obtainInfoImpl();

Expand Down Expand Up @@ -2128,21 +2122,6 @@ int32_t GenericPluginTy::init_async_info(int32_t DeviceId,
return OFFLOAD_SUCCESS;
}

int32_t GenericPluginTy::init_device_info(int32_t DeviceId,
__tgt_device_info *DeviceInfo,
const char **ErrStr) {
*ErrStr = "";

auto Err = getDevice(DeviceId).initDeviceInfo(DeviceInfo);
if (Err) {
REPORT("Failure to initialize device info at " DPxMOD " on device %d: %s\n",
DPxPTR(DeviceInfo), DeviceId, toString(std::move(Err)).data());
return OFFLOAD_FAIL;
}

return OFFLOAD_SUCCESS;
}

int32_t GenericPluginTy::set_device_identifier(int32_t UserId,
int32_t DeviceId) {
UserDeviceIds[DeviceId] = UserId;
Expand Down
17 changes: 0 additions & 17 deletions offload/plugins-nextgen/cuda/src/rtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -900,23 +900,6 @@ struct CUDADeviceTy : public GenericDeviceTy {
return Plugin::success();
}

/// Initialize the device info for interoperability purposes.
Error initDeviceInfoImpl(__tgt_device_info *DeviceInfo) override {
assert(Context && "Context is null");
assert(Device != CU_DEVICE_INVALID && "Invalid CUDA device");

if (auto Err = setContext())
return Err;

if (!DeviceInfo->Context)
DeviceInfo->Context = Context;

if (!DeviceInfo->Device)
DeviceInfo->Device = reinterpret_cast<void *>(Device);

return Plugin::success();
}

interop_spec_t selectInteropPreference(int32_t InteropType,
int32_t NumPrefers,
interop_spec_t *Prefers) override {
Expand Down
6 changes: 0 additions & 6 deletions offload/plugins-nextgen/host/src/rtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,12 +344,6 @@ struct GenELF64DeviceTy : public GenericDeviceTy {
"initAsyncInfoImpl not supported");
}

/// This plugin does not support interoperability
Error initDeviceInfoImpl(__tgt_device_info *DeviceInfo) override {
return Plugin::error(ErrorCode::UNSUPPORTED,
"initDeviceInfoImpl not supported");
}

Error enqueueHostCallImpl(void (*Callback)(void *), void *UserData,
AsyncInfoWrapperTy &AsyncInfo) override {
Callback(UserData);
Expand Down
Loading