44 #ifndef KOKKOS_UNIQUE_TOKEN_HPP
45 #define KOKKOS_UNIQUE_TOKEN_HPP
47 #include <Kokkos_Macros.hpp>
49 namespace Kokkos {
namespace Experimental {
51 enum class UniqueTokenScope : int
61 template <
typename ExecutionSpace, UniqueTokenScope = UniqueTokenScope::Instance >
65 using execution_space = ExecutionSpace;
66 using size_type =
typename execution_space::size_type;
71 UniqueToken( execution_space
const& = execution_space() );
74 KOKKOS_INLINE_FUNCTION
75 size_type
size()
const ;
78 KOKKOS_INLINE_FUNCTION
82 KOKKOS_INLINE_FUNCTION
83 void release( size_type )
const ;
88 #endif //KOKKOS_UNIQUE_TOKEN_HPP
KOKKOS_INLINE_FUNCTION size_type acquire() const
acquire value such that 0 <= value < size()
class to generate unique ids base on the required amount of concurrency
UniqueToken(execution_space const &=execution_space())
create object size for concurrency on the given instance
KOKKOS_INLINE_FUNCTION void release(size_type) const
release a value acquired by generate
KOKKOS_INLINE_FUNCTION size_type size() const
upper bound for acquired values, i.e. 0 <= value < size()