aboutsummaryrefslogtreecommitdiff
path: root/offload/plugins-nextgen/amdgpu
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2026-01-29 14:39:34 -0800
committerPeter Collingbourne <peter@pcc.me.uk>2026-01-29 14:39:34 -0800
commit7b3f189a1369f9348c007730ddea953b1e68acb1 (patch)
tree7db8969ee8a34a10b6c8ae033c939c9d653376f6 /offload/plugins-nextgen/amdgpu
parentf3d6dae13ae710323a2ddbaf87af71b1abcbfada (diff)
parent0893b70ecfc4f4aca0a20a078476d191edc1e623 (diff)
downloadllvm-users/pcc/spr/codegen-introduce-machinefunctiongetpreferredalignment.zip
llvm-users/pcc/spr/codegen-introduce-machinefunctiongetpreferredalignment.tar.gz
llvm-users/pcc/spr/codegen-introduce-machinefunctiongetpreferredalignment.tar.bz2
Created using spr 1.3.6-beta.1
Diffstat (limited to 'offload/plugins-nextgen/amdgpu')
-rw-r--r--offload/plugins-nextgen/amdgpu/src/rtl.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/offload/plugins-nextgen/amdgpu/src/rtl.cpp b/offload/plugins-nextgen/amdgpu/src/rtl.cpp
index 287bb14..379c8ec 100644
--- a/offload/plugins-nextgen/amdgpu/src/rtl.cpp
+++ b/offload/plugins-nextgen/amdgpu/src/rtl.cpp
@@ -2431,7 +2431,10 @@ struct AMDGPUDeviceTy : public GenericDeviceTy, AMDGenericDeviceTy {
}
/// Query for the completion of the pending operations on the async info.
- Error queryAsyncImpl(__tgt_async_info &AsyncInfo) override {
+ Error queryAsyncImpl(__tgt_async_info &AsyncInfo, bool ReleaseQueue,
+ bool *IsQueueWorkCompleted) override {
+ if (IsQueueWorkCompleted)
+ *IsQueueWorkCompleted = false;
AMDGPUStreamTy *Stream =
reinterpret_cast<AMDGPUStreamTy *>(AsyncInfo.Queue);
assert(Stream && "Invalid stream");
@@ -2444,11 +2447,16 @@ struct AMDGPUDeviceTy : public GenericDeviceTy, AMDGenericDeviceTy {
if (!(*CompletedOrErr))
return Plugin::success();
+ if (IsQueueWorkCompleted)
+ *IsQueueWorkCompleted = true;
// Once the stream is completed, return it to stream pool and reset
// AsyncInfo. This is to make sure the synchronization only works for its
// own tasks.
- AsyncInfo.Queue = nullptr;
- return AMDGPUStreamManager.returnResource(Stream);
+ if (ReleaseQueue) {
+ AsyncInfo.Queue = nullptr;
+ return AMDGPUStreamManager.returnResource(Stream);
+ }
+ return Plugin::success();
}
/// Pin the host buffer and return the device pointer that should be used for