vecmem 1.14.0
Loading...
Searching...
No Matches
sycl_builtin_device_atomic_ref.hpp
1/*
2 * VecMem project, part of the ACTS project (R&D line)
3 *
4 * (c) 2022-2024 CERN for the benefit of the ACTS project
5 *
6 * Mozilla Public License Version 2.0
7 */
8#pragma once
9
10// Local include(s).
11#include "vecmem/memory/device_address_space.hpp"
12
13// SYCL include(s).
14#include <sycl/sycl.hpp>
15
16namespace vecmem {
17namespace sycl {
18namespace details {
19
24template <device_address_space address>
26
28template <>
30 static constexpr ::sycl::memory_order ord = ::sycl::memory_order::relaxed;
31 static constexpr ::sycl::memory_scope scp = ::sycl::memory_scope::device;
32 static constexpr ::sycl::access::address_space add =
33 ::sycl::access::address_space::global_space;
34};
35
37template <>
39 static constexpr ::sycl::memory_order ord = ::sycl::memory_order::relaxed;
40 static constexpr ::sycl::memory_scope scp =
41 ::sycl::memory_scope::work_group;
42 static constexpr ::sycl::access::address_space add =
43 ::sycl::access::address_space::local_space;
44};
45
46} // namespace details
47
49template <typename T,
50 device_address_space address = device_address_space::global>
52 ::sycl::atomic_ref<T, details::builtin_address_space<address>::ord,
55
56} // namespace sycl
57} // namespace vecmem
::sycl::atomic_ref< T, details::builtin_address_space< address >::ord, details::builtin_address_space< address >::scp, details::builtin_address_space< address >::add > builtin_device_atomic_ref
Atomic reference based on ::sycl::atomic_ref.
Definition sycl_builtin_device_atomic_ref.hpp:54
Main namespace for the vecmem classes/functions.
Definition atomic_ref.hpp:16
device_address_space
Custom definition for the device memory adress space.
Definition device_address_space.hpp:12
std::vector< T, vecmem::polymorphic_allocator< T > > vector
Alias type for vectors with our polymorphic allocator.
Definition vector.hpp:35
Helper trait for setting up an atomic reference on global or local memory.
Definition sycl_builtin_device_atomic_ref.hpp:25