[Openmp-commits] [PATCH] D72719: [nfc][libomptarget] Use __kmpc_atomic_add in target_impl.cu
Jon Chesterfield via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Tue Jan 14 10:04:45 PST 2020
JonChesterfield created this revision.
JonChesterfield added reviewers: ABataev, grokos, jdoerfert.
Herald added subscribers: openmp-commits, jfb.
Herald added a project: OpenMP.
[nfc][libomptarget] Use __kmpc_atomic_add in target_impl.cu
Use the atomic wrapper functions consistently. Alternatively, target_impl.cu
could use the cuda functions directly. Using a mixture in this file was an
oversight, happy to resolve in either direction.
Also removed some comments that look outdated in passing.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D72719
Files:
openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.cu
Index: openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.cu
===================================================================
--- openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.cu
+++ openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.cu
@@ -27,9 +27,6 @@
}
EXTERN void __kmpc_impl_set_lock(omp_lock_t *lock) {
- // int atomicCAS(int* address, int compare, int val);
- // (old == compare ? val : old)
-
// TODO: not sure spinning is a good idea here..
while (__kmpc_atomic_cas(lock, UNSET, SET) != UNSET) {
clock_t start = clock();
@@ -49,7 +46,5 @@
}
EXTERN int __kmpc_impl_test_lock(omp_lock_t *lock) {
- // int atomicCAS(int* address, int compare, int val);
- // (old == compare ? val : old)
- return atomicAdd(lock, 0);
+ return __kmpc_atomic_add(lock, 0u);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72719.238020.patch
Type: text/x-patch
Size: 803 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20200114/b109f074/attachment.bin>
More information about the Openmp-commits
mailing list