alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
AtomicNoOp.hpp
Go to the documentation of this file.
1/* Copyright 2022 Axel Huebl, Benjamin Worpitz, Matthias Werner, René Widera, Jan Stephan, Bernhard Manfred Gruber
2 * SPDX-License-Identifier: MPL-2.0
3 */
4
5#pragma once
6
8
9namespace alpaka
10{
11 //! The NoOp atomic ops.
13 {
14 };
15
16 namespace trait
17 {
18 //! The NoOp atomic operation.
19 template<typename TOp, typename T, typename THierarchy>
20 struct AtomicOp<TOp, AtomicNoOp, T, THierarchy>
21 {
22 ALPAKA_FN_HOST static auto atomicOp(AtomicNoOp const& /* atomic */, T* const addr, T const& value) -> T
23 {
24 return TOp()(addr, value);
25 }
26
27 ALPAKA_FN_HOST static auto atomicOp(
28 AtomicNoOp const& /* atomic */,
29 T* const addr,
30 T const& compare,
31 T const& value) -> T
32 {
33 return TOp()(addr, compare, value);
34 }
35 };
36 } // namespace trait
37} // namespace alpaka
The NoOp atomic ops.
#define ALPAKA_FN_HOST
Definition Common.hpp:40
The alpaka accelerator library.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto atomicOp(TAtomic const &atomic, T *const addr, T const &value, THierarchy const &=THierarchy()) -> T
Executes the given operation atomically.
Definition Traits.hpp:73