-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #168 from krasznaa/SYCLAtomicRef-main-20220224
sycl::atomic_ref, main branch (2022.02.24.)
- Loading branch information
Showing
3 changed files
with
80 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** VecMem project, part of the ACTS project (R&D line) | ||
* | ||
* (c) 2022 CERN for the benefit of the ACTS project | ||
* | ||
* Mozilla Public License Version 2.0 | ||
*/ | ||
|
||
// SYCL include(s). | ||
#include <CL/sycl.hpp> | ||
|
||
int main() { | ||
// Try to use sycl::atomic_ref. | ||
int dummy = 0; | ||
sycl::atomic_ref<int, sycl::memory_order::relaxed, | ||
sycl::memory_scope::device, | ||
sycl::access::address_space::global_space> | ||
atomic_dummy(dummy); | ||
atomic_dummy.store(3); | ||
atomic_dummy.fetch_add(1); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters