|
1 |
| -From d1b4758460cfd04d35ae332033a8d18614e6a7ff Mon Sep 17 00:00:00 2001 |
| 1 | +From 85505bdb386a426310c1fb0a845780beeeec4353 Mon Sep 17 00:00:00 2001 |
2 | 2 | From: haonanya < [email protected]>
|
3 |
| -Date: Wed, 28 Jul 2021 14:20:08 +0800 |
| 3 | +Date: Wed, 9 Feb 2022 09:16:35 +0800 |
4 | 4 | Subject: [PATCH] Support cl_ext_float_atomics
|
5 | 5 |
|
6 | 6 | This backports https://reviews.llvm.org/D106343 and https://reviews.llvm.org/D109740
|
7 | 7 |
|
8 | 8 | Signed-off-by: haonanya < [email protected]>
|
9 | 9 | ---
|
10 | 10 | clang/lib/Headers/opencl-c-base.h | 19 ++
|
11 |
| - clang/lib/Headers/opencl-c.h | 372 ++++++++++++++++++++++++++ |
| 11 | + clang/lib/Headers/opencl-c.h | 378 ++++++++++++++++++++++++++ |
12 | 12 | clang/lib/Sema/Sema.cpp | 3 +
|
13 | 13 | clang/test/Headers/opencl-c-header.cl | 84 ++++++
|
14 |
| - 4 files changed, 478 insertions(+) |
| 14 | + 4 files changed, 484 insertions(+) |
15 | 15 |
|
16 | 16 | diff --git a/clang/lib/Headers/opencl-c-base.h b/clang/lib/Headers/opencl-c-base.h
|
17 | 17 | index e8dcd70377e5..d94d64372dbb 100644
|
@@ -44,10 +44,10 @@ index e8dcd70377e5..d94d64372dbb 100644
|
44 | 44 | #endif // (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
|
45 | 45 |
|
46 | 46 | diff --git a/clang/lib/Headers/opencl-c.h b/clang/lib/Headers/opencl-c.h
|
47 |
| -index ab665628c8e1..63a5155fe221 100644 |
| 47 | +index ab665628c8e1..584db7e81e04 100644 |
48 | 48 | --- a/clang/lib/Headers/opencl-c.h
|
49 | 49 | +++ b/clang/lib/Headers/opencl-c.h
|
50 |
| -@@ -13531,6 +13531,378 @@ intptr_t __ovld atomic_fetch_max_explicit(volatile atomic_intptr_t *object, uint |
| 50 | +@@ -13531,6 +13531,384 @@ intptr_t __ovld atomic_fetch_max_explicit(volatile atomic_intptr_t *object, uint |
51 | 51 | intptr_t __ovld atomic_fetch_max_explicit(volatile atomic_intptr_t *object, uintptr_t opermax, memory_order minder, memory_scope scope);
|
52 | 52 | #endif
|
53 | 53 |
|
@@ -217,6 +217,7 @@ index ab665628c8e1..63a5155fe221 100644
|
217 | 217 | +#endif // defined(__opencl_c_ext_fp32_global_atomic_min_max) && \
|
218 | 218 | + defined(__opencl_c_ext_fp32_local_atomic_min_max)
|
219 | 219 | +
|
| 220 | ++#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) |
220 | 221 | +#if defined(__opencl_c_ext_fp64_global_atomic_min_max)
|
221 | 222 | +double __ovld atomic_fetch_min(volatile __global atomic_double *object,
|
222 | 223 | + double operand);
|
@@ -267,6 +268,8 @@ index ab665628c8e1..63a5155fe221 100644
|
267 | 268 | + memory_scope scope);
|
268 | 269 | +#endif // defined(__opencl_c_ext_fp64_global_atomic_min_max) && \
|
269 | 270 | + defined(__opencl_c_ext_fp64_local_atomic_min_max)
|
| 271 | ++#endif // defined(cl_khr_int64_base_atomics) && |
| 272 | ++ // defined(cl_khr_int64_extended_atomics) |
270 | 273 | +
|
271 | 274 | +#if defined(__opencl_c_ext_fp16_global_atomic_add)
|
272 | 275 | +half __ovld atomic_fetch_add(volatile __global atomic_half *object,
|
@@ -370,6 +373,7 @@ index ab665628c8e1..63a5155fe221 100644
|
370 | 373 | +#endif // defined(__opencl_c_ext_fp32_global_atomic_add) && \
|
371 | 374 | + defined(__opencl_c_ext_fp32_local_atomic_add)
|
372 | 375 | +
|
| 376 | ++#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) |
373 | 377 | +#if defined(__opencl_c_ext_fp64_global_atomic_add)
|
374 | 378 | +double __ovld atomic_fetch_add(volatile __global atomic_double *object,
|
375 | 379 | + double operand);
|
@@ -420,6 +424,8 @@ index ab665628c8e1..63a5155fe221 100644
|
420 | 424 | + memory_scope scope);
|
421 | 425 | +#endif // defined(__opencl_c_ext_fp64_global_atomic_add) && \
|
422 | 426 | + defined(__opencl_c_ext_fp64_local_atomic_add)
|
| 427 | ++#endif // defined(cl_khr_int64_base_atomics) && |
| 428 | ++ // defined(cl_khr_int64_extended_atomics) |
423 | 429 | +
|
424 | 430 | +#endif // cl_ext_float_atomics
|
425 | 431 | +
|
@@ -543,5 +549,5 @@ index 13a3b62481ec..443f682c711a 100644
|
543 | 549 | #endif //(defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200)
|
544 | 550 |
|
545 | 551 | --
|
546 |
| -2.17.1 |
| 552 | +2.29.2 |
547 | 553 |
|
0 commit comments