vecmem 1.30.0
Loading...
Searching...
No Matches
hip_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// HIP include(s).
11#include <hip/hip_runtime.h>
12
13// Set up the thread fence macros correctly for the
14// vecmem::hip::device_atomic_ref code.
15#ifdef __HIP_DEVICE_COMPILE__
16#define __VECMEM_THREADFENCE_GLOBAL() __threadfence()
17#define __VECMEM_THREADFENCE_LOCAL() __threadfence_block()
18#else
19#define __VECMEM_THREADFENCE_GLOBAL()
20#define __VECMEM_THREADFENCE_LOCAL()
21#endif // defined(__HIP_DEVICE_COMPILE__)
22
23// Local include(s).
24#include "vecmem/memory/details/cuda_device_atomic_ref.hpp"
25
26namespace vecmem {
27namespace hip {
28
30template <typename T,
31 device_address_space address = device_address_space::global>
33
34} // namespace hip
35} // namespace vecmem
An allocator class that wraps a memory resource.
Definition allocator.hpp:37
Custom implementation for atomic operations in CUDA device code.
Definition cuda_device_atomic_ref.hpp:34
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