-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[NFC][libclc] Merge atomic extension built-ins with identical name into a single file #134489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
310f537
0d1a5a6
3c3f065
46d2df7
36964ad
de7d8b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifdef cl_khr_global_int32_base_atomics | ||
| #define __CLC_FUNCTION atom_add | ||
| #define __CLC_ADDRESS_SPACE global | ||
| #include <clc/atomic/atom_decl_int32.inc> | ||
| #endif // cl_khr_global_int32_base_atomics | ||
|
|
||
| #ifdef cl_khr_local_int32_base_atomics | ||
| #define __CLC_FUNCTION atom_add | ||
| #define __CLC_ADDRESS_SPACE local | ||
| #include <clc/atomic/atom_decl_int32.inc> | ||
| #endif // cl_khr_local_int32_base_atomics | ||
|
|
||
| #ifdef cl_khr_int64_base_atomics | ||
| #define __CLC_FUNCTION atom_add | ||
| #include <clc/atomic/atom_decl_int64.inc> | ||
| #endif // cl_khr_int64_base_atomics |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifdef cl_khr_global_int32_extended_atomics | ||
| #define __CLC_FUNCTION atom_and | ||
| #define __CLC_ADDRESS_SPACE global | ||
| #include <clc/atomic/atom_decl_int32.inc> | ||
| #endif // cl_khr_global_int32_extended_atomics | ||
|
|
||
| #ifdef cl_khr_local_int32_extended_atomics | ||
| #define __CLC_FUNCTION atom_and | ||
| #define __CLC_ADDRESS_SPACE local | ||
| #include <clc/atomic/atom_decl_int32.inc> | ||
| #endif // cl_khr_local_int32_extended_atomics | ||
|
|
||
| #ifdef cl_khr_int64_base_atomics | ||
| #define __CLC_FUNCTION atom_and | ||
| #include <clc/atomic/atom_decl_int64.inc> | ||
| #endif // cl_khr_int64_base_atomics | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include <clc/clcfunc.h> | ||
| #include <clc/clctypes.h> | ||
|
|
||
| #ifdef cl_khr_global_int32_base_atomics | ||
| _CLC_OVERLOAD _CLC_DECL int atom_cmpxchg(volatile global int *p, int cmp, | ||
| int val); | ||
| _CLC_OVERLOAD _CLC_DECL unsigned int | ||
| atom_cmpxchg(volatile global unsigned int *p, unsigned int cmp, | ||
| unsigned int val); | ||
| #endif // cl_khr_global_int32_base_atomics | ||
|
|
||
| #ifdef cl_khr_local_int32_base_atomics | ||
| _CLC_OVERLOAD _CLC_DECL int atom_cmpxchg(volatile local int *p, int cmp, | ||
| int val); | ||
| _CLC_OVERLOAD _CLC_DECL unsigned int | ||
| atom_cmpxchg(volatile local unsigned int *p, unsigned int cmp, | ||
| unsigned int val); | ||
| #endif // cl_khr_local_int32_base_atomics | ||
|
|
||
| #ifdef cl_khr_int64_base_atomics | ||
| _CLC_OVERLOAD _CLC_DECL long atom_cmpxchg(volatile global long *p, long cmp, | ||
frasercrmck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| long val); | ||
| _CLC_OVERLOAD _CLC_DECL unsigned long | ||
| atom_cmpxchg(volatile global unsigned long *p, unsigned long cmp, | ||
| unsigned long val); | ||
| _CLC_OVERLOAD _CLC_DECL long atom_cmpxchg(volatile local long *p, long cmp, | ||
| long val); | ||
| _CLC_OVERLOAD _CLC_DECL unsigned long | ||
| atom_cmpxchg(volatile local unsigned long *p, unsigned long cmp, | ||
| unsigned long val); | ||
| #endif // cl_khr_int64_base_atomics | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include <clc/clcfunc.h> | ||
| #include <clc/clctypes.h> | ||
|
|
||
| #ifdef cl_khr_global_int32_base_atomics | ||
| _CLC_OVERLOAD _CLC_DECL int atom_dec(volatile global int *p); | ||
| _CLC_OVERLOAD _CLC_DECL unsigned int atom_dec(volatile global unsigned int *p); | ||
| #endif // cl_khr_global_int32_base_atomics | ||
|
|
||
| #ifdef cl_khr_local_int32_base_atomics | ||
| _CLC_OVERLOAD _CLC_DECL int atom_dec(volatile local int *p); | ||
| _CLC_OVERLOAD _CLC_DECL unsigned int atom_dec(volatile local unsigned int *p); | ||
| #endif // cl_khr_local_int32_base_atomics | ||
|
|
||
| #ifdef cl_khr_int64_base_atomics | ||
| _CLC_OVERLOAD _CLC_DECL long atom_dec(volatile global long *p); | ||
| _CLC_OVERLOAD _CLC_DECL unsigned long | ||
| atom_dec(volatile global unsigned long *p); | ||
| _CLC_OVERLOAD _CLC_DECL long atom_dec(volatile local long *p); | ||
| _CLC_OVERLOAD _CLC_DECL unsigned long atom_dec(volatile local unsigned long *p); | ||
| #endif // cl_khr_int64_base_atomics |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include <clc/clcfunc.h> | ||
| #include <clc/clctypes.h> | ||
|
|
||
| #ifdef cl_khr_global_int32_base_atomics | ||
| _CLC_OVERLOAD _CLC_DECL int atom_inc(volatile global int *p); | ||
| _CLC_OVERLOAD _CLC_DECL unsigned int atom_inc(volatile global unsigned int *p); | ||
| #endif // cl_khr_global_int32_base_atomics | ||
|
|
||
| #ifdef cl_khr_local_int32_base_atomics | ||
| _CLC_OVERLOAD _CLC_DECL int atom_inc(volatile local int *p); | ||
| _CLC_OVERLOAD _CLC_DECL unsigned int atom_inc(volatile local unsigned int *p); | ||
| #endif // cl_khr_local_int32_base_atomics | ||
|
|
||
| #ifdef cl_khr_int64_base_atomics | ||
| _CLC_OVERLOAD _CLC_DECL long atom_inc(volatile global long *p); | ||
| _CLC_OVERLOAD _CLC_DECL unsigned long | ||
| atom_inc(volatile global unsigned long *p); | ||
| _CLC_OVERLOAD _CLC_DECL long atom_inc(volatile local long *p); | ||
| _CLC_OVERLOAD _CLC_DECL unsigned long atom_inc(volatile local unsigned long *p); | ||
| #endif // cl_khr_int64_base_atomics |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifdef cl_khr_global_int32_extended_atomics | ||
| #define __CLC_FUNCTION atom_max | ||
| #define __CLC_ADDRESS_SPACE global | ||
| #include <clc/atomic/atom_decl_int32.inc> | ||
| #endif // cl_khr_global_int32_extended_atomics | ||
|
|
||
| #ifdef cl_khr_local_int32_extended_atomics | ||
| #define __CLC_FUNCTION atom_max | ||
| #define __CLC_ADDRESS_SPACE local | ||
| #include <clc/atomic/atom_decl_int32.inc> | ||
| #endif // cl_khr_local_int32_extended_atomics | ||
|
|
||
| #ifdef cl_khr_int64_base_atomics | ||
|
||
| #define __CLC_FUNCTION atom_max | ||
| #include <clc/atomic/atom_decl_int64.inc> | ||
| #endif // cl_khr_int64_base_atomics | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifdef cl_khr_global_int32_extended_atomics | ||
| #define __CLC_FUNCTION atom_min | ||
| #define __CLC_ADDRESS_SPACE global | ||
| #include <clc/atomic/atom_decl_int32.inc> | ||
| #endif // cl_khr_global_int32_extended_atomics | ||
|
|
||
| #ifdef cl_khr_local_int32_extended_atomics | ||
| #define __CLC_FUNCTION atom_min | ||
| #define __CLC_ADDRESS_SPACE local | ||
| #include <clc/atomic/atom_decl_int32.inc> | ||
| #endif // cl_khr_local_int32_extended_atomics | ||
|
|
||
| #ifdef cl_khr_int64_base_atomics | ||
|
||
| #define __CLC_FUNCTION atom_min | ||
| #include <clc/atomic/atom_decl_int64.inc> | ||
| #endif // cl_khr_int64_base_atomics | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifdef cl_khr_global_int32_extended_atomics | ||
| #define __CLC_FUNCTION atom_or | ||
| #define __CLC_ADDRESS_SPACE global | ||
| #include <clc/atomic/atom_decl_int32.inc> | ||
| #endif // cl_khr_global_int32_extended_atomics | ||
|
|
||
| #ifdef cl_khr_local_int32_extended_atomics | ||
| #define __CLC_FUNCTION atom_or | ||
| #define __CLC_ADDRESS_SPACE local | ||
| #include <clc/atomic/atom_decl_int32.inc> | ||
| #endif // cl_khr_local_int32_extended_atomics | ||
|
|
||
| #ifdef cl_khr_int64_base_atomics | ||
|
||
| #define __CLC_FUNCTION atom_or | ||
| #include <clc/atomic/atom_decl_int64.inc> | ||
| #endif // cl_khr_int64_base_atomics | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifdef cl_khr_global_int32_base_atomics | ||
| #define __CLC_FUNCTION atom_sub | ||
| #define __CLC_ADDRESS_SPACE global | ||
| #include <clc/atomic/atom_decl_int32.inc> | ||
| #endif // cl_khr_global_int32_base_atomics | ||
|
|
||
| #ifdef cl_khr_local_int32_base_atomics | ||
| #define __CLC_FUNCTION atom_sub | ||
| #define __CLC_ADDRESS_SPACE local | ||
| #include <clc/atomic/atom_decl_int32.inc> | ||
| #endif // cl_khr_local_int32_base_atomics | ||
|
|
||
| #ifdef cl_khr_int64_base_atomics | ||
| #define __CLC_FUNCTION atom_sub | ||
| #include <clc/atomic/atom_decl_int64.inc> | ||
| #endif // cl_khr_int64_base_atomics |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifdef cl_khr_global_int32_base_atomics | ||
| #define __CLC_FUNCTION atom_xchg | ||
| #define __CLC_ADDRESS_SPACE global | ||
| #include <clc/atomic/atom_decl_int32.inc> | ||
| #endif // cl_khr_global_int32_base_atomics | ||
|
|
||
| #ifdef cl_khr_local_int32_base_atomics | ||
| #define __CLC_FUNCTION atom_xchg | ||
| #define __CLC_ADDRESS_SPACE local | ||
| #include <clc/atomic/atom_decl_int32.inc> | ||
| #endif // cl_khr_local_int32_base_atomics | ||
|
|
||
| #ifdef cl_khr_int64_base_atomics | ||
| #define __CLC_FUNCTION atom_xchg | ||
| #include <clc/atomic/atom_decl_int64.inc> | ||
| #endif // cl_khr_int64_base_atomics |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifdef cl_khr_global_int32_extended_atomics | ||
| #define __CLC_FUNCTION atom_xor | ||
| #define __CLC_ADDRESS_SPACE global | ||
| #include <clc/atomic/atom_decl_int32.inc> | ||
| #endif // cl_khr_global_int32_extended_atomics | ||
|
|
||
| #ifdef cl_khr_local_int32_extended_atomics | ||
| #define __CLC_FUNCTION atom_xor | ||
| #define __CLC_ADDRESS_SPACE local | ||
| #include <clc/atomic/atom_decl_int32.inc> | ||
| #endif // cl_khr_local_int32_extended_atomics | ||
|
|
||
| #ifdef cl_khr_int64_base_atomics | ||
|
||
| #define __CLC_FUNCTION atom_xor | ||
| #include <clc/atomic/atom_decl_int64.inc> | ||
| #endif // cl_khr_int64_base_atomics | ||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be
cl_khr_int64_extended_atomics.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good eye. done in de7d8b9, thanks. I didn't notice this.