Commit 79620d8
authored
[libclc] Add OpenCL atomic_*_explicit builtins (#168318)
Implement atomic_*_explicit (e.g. atomic_store_explicit) with
memory_order plus optional memory_scope.
OpenCL memory_order maps 1:1 to Clang (e.g. OpenCL memory_order_relaxed
== Clang __ATOMIC_RELAXED), so we pass it unchanged to clc_atomic_*
function which forwards to Clang _scoped_atomic* builtins.
Other changes:
* Add __opencl_get_clang_memory_scope helper in opencl/utils.h (OpenCL
scope -> Clang scope).
* Correct atomic_compare_exchange return type to bool.
* Fix atomic_compare_exchange to return true when value stored in the
pointer equals expected value.
* Remove volatile from CLC functions so that volatile isn't present in
LLVM IR.
* Add '-fdeclare-opencl-builtins -finclude-default-header' flag to
include
declaration of memory_scope. Some constants in libclc are already
provided
by Clang’s OpenCL header; disable those in OpenCL library build and
enable them only for CLC library build.1 parent 7f01d72 commit 79620d8
File tree
64 files changed
+364
-337
lines changed- libclc
- clc
- include/clc
- atomic
- float
- integer
- lib/generic/atomic
- cmake/modules
- opencl
- include/clc/opencl
- atomic
- explicit_fence
- synchronization
- lib
- generic/atomic
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
64 files changed
+364
-337
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
477 | 477 | | |
478 | 478 | | |
479 | 479 | | |
| 480 | + | |
480 | 481 | | |
481 | 482 | | |
482 | 483 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
| 18 | + | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | | - | |
24 | | - | |
| 22 | + | |
| 23 | + | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
28 | | - | |
| 27 | + | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
34 | | - | |
35 | | - | |
| 33 | + | |
| 34 | + | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
| 14 | + | |
| 15 | + | |
11 | 16 | | |
| 17 | + | |
12 | 18 | | |
13 | 19 | | |
14 | 20 | | |
| |||
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
| 26 | + | |
20 | 27 | | |
| 28 | + | |
21 | 29 | | |
22 | 30 | | |
23 | 31 | | |
24 | 32 | | |
| 33 | + | |
25 | 34 | | |
| 35 | + | |
| 36 | + | |
26 | 37 | | |
| 38 | + | |
27 | 39 | | |
| 40 | + | |
28 | 41 | | |
| 42 | + | |
| 43 | + | |
29 | 44 | | |
| 45 | + | |
| 46 | + | |
30 | 47 | | |
| 48 | + | |
| 49 | + | |
31 | 50 | | |
| 51 | + | |
| 52 | + | |
32 | 53 | | |
| 54 | + | |
| 55 | + | |
33 | 56 | | |
| 57 | + | |
| 58 | + | |
34 | 59 | | |
| 60 | + | |
| 61 | + | |
35 | 62 | | |
| 63 | + | |
| 64 | + | |
36 | 65 | | |
| 66 | + | |
| 67 | + | |
37 | 68 | | |
| 69 | + | |
| 70 | + | |
38 | 71 | | |
| 72 | + | |
| 73 | + | |
39 | 74 | | |
| 75 | + | |
| 76 | + | |
40 | 77 | | |
| 78 | + | |
41 | 79 | | |
42 | 80 | | |
43 | 81 | | |
44 | 82 | | |
45 | 83 | | |
| 84 | + | |
46 | 85 | | |
| 86 | + | |
47 | 87 | | |
48 | 88 | | |
49 | 89 | | |
| |||
82 | 122 | | |
83 | 123 | | |
84 | 124 | | |
| 125 | + | |
85 | 126 | | |
| 127 | + | |
| 128 | + | |
86 | 129 | | |
| 130 | + | |
| 131 | + | |
87 | 132 | | |
| 133 | + | |
88 | 134 | | |
89 | 135 | | |
| 136 | + | |
90 | 137 | | |
| 138 | + | |
91 | 139 | | |
92 | 140 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
| 16 | + | |
15 | 17 | | |
| 18 | + | |
16 | 19 | | |
| 20 | + | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
| 24 | + | |
20 | 25 | | |
| 26 | + | |
21 | 27 | | |
| 28 | + | |
22 | 29 | | |
| 30 | + | |
23 | 31 | | |
24 | 32 | | |
25 | 33 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
| 39 | + | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
47 | | - | |
48 | | - | |
| 46 | + | |
49 | 47 | | |
50 | 48 | | |
51 | 49 | | |
52 | 50 | | |
53 | 51 | | |
54 | 52 | | |
55 | | - | |
56 | | - | |
| 53 | + | |
| 54 | + | |
57 | 55 | | |
58 | 56 | | |
59 | 57 | | |
60 | 58 | | |
61 | 59 | | |
62 | 60 | | |
63 | | - | |
64 | | - | |
| 61 | + | |
| 62 | + | |
65 | 63 | | |
66 | 64 | | |
67 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
| |||
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
51 | | - | |
| 55 | + | |
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
| |||
This file was deleted.
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
0 commit comments