-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[OFFLOAD] Remove unused init_device_info plugin interface #162650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was used for the old interop code. It's dead code after llvm#143491
@llvm/pr-subscribers-offload @llvm/pr-subscribers-backend-amdgpu Author: Alex Duran (adurang) ChangesThis was used for the old interop code. It's dead code after #143491 Full diff: https://github.com/llvm/llvm-project/pull/162650.diff 5 Files Affected:
diff --git a/offload/plugins-nextgen/amdgpu/src/rtl.cpp b/offload/plugins-nextgen/amdgpu/src/rtl.cpp
index 8d2f9755e0351..a7723b8598815 100644
--- a/offload/plugins-nextgen/amdgpu/src/rtl.cpp
+++ b/offload/plugins-nextgen/amdgpu/src/rtl.cpp
@@ -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 {
diff --git a/offload/plugins-nextgen/common/include/PluginInterface.h b/offload/plugins-nextgen/common/include/PluginInterface.h
index 5620437716b31..8c530bba3882c 100644
--- a/offload/plugins-nextgen/common/include/PluginInterface.h
+++ b/offload/plugins-nextgen/common/include/PluginInterface.h
@@ -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);
@@ -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);
diff --git a/offload/plugins-nextgen/common/src/PluginInterface.cpp b/offload/plugins-nextgen/common/src/PluginInterface.cpp
index 15b6b9866e5a2..db43cbe49cc2b 100644
--- a/offload/plugins-nextgen/common/src/PluginInterface.cpp
+++ b/offload/plugins-nextgen/common/src/PluginInterface.cpp
@@ -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();
@@ -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;
diff --git a/offload/plugins-nextgen/cuda/src/rtl.cpp b/offload/plugins-nextgen/cuda/src/rtl.cpp
index e5c4a1bfa9853..db94f7f2dd995 100644
--- a/offload/plugins-nextgen/cuda/src/rtl.cpp
+++ b/offload/plugins-nextgen/cuda/src/rtl.cpp
@@ -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 {
diff --git a/offload/plugins-nextgen/host/src/rtl.cpp b/offload/plugins-nextgen/host/src/rtl.cpp
index 0845032d0aae2..eb4ecac9907a1 100644
--- a/offload/plugins-nextgen/host/src/rtl.cpp
+++ b/offload/plugins-nextgen/host/src/rtl.cpp
@@ -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);
|
kevinsala
reviewed
Oct 9, 2025
kevinsala
approved these changes
Oct 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
jhuber6
approved these changes
Oct 9, 2025
svkeerthy
pushed a commit
that referenced
this pull request
Oct 9, 2025
This was used for the old interop code. It's dead code after #143491
clingfei
pushed a commit
to clingfei/llvm-project
that referenced
this pull request
Oct 10, 2025
This was used for the old interop code. It's dead code after llvm#143491
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This was used for the old interop code. It's dead code after #143491