Skip to content

Commit

Permalink
atom: Use volatile pointers for cl_khr_{global,local}_int32_{base,ext…
Browse files Browse the repository at this point in the history
…ended}_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@gmail.com>
Tested-By: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 335280
  • Loading branch information
jvesely committed Jun 21, 2018
1 parent 65e3541 commit 8382e5b
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion libclc/generic/include/clc/atom_decl_int32.inc
@@ -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)
Expand Down
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
@@ -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);
2 changes: 1 addition & 1 deletion libclc/generic/lib/atom_int32_binary.inc
Expand Up @@ -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); \
}

Expand Down
@@ -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); \
}

Expand Down
@@ -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); \
}

Expand Down
@@ -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); \
}

Expand Down
@@ -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); \
}

Expand Down
@@ -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); \
}

Expand Down
@@ -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); \
}

Expand Down

0 comments on commit 8382e5b

Please sign in to comment.