[Openmp-commits] [PATCH] D109511: [libomptarget][amdgpu] Clean up destruction of hsa queue, signals

Jon Chesterfield via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Sep 9 11:37:10 PDT 2021


JonChesterfield updated this revision to Diff 371672.
JonChesterfield added a comment.

- roll back most of the patch


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109511/new/

https://reviews.llvm.org/D109511

Files:
  openmp/libomptarget/plugins/amdgpu/dynamic_hsa/hsa.cpp
  openmp/libomptarget/plugins/amdgpu/dynamic_hsa/hsa.h
  openmp/libomptarget/plugins/amdgpu/src/rtl.cpp


Index: openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
===================================================================
--- openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
+++ openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
@@ -797,6 +797,7 @@
           UINT32_MAX, UINT32_MAX, &HSAQueues[i]);
       if (rc != HSA_STATUS_SUCCESS) {
         DP("Failed to create HSA queue %d\n", i);
+        HSAQueues[i] = nullptr;
         return;
       }
 
Index: openmp/libomptarget/plugins/amdgpu/dynamic_hsa/hsa.h
===================================================================
--- openmp/libomptarget/plugins/amdgpu/dynamic_hsa/hsa.h
+++ openmp/libomptarget/plugins/amdgpu/dynamic_hsa/hsa.h
@@ -142,6 +142,8 @@
                               void *data, uint32_t private_segment_size,
                               uint32_t group_segment_size, hsa_queue_t **queue);
 
+hsa_status_t hsa_queue_destroy(hsa_queue_t *queue);
+
 uint64_t hsa_queue_load_read_index_scacquire(const hsa_queue_t *queue);
 
 uint64_t hsa_queue_add_write_index_relaxed(const hsa_queue_t *queue,
Index: openmp/libomptarget/plugins/amdgpu/dynamic_hsa/hsa.cpp
===================================================================
--- openmp/libomptarget/plugins/amdgpu/dynamic_hsa/hsa.cpp
+++ openmp/libomptarget/plugins/amdgpu/dynamic_hsa/hsa.cpp
@@ -29,6 +29,7 @@
 DLWRAP(hsa_signal_store_screlease, 2);
 DLWRAP(hsa_signal_wait_scacquire, 5);
 DLWRAP(hsa_queue_create, 8);
+DLWRAP(hsa_queue_destroy, 1);
 DLWRAP(hsa_queue_load_read_index_scacquire, 1);
 DLWRAP(hsa_queue_add_write_index_relaxed, 2);
 DLWRAP(hsa_memory_copy, 3);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109511.371672.patch
Type: text/x-patch
Size: 1597 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210909/9d641fa9/attachment.bin>


More information about the Openmp-commits mailing list