Skip to content

Commit 45757b9

Browse files
authored
[OFFLOAD] Remove unused init_device_info plugin interface (#162650)
This was used for the old interop code. It's dead code after #143491
1 parent 4f80c06 commit 45757b9

File tree

5 files changed

+2
-64
lines changed

5 files changed

+2
-64
lines changed

offload/plugins-nextgen/amdgpu/src/rtl.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2696,22 +2696,12 @@ struct AMDGPUDeviceTy : public GenericDeviceTy, AMDGenericDeviceTy {
26962696
Size / PatternSize);
26972697
}
26982698

2699-
/// Initialize the async info for interoperability purposes.
2699+
/// Initialize the async info
27002700
Error initAsyncInfoImpl(AsyncInfoWrapperTy &AsyncInfoWrapper) override {
27012701
// TODO: Implement this function.
27022702
return Plugin::success();
27032703
}
27042704

2705-
/// Initialize the device info for interoperability purposes.
2706-
Error initDeviceInfoImpl(__tgt_device_info *DeviceInfo) override {
2707-
DeviceInfo->Context = nullptr;
2708-
2709-
if (!DeviceInfo->Device)
2710-
DeviceInfo->Device = reinterpret_cast<void *>(Agent.handle);
2711-
2712-
return Plugin::success();
2713-
}
2714-
27152705
interop_spec_t selectInteropPreference(int32_t InteropType,
27162706
int32_t NumPrefers,
27172707
interop_spec_t *Prefers) override {

offload/plugins-nextgen/common/include/PluginInterface.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -951,14 +951,10 @@ struct GenericDeviceTy : public DeviceAllocatorTy {
951951
Error launchKernel(void *EntryPtr, void **ArgPtrs, ptrdiff_t *ArgOffsets,
952952
KernelArgsTy &KernelArgs, __tgt_async_info *AsyncInfo);
953953

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

958-
/// Initialize a __tgt_device_info structure. Related to interop features.
959-
Error initDeviceInfo(__tgt_device_info *DeviceInfo);
960-
virtual Error initDeviceInfoImpl(__tgt_device_info *DeviceInfo) = 0;
961-
962958
/// Enqueue a host call to AsyncInfo
963959
Error enqueueHostCall(void (*Callback)(void *), void *UserData,
964960
__tgt_async_info *AsyncInfo);
@@ -1490,10 +1486,6 @@ struct GenericPluginTy {
14901486
/// Creates an asynchronous queue for the given plugin.
14911487
int32_t init_async_info(int32_t DeviceId, __tgt_async_info **AsyncInfoPtr);
14921488

1493-
/// Creates device information to be used for diagnostics.
1494-
int32_t init_device_info(int32_t DeviceId, __tgt_device_info *DeviceInfo,
1495-
const char **ErrStr);
1496-
14971489
/// Sets the offset into the devices for use by OMPT.
14981490
int32_t set_device_identifier(int32_t UserId, int32_t DeviceId);
14991491

offload/plugins-nextgen/common/src/PluginInterface.cpp

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,12 +1524,6 @@ Error GenericDeviceTy::enqueueHostCall(void (*Callback)(void *), void *UserData,
15241524
return Err;
15251525
}
15261526

1527-
Error GenericDeviceTy::initDeviceInfo(__tgt_device_info *DeviceInfo) {
1528-
assert(DeviceInfo && "Invalid device info");
1529-
1530-
return initDeviceInfoImpl(DeviceInfo);
1531-
}
1532-
15331527
Error GenericDeviceTy::printInfo() {
15341528
auto Info = obtainInfoImpl();
15351529

@@ -2128,21 +2122,6 @@ int32_t GenericPluginTy::init_async_info(int32_t DeviceId,
21282122
return OFFLOAD_SUCCESS;
21292123
}
21302124

2131-
int32_t GenericPluginTy::init_device_info(int32_t DeviceId,
2132-
__tgt_device_info *DeviceInfo,
2133-
const char **ErrStr) {
2134-
*ErrStr = "";
2135-
2136-
auto Err = getDevice(DeviceId).initDeviceInfo(DeviceInfo);
2137-
if (Err) {
2138-
REPORT("Failure to initialize device info at " DPxMOD " on device %d: %s\n",
2139-
DPxPTR(DeviceInfo), DeviceId, toString(std::move(Err)).data());
2140-
return OFFLOAD_FAIL;
2141-
}
2142-
2143-
return OFFLOAD_SUCCESS;
2144-
}
2145-
21462125
int32_t GenericPluginTy::set_device_identifier(int32_t UserId,
21472126
int32_t DeviceId) {
21482127
UserDeviceIds[DeviceId] = UserId;

offload/plugins-nextgen/cuda/src/rtl.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -900,23 +900,6 @@ struct CUDADeviceTy : public GenericDeviceTy {
900900
return Plugin::success();
901901
}
902902

903-
/// Initialize the device info for interoperability purposes.
904-
Error initDeviceInfoImpl(__tgt_device_info *DeviceInfo) override {
905-
assert(Context && "Context is null");
906-
assert(Device != CU_DEVICE_INVALID && "Invalid CUDA device");
907-
908-
if (auto Err = setContext())
909-
return Err;
910-
911-
if (!DeviceInfo->Context)
912-
DeviceInfo->Context = Context;
913-
914-
if (!DeviceInfo->Device)
915-
DeviceInfo->Device = reinterpret_cast<void *>(Device);
916-
917-
return Plugin::success();
918-
}
919-
920903
interop_spec_t selectInteropPreference(int32_t InteropType,
921904
int32_t NumPrefers,
922905
interop_spec_t *Prefers) override {

offload/plugins-nextgen/host/src/rtl.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -344,12 +344,6 @@ struct GenELF64DeviceTy : public GenericDeviceTy {
344344
"initAsyncInfoImpl not supported");
345345
}
346346

347-
/// This plugin does not support interoperability
348-
Error initDeviceInfoImpl(__tgt_device_info *DeviceInfo) override {
349-
return Plugin::error(ErrorCode::UNSUPPORTED,
350-
"initDeviceInfoImpl not supported");
351-
}
352-
353347
Error enqueueHostCallImpl(void (*Callback)(void *), void *UserData,
354348
AsyncInfoWrapperTy &AsyncInfo) override {
355349
Callback(UserData);

0 commit comments

Comments
 (0)