Kokkos Core Kernels Package  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | List of all members
Kokkos::Experimental::UniqueToken< ExecutionSpace, UniqueTokenScope::Instance > Class Template Reference

Instance scope UniqueToken allows for a max size other than execution_space().concurrency() More...

#include <Kokkos_UniqueToken.hpp>

Inheritance diagram for Kokkos::Experimental::UniqueToken< ExecutionSpace, UniqueTokenScope::Instance >:
Inheritance graph
[legend]

Public Member Functions

 UniqueToken (size_type max_size, execution_space const &=execution_space())
 Create object with specified size. More...
 
KOKKOS_INLINE_FUNCTION size_type size () const
 upper bound for acquired values, i.e. 0 <= value < size() More...
 
KOKKOS_INLINE_FUNCTION size_type acquire () const
 acquire value such that 0 <= value < size() More...
 
KOKKOS_INLINE_FUNCTION void release (size_type) const
 release a value acquired by generate More...
 

Detailed Description

template<typename ExecutionSpace>
class Kokkos::Experimental::UniqueToken< ExecutionSpace, UniqueTokenScope::Instance >

Instance scope UniqueToken allows for a max size other than execution_space().concurrency()

This object should behave like a ref-counted object, so that when the last instance is destroyed, resources are free if needed

Definition at line 70 of file Kokkos_UniqueToken.hpp.

Constructor & Destructor Documentation

template<typename ExecutionSpace >
Kokkos::Experimental::UniqueToken< ExecutionSpace, UniqueTokenScope::Instance >::UniqueToken ( size_type  max_size,
execution_space const &  = execution_space() 
)

Create object with specified size.

It is required that max_size is >= the maximum number of concurrent threads that will attempt to acquire the UniqueToken. This constructor is most commonly useful when you: 1) Have a loop bound that may be smaller than execution_space().concurrency(). 2) Want a per-team unique token in the range [0, execution_space().concurrency() / team_size)

Member Function Documentation

KOKKOS_INLINE_FUNCTION size_type Kokkos::Experimental::UniqueToken< ExecutionSpace, UniqueTokenScope >::size ( ) const
inherited

upper bound for acquired values, i.e. 0 <= value < size()

KOKKOS_INLINE_FUNCTION size_type Kokkos::Experimental::UniqueToken< ExecutionSpace, UniqueTokenScope >::acquire ( ) const
inherited

acquire value such that 0 <= value < size()

KOKKOS_INLINE_FUNCTION void Kokkos::Experimental::UniqueToken< ExecutionSpace, UniqueTokenScope >::release ( size_type  ) const
inherited

release a value acquired by generate


The documentation for this class was generated from the following file: