[libclc] r335280 - atom: Use volatile pointers for cl_khr_{global, local}_int32_{base, extended}_atomics

Jan Vesely via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 21 12:27:39 PDT 2018


Author: jvesely
Date: Thu Jun 21 12:27:39 2018
New Revision: 335280

URL: http://llvm.org/viewvc/llvm-project?rev=335280&view=rev
Log:
atom: Use volatile pointers for cl_khr_{global,local}_int32_{base,extended}_atomics

int64 versions were switched to volatile pointers in cl1.1
cl1.1 also renamed atom_ functions to atomic_ that use volatile pointers.
CTS and applications use volatile pointers.

Passes CTS on carrizo
no return piglit tests still pass on turks.

Reviewed-By: Aaron Watry <awatry at gmail.com>
Tested-By: Aaron Watry <awatry at gmail.com>
Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>

Modified:
    libclc/trunk/generic/include/clc/atom_decl_int32.inc
    libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_cmpxchg.h
    libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_dec.h
    libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_inc.h
    libclc/trunk/generic/include/clc/cl_khr_local_int32_base_atomics/atom_cmpxchg.h
    libclc/trunk/generic/include/clc/cl_khr_local_int32_base_atomics/atom_dec.h
    libclc/trunk/generic/include/clc/cl_khr_local_int32_base_atomics/atom_inc.h
    libclc/trunk/generic/lib/atom_int32_binary.inc
    libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_cmpxchg.cl
    libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl
    libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl
    libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_cmpxchg.cl
    libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl
    libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl

Modified: libclc/trunk/generic/include/clc/atom_decl_int32.inc
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/atom_decl_int32.inc?rev=335280&r1=335279&r2=335280&view=diff
==============================================================================
--- libclc/trunk/generic/include/clc/atom_decl_int32.inc (original)
+++ libclc/trunk/generic/include/clc/atom_decl_int32.inc Thu Jun 21 12:27:39 2018
@@ -1,5 +1,5 @@
 #define __CLC_DECLARE_ATOM(ADDRSPACE, TYPE) \
-	_CLC_OVERLOAD _CLC_DECL TYPE __CLC_FUNCTION (ADDRSPACE TYPE *, TYPE);
+	_CLC_OVERLOAD _CLC_DECL TYPE __CLC_FUNCTION (volatile ADDRSPACE TYPE *, TYPE);
 
 __CLC_DECLARE_ATOM(__CLC_ADDRESS_SPACE, int)
 __CLC_DECLARE_ATOM(__CLC_ADDRESS_SPACE, uint)

Modified: libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_cmpxchg.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_cmpxchg.h?rev=335280&r1=335279&r2=335280&view=diff
==============================================================================
--- libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_cmpxchg.h (original)
+++ libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_cmpxchg.h Thu Jun 21 12:27:39 2018
@@ -1,2 +1,2 @@
-_CLC_OVERLOAD _CLC_DECL int atom_cmpxchg(global int *p, int cmp, int val);
-_CLC_OVERLOAD _CLC_DECL unsigned int atom_cmpxchg(global unsigned int *p, unsigned int cmp, unsigned int val);
+_CLC_OVERLOAD _CLC_DECL int atom_cmpxchg(volatile global int *p, int cmp, int val);
+_CLC_OVERLOAD _CLC_DECL unsigned int atom_cmpxchg(volatile global unsigned int *p, unsigned int cmp, unsigned int val);

Modified: libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_dec.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_dec.h?rev=335280&r1=335279&r2=335280&view=diff
==============================================================================
--- libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_dec.h (original)
+++ libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_dec.h Thu Jun 21 12:27:39 2018
@@ -1,2 +1,2 @@
-_CLC_OVERLOAD _CLC_DECL int atom_dec(global int *p);
-_CLC_OVERLOAD _CLC_DECL unsigned int atom_dec(global unsigned int *p);
+_CLC_OVERLOAD _CLC_DECL int atom_dec(volatile global int *p);
+_CLC_OVERLOAD _CLC_DECL unsigned int atom_dec(volatile global unsigned int *p);

Modified: libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_inc.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_inc.h?rev=335280&r1=335279&r2=335280&view=diff
==============================================================================
--- libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_inc.h (original)
+++ libclc/trunk/generic/include/clc/cl_khr_global_int32_base_atomics/atom_inc.h Thu Jun 21 12:27:39 2018
@@ -1,2 +1,2 @@
-_CLC_OVERLOAD _CLC_DECL int atom_inc(global int *p);
-_CLC_OVERLOAD _CLC_DECL unsigned int atom_inc(global unsigned int *p);
+_CLC_OVERLOAD _CLC_DECL int atom_inc(volatile global int *p);
+_CLC_OVERLOAD _CLC_DECL unsigned int atom_inc(volatile global unsigned int *p);

Modified: libclc/trunk/generic/include/clc/cl_khr_local_int32_base_atomics/atom_cmpxchg.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/cl_khr_local_int32_base_atomics/atom_cmpxchg.h?rev=335280&r1=335279&r2=335280&view=diff
==============================================================================
--- libclc/trunk/generic/include/clc/cl_khr_local_int32_base_atomics/atom_cmpxchg.h (original)
+++ libclc/trunk/generic/include/clc/cl_khr_local_int32_base_atomics/atom_cmpxchg.h Thu Jun 21 12:27:39 2018
@@ -1,2 +1,2 @@
-_CLC_OVERLOAD _CLC_DECL int atom_cmpxchg(local int *p, int cmp, int val);
-_CLC_OVERLOAD _CLC_DECL unsigned int atom_cmpxchg(local unsigned int *p, unsigned int cmp, unsigned int val);
+_CLC_OVERLOAD _CLC_DECL int atom_cmpxchg(volatile local int *p, int cmp, int val);
+_CLC_OVERLOAD _CLC_DECL unsigned int atom_cmpxchg(volatile local unsigned int *p, unsigned int cmp, unsigned int val);

Modified: libclc/trunk/generic/include/clc/cl_khr_local_int32_base_atomics/atom_dec.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/cl_khr_local_int32_base_atomics/atom_dec.h?rev=335280&r1=335279&r2=335280&view=diff
==============================================================================
--- libclc/trunk/generic/include/clc/cl_khr_local_int32_base_atomics/atom_dec.h (original)
+++ libclc/trunk/generic/include/clc/cl_khr_local_int32_base_atomics/atom_dec.h Thu Jun 21 12:27:39 2018
@@ -1,2 +1,2 @@
-_CLC_OVERLOAD _CLC_DECL int atom_dec(local int *p);
-_CLC_OVERLOAD _CLC_DECL unsigned int atom_dec(local unsigned int *p);
+_CLC_OVERLOAD _CLC_DECL int atom_dec(volatile local int *p);
+_CLC_OVERLOAD _CLC_DECL unsigned int atom_dec(volatile local unsigned int *p);

Modified: libclc/trunk/generic/include/clc/cl_khr_local_int32_base_atomics/atom_inc.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/cl_khr_local_int32_base_atomics/atom_inc.h?rev=335280&r1=335279&r2=335280&view=diff
==============================================================================
--- libclc/trunk/generic/include/clc/cl_khr_local_int32_base_atomics/atom_inc.h (original)
+++ libclc/trunk/generic/include/clc/cl_khr_local_int32_base_atomics/atom_inc.h Thu Jun 21 12:27:39 2018
@@ -1,2 +1,2 @@
-_CLC_OVERLOAD _CLC_DECL int atom_inc(local int *p);
-_CLC_OVERLOAD _CLC_DECL unsigned int atom_inc(local unsigned int *p);
+_CLC_OVERLOAD _CLC_DECL int atom_inc(volatile local int *p);
+_CLC_OVERLOAD _CLC_DECL unsigned int atom_inc(volatile local unsigned int *p);

Modified: libclc/trunk/generic/lib/atom_int32_binary.inc
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/atom_int32_binary.inc?rev=335280&r1=335279&r2=335280&view=diff
==============================================================================
--- libclc/trunk/generic/lib/atom_int32_binary.inc (original)
+++ libclc/trunk/generic/lib/atom_int32_binary.inc Thu Jun 21 12:27:39 2018
@@ -2,7 +2,7 @@
 #include "utils.h"
 
 #define __CLC_ATOM_IMPL(AS, TYPE) \
-_CLC_OVERLOAD _CLC_DEF TYPE __CLC_XCONCAT(atom_, __CLC_ATOMIC_OP) (AS TYPE *p, TYPE val) { \
+_CLC_OVERLOAD _CLC_DEF TYPE __CLC_XCONCAT(atom_, __CLC_ATOMIC_OP) (volatile AS TYPE *p, TYPE val) { \
   return __CLC_XCONCAT(atomic_, __CLC_ATOMIC_OP) (p, val); \
 }
 

Modified: libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_cmpxchg.cl
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_cmpxchg.cl?rev=335280&r1=335279&r2=335280&view=diff
==============================================================================
--- libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_cmpxchg.cl (original)
+++ libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_cmpxchg.cl Thu Jun 21 12:27:39 2018
@@ -1,7 +1,7 @@
 #include <clc/clc.h>
 
 #define IMPL(TYPE) \
-_CLC_OVERLOAD _CLC_DEF TYPE atom_cmpxchg(global TYPE *p, TYPE cmp, TYPE val) { \
+_CLC_OVERLOAD _CLC_DEF TYPE atom_cmpxchg(volatile global TYPE *p, TYPE cmp, TYPE val) { \
   return atomic_cmpxchg(p, cmp, val); \
 }
 

Modified: libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl?rev=335280&r1=335279&r2=335280&view=diff
==============================================================================
--- libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl (original)
+++ libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl Thu Jun 21 12:27:39 2018
@@ -1,7 +1,7 @@
 #include <clc/clc.h>
 
 #define IMPL(TYPE) \
-_CLC_OVERLOAD _CLC_DEF TYPE atom_dec(global TYPE *p) { \
+_CLC_OVERLOAD _CLC_DEF TYPE atom_dec(volatile global TYPE *p) { \
   return atomic_dec(p); \
 }
 

Modified: libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl?rev=335280&r1=335279&r2=335280&view=diff
==============================================================================
--- libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl (original)
+++ libclc/trunk/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl Thu Jun 21 12:27:39 2018
@@ -1,7 +1,7 @@
 #include <clc/clc.h>
 
 #define IMPL(TYPE) \
-_CLC_OVERLOAD _CLC_DEF TYPE atom_inc(global TYPE *p) { \
+_CLC_OVERLOAD _CLC_DEF TYPE atom_inc(volatile global TYPE *p) { \
   return atomic_inc(p); \
 }
 

Modified: libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_cmpxchg.cl
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_cmpxchg.cl?rev=335280&r1=335279&r2=335280&view=diff
==============================================================================
--- libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_cmpxchg.cl (original)
+++ libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_cmpxchg.cl Thu Jun 21 12:27:39 2018
@@ -1,7 +1,7 @@
 #include <clc/clc.h>
 
 #define IMPL(TYPE) \
-_CLC_OVERLOAD _CLC_DEF TYPE atom_cmpxchg(local TYPE *p, TYPE cmp, TYPE val) { \
+_CLC_OVERLOAD _CLC_DEF TYPE atom_cmpxchg(volatile local TYPE *p, TYPE cmp, TYPE val) { \
   return atomic_cmpxchg(p, cmp, val); \
 }
 

Modified: libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl?rev=335280&r1=335279&r2=335280&view=diff
==============================================================================
--- libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl (original)
+++ libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl Thu Jun 21 12:27:39 2018
@@ -1,7 +1,7 @@
 #include <clc/clc.h>
 
 #define IMPL(TYPE) \
-_CLC_OVERLOAD _CLC_DEF TYPE atom_dec(local TYPE *p) { \
+_CLC_OVERLOAD _CLC_DEF TYPE atom_dec(volatile local TYPE *p) { \
   return atomic_dec(p); \
 }
 

Modified: libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl?rev=335280&r1=335279&r2=335280&view=diff
==============================================================================
--- libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl (original)
+++ libclc/trunk/generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl Thu Jun 21 12:27:39 2018
@@ -1,7 +1,7 @@
 #include <clc/clc.h>
 
 #define IMPL(TYPE) \
-_CLC_OVERLOAD _CLC_DEF TYPE atom_inc(local TYPE *p) { \
+_CLC_OVERLOAD _CLC_DEF TYPE atom_inc(volatile local TYPE *p) { \
   return atomic_inc(p); \
 }
 




More information about the cfe-commits mailing list