[Libclc-dev] [PATCH 1/7] atomic: Move define cleanup to shared include
Jan Vesely via Libclc-dev
libclc-dev at lists.llvm.org
Wed Jun 20 13:34:58 PDT 2018
Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
---
generic/include/clc/atomic/atomic_add.h | 3 ---
generic/include/clc/atomic/atomic_and.h | 3 ---
generic/include/clc/atomic/atomic_decl.inc | 6 +++++-
generic/include/clc/atomic/atomic_max.h | 3 ---
generic/include/clc/atomic/atomic_min.h | 3 ---
generic/include/clc/atomic/atomic_or.h | 3 ---
generic/include/clc/atomic/atomic_sub.h | 3 ---
generic/include/clc/atomic/atomic_xchg.h | 7 +++----
generic/include/clc/atomic/atomic_xor.h | 3 ---
9 files changed, 8 insertions(+), 26 deletions(-)
diff --git a/generic/include/clc/atomic/atomic_add.h b/generic/include/clc/atomic/atomic_add.h
index 7dd4fd3..302e4fb 100644
--- a/generic/include/clc/atomic/atomic_add.h
+++ b/generic/include/clc/atomic/atomic_add.h
@@ -1,5 +1,2 @@
#define __CLC_FUNCTION atomic_add
#include <clc/atomic/atomic_decl.inc>
-#undef __CLC_FUNCTION
-#undef __CLC_DECLARE_ATOMIC
-#undef __CLC_DECLARE_ATOMIC_ADDRSPACE
diff --git a/generic/include/clc/atomic/atomic_and.h b/generic/include/clc/atomic/atomic_and.h
index a198c46..4759b9f 100644
--- a/generic/include/clc/atomic/atomic_and.h
+++ b/generic/include/clc/atomic/atomic_and.h
@@ -1,5 +1,2 @@
#define __CLC_FUNCTION atomic_and
#include <clc/atomic/atomic_decl.inc>
-#undef __CLC_FUNCTION
-#undef __CLC_DECLARE_ATOMIC
-#undef __CLC_DECLARE_ATOMIC_ADDRSPACE
diff --git a/generic/include/clc/atomic/atomic_decl.inc b/generic/include/clc/atomic/atomic_decl.inc
index 49ccde2..4d81ac1 100644
--- a/generic/include/clc/atomic/atomic_decl.inc
+++ b/generic/include/clc/atomic/atomic_decl.inc
@@ -1,4 +1,3 @@
-
#define __CLC_DECLARE_ATOMIC(ADDRSPACE, TYPE) \
_CLC_OVERLOAD _CLC_DECL TYPE __CLC_FUNCTION (volatile ADDRSPACE TYPE *, TYPE);
@@ -8,3 +7,8 @@
__CLC_DECLARE_ATOMIC_ADDRSPACE(int)
__CLC_DECLARE_ATOMIC_ADDRSPACE(uint)
+
+#undef __CLC_DECLARE_ATOMIC_ADDRSPACE
+#undef __CLC_DECLARE_ATOMIC
+
+#undef __CLC_FUNCTION
diff --git a/generic/include/clc/atomic/atomic_max.h b/generic/include/clc/atomic/atomic_max.h
index ed09ec9..f6803c4 100644
--- a/generic/include/clc/atomic/atomic_max.h
+++ b/generic/include/clc/atomic/atomic_max.h
@@ -1,5 +1,2 @@
#define __CLC_FUNCTION atomic_max
#include <clc/atomic/atomic_decl.inc>
-#undef __CLC_FUNCTION
-#undef __CLC_DECLARE_ATOMIC
-#undef __CLC_DECLARE_ATOMIC_ADDRSPACE
diff --git a/generic/include/clc/atomic/atomic_min.h b/generic/include/clc/atomic/atomic_min.h
index 6a46af4..dfa8179 100644
--- a/generic/include/clc/atomic/atomic_min.h
+++ b/generic/include/clc/atomic/atomic_min.h
@@ -1,5 +1,2 @@
#define __CLC_FUNCTION atomic_min
#include <clc/atomic/atomic_decl.inc>
-#undef __CLC_FUNCTION
-#undef __CLC_DECLARE_ATOMIC
-#undef __CLC_DECLARE_ATOMIC_ADDRSPACE
diff --git a/generic/include/clc/atomic/atomic_or.h b/generic/include/clc/atomic/atomic_or.h
index 2369d81..64ce311 100644
--- a/generic/include/clc/atomic/atomic_or.h
+++ b/generic/include/clc/atomic/atomic_or.h
@@ -1,5 +1,2 @@
#define __CLC_FUNCTION atomic_or
#include <clc/atomic/atomic_decl.inc>
-#undef __CLC_FUNCTION
-#undef __CLC_DECLARE_ATOMIC
-#undef __CLC_DECLARE_ATOMIC_ADDRSPACE
diff --git a/generic/include/clc/atomic/atomic_sub.h b/generic/include/clc/atomic/atomic_sub.h
index 993e995..0d2f99e 100644
--- a/generic/include/clc/atomic/atomic_sub.h
+++ b/generic/include/clc/atomic/atomic_sub.h
@@ -1,5 +1,2 @@
#define __CLC_FUNCTION atomic_sub
#include <clc/atomic/atomic_decl.inc>
-#undef __CLC_FUNCTION
-#undef __CLC_DECLARE_ATOMIC
-#undef __CLC_DECLARE_ATOMIC_ADDRSPACE
diff --git a/generic/include/clc/atomic/atomic_xchg.h b/generic/include/clc/atomic/atomic_xchg.h
index ebe0d9a..59a9572 100644
--- a/generic/include/clc/atomic/atomic_xchg.h
+++ b/generic/include/clc/atomic/atomic_xchg.h
@@ -1,6 +1,5 @@
#define __CLC_FUNCTION atomic_xchg
+
+_CLC_OVERLOAD _CLC_DECL float __CLC_FUNCTION (volatile local float *, float);
+_CLC_OVERLOAD _CLC_DECL float __CLC_FUNCTION (volatile global float *, float);
#include <clc/atomic/atomic_decl.inc>
-__CLC_DECLARE_ATOMIC_ADDRSPACE(float);
-#undef __CLC_FUNCTION
-#undef __CLC_DECLARE_ATOMIC
-#undef __CLC_DECLARE_ATOMIC_ADDRSPACE
diff --git a/generic/include/clc/atomic/atomic_xor.h b/generic/include/clc/atomic/atomic_xor.h
index 2cb7480..1318bf2 100644
--- a/generic/include/clc/atomic/atomic_xor.h
+++ b/generic/include/clc/atomic/atomic_xor.h
@@ -1,5 +1,2 @@
#define __CLC_FUNCTION atomic_xor
#include <clc/atomic/atomic_decl.inc>
-#undef __CLC_FUNCTION
-#undef __CLC_DECLARE_ATOMIC
-#undef __CLC_DECLARE_ATOMIC_ADDRSPACE
--
2.16.4
More information about the Libclc-dev
mailing list