-
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.
Using sycl::atomic_ref for vecmem::atomic in case it is available.
When sycl::atomic_ref is available, vecmem::atomic is set up simply as a thin layer above that class. Since oneAPI only added support for sycl::atomic_ref relatively recently, the CMake configuration needs to check whether that type is available with the particular SYCL compiler that we use, or not.
- 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