[Beignet] [PATCH 2/2] [OCL20] atomic_flag_test_and_set function fix.

xionghu.luo at intel.com xionghu.luo at intel.com
Wed Mar 9 14:02:34 UTC 2016


From: Luo Xionghu <xionghu.luo at intel.com>

should call atomic_compare_exchange_strong instead of the gen type call.
---
 backend/src/libocl/src/ocl_atom.cl | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/backend/src/libocl/src/ocl_atom.cl b/backend/src/libocl/src/ocl_atom.cl
index e0af560..68938ce 100644
--- a/backend/src/libocl/src/ocl_atom.cl
+++ b/backend/src/libocl/src/ocl_atom.cl
@@ -331,17 +331,17 @@ DECL_ATOMIC_LOAD_TYPE(load_explicit, fetch_addf, atomic_float, atomic_int, float
 
 OVERLOADABLE bool atomic_flag_test_and_set(volatile atomic_flag *object) {
   atomic_int * temp = (atomic_int*)object;
-  return (bool)__gen_ocl_atomic_compare_exchange_strong32(temp, 0, 1, memory_order_seq_cst, memory_order_seq_cst, memory_scope_device);
+  return (bool)atomic_compare_exchange_strong(temp, 0, 1);
 }
 
 OVERLOADABLE bool atomic_flag_test_and_set_explicit(volatile atomic_flag *object, memory_order order) {
   atomic_int * temp = (atomic_int*)object;
-  return (bool)__gen_ocl_atomic_compare_exchange_strong32(temp, 0, 1, memory_order_seq_cst, memory_order_seq_cst, memory_scope_device);
+  return (bool)atomic_compare_exchange_strong(temp, 0, 1);
 }
 
 OVERLOADABLE bool atomic_flag_test_and_set_explicit(volatile atomic_flag *object, memory_order order, memory_scope scope){
   atomic_int * temp = (atomic_int*)object;
-  return (bool)__gen_ocl_atomic_compare_exchange_strong32(temp, 0, 1, memory_order_seq_cst, memory_order_seq_cst, memory_scope_device);
+  return (bool)atomic_compare_exchange_strong(temp, 0, 1);
 }
 
 OVERLOADABLE void atomic_flag_clear(volatile atomic_flag *object){
-- 
2.1.4



More information about the Beignet mailing list