Skip to content

Commit d5a2638

Browse files
author
Artem Gindinson
authored
Erase all feature macro definitions for OpenCL 3.0 (#425)
As a follow-up on commit de262c9, delete default definitions for all 3.0 feature macros. The motivation is similar to that in the image support macro case - we need to account for target platform features whenever the Clang FE is called in Compute Runtime's context. Signed-off-by: Artem Gindinson <[email protected]>
1 parent bf679f4 commit d5a2638

File tree

2 files changed

+36
-25
lines changed

2 files changed

+36
-25
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
From 1e987989037c52c0c786f7c9b6b5bed21b740375 Mon Sep 17 00:00:00 2001
2+
From: Artem Gindinson <[email protected]>
3+
Date: Thu, 23 Mar 2023 10:58:45 +0100
4+
Subject: [PATCH] [PATCH] Do not define CL3.0 support macros in OpenCL C header
5+
base
6+
7+
---
8+
clang/lib/Headers/opencl-c-base.h | 11 ---
9+
1 file changed, 11 deletions(-)
10+
11+
diff --git a/clang/lib/Headers/opencl-c-base.h b/clang/lib/Headers/opencl-c-base.h
12+
index 5191c41bcd05..8907886aeecf 100644
13+
--- a/clang/lib/Headers/opencl-c-base.h
14+
+++ b/clang/lib/Headers/opencl-c-base.h
15+
@@ -63,17 +63,6 @@
16+
#define __opencl_c_images 1
17+
#endif
18+
19+
-// Define header-only feature macros for OpenCL C 3.0.
20+
-#if (__OPENCL_CPP_VERSION__ == 202100 || __OPENCL_C_VERSION__ == 300)
21+
-// For the SPIR and SPIR-V target all features are supported.
22+
-#if defined(__SPIR__) || defined(__SPIRV__)
23+
-#define __opencl_c_atomic_order_seq_cst 1
24+
-#define __opencl_c_atomic_scope_device 1
25+
-#define __opencl_c_atomic_scope_all_devices 1
26+
-#define __opencl_c_read_write_images 1
27+
-#endif // defined(__SPIR__)
28+
-#endif // (__OPENCL_CPP_VERSION__ == 202100 || __OPENCL_C_VERSION__ == 300)
29+
-
30+
#if !defined(__opencl_c_generic_address_space)
31+
// Internal feature macro to provide named (global, local, private) address
32+
// space overloads for builtin functions that take a pointer argument.
33+
34+
--
35+
2.34.1
36+

patches/clang/0004-Do-not-define-image-support-macros-in-OpenCL-C-base.patch

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)