-
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 1 commit
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,36 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // 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> | ||
|
|
||
| // 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); | ||
|
|
||
| // 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); | ||
|
|
||
| // 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); | ||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
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.
Sorry to go back to this but I think really these should all be
#ifguarded with the appropriate extension:cl_khr_(local|global)_int32_(base|extended)_atomics. It works now because only targets that should build the atomics builtins are including these headers, which isn't the worst thing but it might be good to fix this up since we're here.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.
done, you're right that they should be all guarded since they are extensions. Thanks.