[Libclc-dev] [PATCH] amdgcn: Use __constant AS for amdgcn builtins.

Arsenault, Matthew via Libclc-dev libclc-dev at lists.llvm.org
Fri Aug 3 07:34:57 PDT 2018


LGTM

________________________________
From: Libclc-dev <libclc-dev-bounces at lists.llvm.org> on behalf of Jan Vesely via Libclc-dev <libclc-dev at lists.llvm.org>
Sent: Thursday, August 2, 2018 10:30:56 PM
To: libclc-dev at lists.llvm.org
Subject: [Libclc-dev] [PATCH] amdgcn: Use __constant AS for amdgcn builtins.

Fixes build after clang r338707
Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
---
 amdgcn-amdhsa/lib/workitem/get_global_size.cl | 4 +++-
 amdgcn-amdhsa/lib/workitem/get_local_size.cl  | 4 +++-
 amdgcn/lib/workitem/get_global_offset.cl      | 4 +++-
 amdgcn/lib/workitem/get_work_dim.cl           | 4 +++-
 4 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/amdgcn-amdhsa/lib/workitem/get_global_size.cl b/amdgcn-amdhsa/lib/workitem/get_global_size.cl
index 2289615..392cd08 100644
--- a/amdgcn-amdhsa/lib/workitem/get_global_size.cl
+++ b/amdgcn-amdhsa/lib/workitem/get_global_size.cl
@@ -1,6 +1,8 @@
 #include <clc/clc.h>

-#if __clang_major__ >= 7
+#if __clang_major__ >= 8
+#define CONST_AS __constant
+#elif __clang_major__ >= 7
 #define CONST_AS __attribute__((address_space(4)))
 #else
 #define CONST_AS __attribute__((address_space(2)))
diff --git a/amdgcn-amdhsa/lib/workitem/get_local_size.cl b/amdgcn-amdhsa/lib/workitem/get_local_size.cl
index 034c6d9..64d1cf4 100644
--- a/amdgcn-amdhsa/lib/workitem/get_local_size.cl
+++ b/amdgcn-amdhsa/lib/workitem/get_local_size.cl
@@ -1,6 +1,8 @@
 #include <clc/clc.h>

-#if __clang_major__ >= 7
+#if __clang_major__ >= 8
+#define CONST_AS __constant
+#elif __clang_major__ >= 7
 #define CONST_AS __attribute__((address_space(4)))
 #else
 #define CONST_AS __attribute__((address_space(2)))
diff --git a/amdgcn/lib/workitem/get_global_offset.cl b/amdgcn/lib/workitem/get_global_offset.cl
index 0c2b948..0a87cd2 100644
--- a/amdgcn/lib/workitem/get_global_offset.cl
+++ b/amdgcn/lib/workitem/get_global_offset.cl
@@ -1,6 +1,8 @@
 #include <clc/clc.h>

-#if __clang_major__ >= 7
+#if __clang_major__ >= 8
+#define CONST_AS __constant
+#elif __clang_major__ >= 7
 #define CONST_AS __attribute__((address_space(4)))
 #else
 #define CONST_AS __attribute__((address_space(2)))
diff --git a/amdgcn/lib/workitem/get_work_dim.cl b/amdgcn/lib/workitem/get_work_dim.cl
index 8eb81ba..3add9b6 100644
--- a/amdgcn/lib/workitem/get_work_dim.cl
+++ b/amdgcn/lib/workitem/get_work_dim.cl
@@ -1,6 +1,8 @@
 #include <clc/clc.h>

-#if __clang_major__ >= 7
+#if __clang_major__ >= 8
+#define CONST_AS __constant
+#elif __clang_major__ >= 7
 #define CONST_AS __attribute__((address_space(4)))
 #else
 #define CONST_AS __attribute__((address_space(2)))
--
2.16.4

_______________________________________________
Libclc-dev mailing list
Libclc-dev at lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/libclc-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libclc-dev/attachments/20180803/5630a6cb/attachment.html>


More information about the Libclc-dev mailing list