[llvm] [OpenMP] Add critical region lock for NVPTX targets (PR #110148)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 26 10:42:43 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-offload
Author: Joseph Huber (jhuber6)
<details>
<summary>Changes</summary>
Summary:
We define this on AMDGCN but not NVPTX, which leads to some failures
dependong on the target.
---
Full diff: https://github.com/llvm/llvm-project/pull/110148.diff
1 Files Affected:
- (modified) offload/DeviceRTL/src/Synchronization.cpp (+4)
``````````diff
diff --git a/offload/DeviceRTL/src/Synchronization.cpp b/offload/DeviceRTL/src/Synchronization.cpp
index d6452a5d589c59..9ea8d171cc830e 100644
--- a/offload/DeviceRTL/src/Synchronization.cpp
+++ b/offload/DeviceRTL/src/Synchronization.cpp
@@ -398,6 +398,10 @@ void setLock(omp_lock_t *Lock) {
} // wait for 0 to be the read value
}
+void unsetCriticalLock(omp_lock_t *Lock) { unsetLock(Lock); }
+
+void setCriticalLock(omp_lock_t *Lock) { setLock(Lock); }
+
#pragma omp end declare variant
///}
``````````
</details>
https://github.com/llvm/llvm-project/pull/110148
More information about the llvm-commits
mailing list