llvm-project/libclc/generic/lib/atom_int32_binary.inc
Jan Vesely 8382e5bc48 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@gmail.com>
Tested-By: Aaron Watry <awatry@gmail.com>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 335280
2018-06-21 19:27:39 +00:00

15 lines
423 B
C++

#include <clc/clc.h>
#include "utils.h"
#define __CLC_ATOM_IMPL(AS, TYPE) \
_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); \
}
__CLC_ATOM_IMPL(__CLC_ATOMIC_ADDRESS_SPACE, int)
__CLC_ATOM_IMPL(__CLC_ATOMIC_ADDRESS_SPACE, uint)
#undef __CLC_ATOM_IMPL
#undef __CLC_ATOMIC_OP
#undef __CLC_ATOMIC_ADDRESS_SPACE