[Openmp-commits] [PATCH] D72719: [nfc][libomptarget] Refactor	nvptx/target_impl.cu
    Jon Chesterfield via Phabricator via Openmp-commits 
    openmp-commits at lists.llvm.org
       
    Tue Jan 14 11:33:15 PST 2020
    
    
  
This revision was automatically updated to reflect the committed changes.
JonChesterfield marked an inline comment as done.
Closed by commit rG2a43688a0a07: [nfc][libomptarget] Refactor nvptx/target_impl.cu (authored by JonChesterfield).
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72719/new/
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
@@ -19,17 +19,14 @@
 #define SET 1u
 
 EXTERN void __kmpc_impl_init_lock(omp_lock_t *lock) {
-  omp_unset_lock(lock);
+  __kmpc_impl_unset_lock(lock);
 }
 
 EXTERN void __kmpc_impl_destroy_lock(omp_lock_t *lock) {
-  omp_unset_lock(lock);
+  __kmpc_impl_unset_lock(lock);
 }
 
 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.238055.patch
Type: text/x-patch
Size: 1057 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20200114/ac07156c/attachment.bin>
    
    
More information about the Openmp-commits
mailing list