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 new file mode 100644 index 000000000000..096d01107d89 --- /dev/null +++ b/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_add.h @@ -0,0 +1,2 @@ +_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); diff --git a/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_dec.h b/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_dec.h new file mode 100644 index 000000000000..e74d8fc12b92 --- /dev/null +++ b/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_dec.h @@ -0,0 +1,2 @@ +_CLC_OVERLOAD _CLC_DECL int atom_dec(local int *p); +_CLC_OVERLOAD _CLC_DECL unsigned int atom_dec(local unsigned int *p); diff --git a/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_inc.h b/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_inc.h new file mode 100644 index 000000000000..718f1f2b8041 --- /dev/null +++ b/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_inc.h @@ -0,0 +1,2 @@ +_CLC_OVERLOAD _CLC_DECL int atom_inc(local int *p); +_CLC_OVERLOAD _CLC_DECL unsigned int atom_inc(local unsigned int *p); 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 new file mode 100644 index 000000000000..6363780e9dec --- /dev/null +++ b/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_sub.h @@ -0,0 +1,2 @@ +_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); diff --git a/libclc/generic/include/clc/clc.h b/libclc/generic/include/clc/clc.h index b8c1cb91db74..b61df4a3bb8f 100644 --- a/libclc/generic/include/clc/clc.h +++ b/libclc/generic/include/clc/clc.h @@ -151,6 +151,12 @@ #include #include +#include +#include +#include +#include + + /* libclc internal defintions */ #ifdef __CLC_INTERNAL #include diff --git a/libclc/generic/lib/SOURCES b/libclc/generic/lib/SOURCES index e4ba1d1bf3bd..139012049c2c 100644 --- a/libclc/generic/lib/SOURCES +++ b/libclc/generic/lib/SOURCES @@ -4,6 +4,10 @@ cl_khr_global_int32_base_atomics/atom_add.cl cl_khr_global_int32_base_atomics/atom_dec.cl cl_khr_global_int32_base_atomics/atom_inc.cl cl_khr_global_int32_base_atomics/atom_sub.cl +cl_khr_local_int32_base_atomics/atom_add.cl +cl_khr_local_int32_base_atomics/atom_dec.cl +cl_khr_local_int32_base_atomics/atom_inc.cl +cl_khr_local_int32_base_atomics/atom_sub.cl convert.cl common/sign.cl geometric/cross.cl diff --git a/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_add.cl b/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_add.cl new file mode 100644 index 000000000000..a5dea1824a16 --- /dev/null +++ b/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_add.cl @@ -0,0 +1,9 @@ +#include + +#define IMPL(TYPE) \ +_CLC_OVERLOAD _CLC_DEF TYPE atom_add(local TYPE *p, TYPE val) { \ + return atomic_add(p, val); \ +} + +IMPL(int) +IMPL(unsigned int) diff --git a/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl b/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl new file mode 100644 index 000000000000..d22c333f5d56 --- /dev/null +++ b/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl @@ -0,0 +1,9 @@ +#include + +#define IMPL(TYPE) \ +_CLC_OVERLOAD _CLC_DEF TYPE atom_dec(local TYPE *p) { \ + return atom_sub(p, 1); \ +} + +IMPL(int) +IMPL(unsigned int) diff --git a/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl b/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl new file mode 100644 index 000000000000..4ba0d062997c --- /dev/null +++ b/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl @@ -0,0 +1,9 @@ +#include + +#define IMPL(TYPE) \ +_CLC_OVERLOAD _CLC_DEF TYPE atom_inc(local TYPE *p) { \ + return atom_add(p, 1); \ +} + +IMPL(int) +IMPL(unsigned int) diff --git a/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_sub.cl b/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_sub.cl new file mode 100644 index 000000000000..c96696ac2084 --- /dev/null +++ b/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_sub.cl @@ -0,0 +1,9 @@ +#include + +#define IMPL(TYPE) \ +_CLC_OVERLOAD _CLC_DEF TYPE atom_sub(local TYPE *p, TYPE val) { \ + return atomic_sub(p, val); \ +} + +IMPL(int) +IMPL(unsigned int)