diff options
author | Jan Vesely <jan.vesely@rutgers.edu> | 2018-06-21 19:27:18 +0000 |
---|---|---|
committer | Jan Vesely <jan.vesely@rutgers.edu> | 2018-06-21 19:27:18 +0000 |
commit | d1c3811ff7432e6b3e574d685b642ff7040eeab8 (patch) | |
tree | a41874ea4a91919321d936a17c41cdac94f35ef7 /libclc/generic | |
parent | fe08de0c892285fe52f99ee33640d64419c127dc (diff) | |
download | llvm-d1c3811ff7432e6b3e574d685b642ff7040eeab8.zip llvm-d1c3811ff7432e6b3e574d685b642ff7040eeab8.tar.gz llvm-d1c3811ff7432e6b3e574d685b642ff7040eeab8.tar.bz2 |
atom: Consolidate cl_khr_{local,global}_int32_{base,extended}_atomics declarations
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: 335276
Diffstat (limited to 'libclc/generic')
17 files changed, 58 insertions, 32 deletions
diff --git a/libclc/generic/include/clc/atom_decl_int32.inc b/libclc/generic/include/clc/atom_decl_int32.inc new file mode 100644 index 0000000..dc76356 --- /dev/null +++ b/libclc/generic/include/clc/atom_decl_int32.inc @@ -0,0 +1,10 @@ +#define __CLC_DECLARE_ATOM(ADDRSPACE, TYPE) \ + _CLC_OVERLOAD _CLC_DECL TYPE __CLC_FUNCTION (ADDRSPACE TYPE *, TYPE); + +__CLC_DECLARE_ATOM(__CLC_ADDRESS_SPACE, int) +__CLC_DECLARE_ATOM(__CLC_ADDRESS_SPACE, uint) + +#undef __CLC_DECLARE_ATOM + +#undef __CLC_FUNCTION +#undef __CLC_ADDRESS_SPACE diff --git a/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_add.h b/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_add.h index 9740b3d..244e2b2 100644 --- a/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_add.h +++ b/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_add.h @@ -1,2 +1,3 @@ -_CLC_OVERLOAD _CLC_DECL int atom_add(global int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_add(global unsigned int *p, unsigned int val); +#define __CLC_FUNCTION atom_add +#define __CLC_ADDRESS_SPACE global +#include <clc/atom_decl_int32.inc> diff --git a/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_sub.h b/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_sub.h index c435c72..311ffb4 100644 --- a/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_sub.h +++ b/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_sub.h @@ -1,2 +1,3 @@ -_CLC_OVERLOAD _CLC_DECL int atom_sub(global int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_sub(global unsigned int *p, unsigned int val); +#define __CLC_FUNCTION atom_sub +#define __CLC_ADDRESS_SPACE global +#include <clc/atom_decl_int32.inc> diff --git a/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_xchg.h b/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_xchg.h index 6a18e9e..c09eb49 100644 --- a/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_xchg.h +++ b/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_xchg.h @@ -1,2 +1,3 @@ -_CLC_OVERLOAD _CLC_DECL int atom_xchg(global int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_xchg(global unsigned int *p, unsigned int val); +#define __CLC_FUNCTION atom_xchg +#define __CLC_ADDRESS_SPACE global +#include <clc/atom_decl_int32.inc> diff --git a/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_and.h b/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_and.h index 19df7d6..4a9dd46 100644 --- a/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_and.h +++ b/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_and.h @@ -1,2 +1,3 @@ -_CLC_OVERLOAD _CLC_DECL int atom_and(global int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_and(global unsigned int *p, unsigned int val); +#define __CLC_FUNCTION atom_and +#define __CLC_ADDRESS_SPACE global +#include <clc/atom_decl_int32.inc> diff --git a/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_max.h b/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_max.h index b46ce29..e57b4d7 100644 --- a/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_max.h +++ b/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_max.h @@ -1,2 +1,3 @@ -_CLC_OVERLOAD _CLC_DECL int atom_max(global int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_max(global unsigned int *p, unsigned int val); +#define __CLC_FUNCTION atom_max +#define __CLC_ADDRESS_SPACE global +#include <clc/atom_decl_int32.inc> diff --git a/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_min.h b/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_min.h index 0e458eb..bd62f5d 100644 --- a/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_min.h +++ b/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_min.h @@ -1,2 +1,3 @@ -_CLC_OVERLOAD _CLC_DECL int atom_min(global int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_min(global unsigned int *p, unsigned int val); +#define __CLC_FUNCTION atom_min +#define __CLC_ADDRESS_SPACE global +#include <clc/atom_decl_int32.inc> diff --git a/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_or.h b/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_or.h index 91cde56..1a04055 100644 --- a/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_or.h +++ b/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_or.h @@ -1,2 +1,3 @@ -_CLC_OVERLOAD _CLC_DECL int atom_or(global int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_or(global unsigned int *p, unsigned int val); +#define __CLC_FUNCTION atom_or +#define __CLC_ADDRESS_SPACE global +#include <clc/atom_decl_int32.inc> diff --git a/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_xor.h b/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_xor.h index f787849..217c04b 100644 --- a/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_xor.h +++ b/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_xor.h @@ -1,2 +1,3 @@ -_CLC_OVERLOAD _CLC_DECL int atom_xor(global int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_xor(global unsigned int *p, unsigned int val); +#define __CLC_FUNCTION atom_xor +#define __CLC_ADDRESS_SPACE global +#include <clc/atom_decl_int32.inc> diff --git a/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_add.h b/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_add.h index 096d011..e60ffe8 100644 --- a/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_add.h +++ b/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_add.h @@ -1,2 +1,3 @@ -_CLC_OVERLOAD _CLC_DECL int atom_add(local int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_add(local unsigned int *p, unsigned int val); +#define __CLC_FUNCTION atom_add +#define __CLC_ADDRESS_SPACE local +#include <clc/atom_decl_int32.inc> diff --git a/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_sub.h b/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_sub.h index 6363780..9735071 100644 --- a/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_sub.h +++ b/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_sub.h @@ -1,2 +1,3 @@ -_CLC_OVERLOAD _CLC_DECL int atom_sub(local int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_sub(local unsigned int *p, unsigned int val); +#define __CLC_FUNCTION atom_sub +#define __CLC_ADDRESS_SPACE local +#include <clc/atom_decl_int32.inc> diff --git a/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_xchg.h b/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_xchg.h index c5a1f09..16aeafa 100644 --- a/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_xchg.h +++ b/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_xchg.h @@ -1,2 +1,3 @@ -_CLC_OVERLOAD _CLC_DECL int atom_xchg(local int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_xchg(local unsigned int *p, unsigned int val); +#define __CLC_FUNCTION atom_xchg +#define __CLC_ADDRESS_SPACE local +#include <clc/atom_decl_int32.inc> diff --git a/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_and.h b/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_and.h index 96d7b1a..710e202 100644 --- a/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_and.h +++ b/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_and.h @@ -1,2 +1,3 @@ -_CLC_OVERLOAD _CLC_DECL int atom_and(local int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_and(local unsigned int *p, unsigned int val); +#define __CLC_FUNCTION atom_and +#define __CLC_ADDRESS_SPACE local +#include <clc/atom_decl_int32.inc> diff --git a/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_max.h b/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_max.h index 7d6b17d..f675e28 100644 --- a/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_max.h +++ b/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_max.h @@ -1,2 +1,3 @@ -_CLC_OVERLOAD _CLC_DECL int atom_max(local int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_max(local unsigned int *p, unsigned int val); +#define __CLC_FUNCTION atom_max +#define __CLC_ADDRESS_SPACE local +#include <clc/atom_decl_int32.inc> diff --git a/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_min.h b/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_min.h index ddb6cf3..d2476c1 100644 --- a/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_min.h +++ b/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_min.h @@ -1,2 +1,3 @@ -_CLC_OVERLOAD _CLC_DECL int atom_min(local int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_min(local unsigned int *p, unsigned int val); +#define __CLC_FUNCTION atom_min +#define __CLC_ADDRESS_SPACE local +#include <clc/atom_decl_int32.inc> diff --git a/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_or.h b/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_or.h index 518c256..1532f61 100644 --- a/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_or.h +++ b/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_or.h @@ -1,2 +1,3 @@ -_CLC_OVERLOAD _CLC_DECL int atom_or(local int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_or(local unsigned int *p, unsigned int val); +#define __CLC_FUNCTION atom_or +#define __CLC_ADDRESS_SPACE local +#include <clc/atom_decl_int32.inc> diff --git a/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_xor.h b/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_xor.h index e6c9f2f..808a147 100644 --- a/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_xor.h +++ b/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_xor.h @@ -1,2 +1,3 @@ -_CLC_OVERLOAD _CLC_DECL int atom_xor(local int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_xor(local unsigned int *p, unsigned int val); +#define __CLC_FUNCTION atom_xor +#define __CLC_ADDRESS_SPACE local +#include <clc/atom_decl_int32.inc> |