Commit 78c5e3f
Artem Gindinson
Make feature macro undefs conditional on
Commits d6563b0, de262c9 and d5a2638 have provided a resolution for
`opencl-c-base.h` defining OCL C 3.0 feature macros unconditionally, which
interfered with Compute Runtime's platform-dependent definitions of extension
lists.
An issue with this approach is that `opencl-c-base.h` provides additional
defines based on `__opencl_c_atomic_scope_all_devices` being set:
```
memory_scope_all_svm_devices = __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES,
memory_scope_all_devices = memory_scope_all_svm_devices,
```
(from https://github.com/llvm/llvm-project/blob/release/16.x/clang/lib/Headers/opencl-c-base.h#L387-L392)
Simply erasing the macro definition from `opencl-c-base.h` leads to memory
scope values' erasure, as the command line definitions aren't available at that
moment due to headers' inclusion order. Original commit d6563b0 did mention an
alternative approach, which accounts for the above issue:
> Once https://reviews.llvm.org/D141297 (LLVM 16) is integrated,
an alternative approach could be to pass `-D__undef_<feature_macro>`
<...> at the OCL Clang's level (upon detecting the lack of
extension-defining inputs to `-cl-ext`).
Implement just that in scope of the current commit. Said LLORG patch simply
needs to be applied for CClang 14-15 instead of the original "unconditional
undef" one.
Signed-off-by: Artem Gindinson <artem.gindinson@intel.com>-cl-ext input (#426)1 parent d5a2638 commit 78c5e3f
File tree
3 files changed
+124
-36
lines changed- patches/clang
3 files changed
+124
-36
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
277 | 278 | | |
278 | 279 | | |
279 | 280 | | |
| 281 | + | |
280 | 282 | | |
281 | 283 | | |
282 | 284 | | |
283 | 285 | | |
| 286 | + | |
| 287 | + | |
284 | 288 | | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
285 | 305 | | |
286 | 306 | | |
287 | 307 | | |
| |||
Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 104 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
0 commit comments