cuda::experimental::stf::thread_hierarchy_spec< can_sync, width, lower_levels… >#
-
template<bool can_sync, size_t width, auto... lower_levels>
class thread_hierarchy_spec<can_sync, width, lower_levels...># A template class for specifying a thread hierarchy.
- Template Parameters:
can_sync – A boolean indicating if synchronization is possible.
width – The width of the thread group at this level (0 to set it dynamically).
lower_levels – Further specifications for lower levels of the thread hierarchy.
Usual constructors
-
thread_hierarchy_spec() = default#
-
thread_hierarchy_spec(const thread_hierarchy_spec&) = default#
-
thread_hierarchy_spec(thread_hierarchy_spec&) = default#
-
thread_hierarchy_spec(thread_hierarchy_spec&&) = default#
Public Types
-
using thread_hierarchy_t = thread_hierarchy<can_sync, width, lower_levels...>#
Public Functions
-
template<typename ...P>
inline explicit thread_hierarchy_spec( - const P&... p
Constructor with variadic parameters (usually no needed; use
parandconbelow instead)Parameters are used for initializing
thisdepending on their types as follows:If type is
thread_hierarchy_spec<lower_levels...>, parameter is used to initialize the inner partIf type is
size_t, parameter is used to initialize the width of the objectIf type is
mem, parameter is used to initialize the memory (bytes) attribute of the objectIf type is
hw_scope, parameter is used to initialize the scope attribute of the object
Parameters can be specified in any order. All are optional. It is illegal to pass the same parameter type more than once.
- Parameters:
P... – Types of parameters
p – Values of parameters
- inline constexpr bool operator==(
- const thread_hierarchy_spec &rhs
-
template<auto... other, std::enable_if_t<!std::is_same_v<thread_hierarchy_spec, thread_hierarchy_spec<other...>>, int> = 0>
inline constexpr bool operator==( - const thread_hierarchy_spec<other...>&
- inline constexpr bool operator!=(
- const thread_hierarchy_spec &rhs
-
template<auto... other, std::enable_if_t<!std::is_same_v<thread_hierarchy_spec, thread_hierarchy_spec<other...>>, int> = 0>
inline constexpr bool operator!=( - const thread_hierarchy_spec<other...>&
-
template<auto... P>
inline void set_inner( - const thread_hierarchy_spec<P...> &inner
Set the inner thread hierarchy.
- Template Parameters:
P – Template arguments of the inner thread_hierarchy_spec object.
- Parameters:
inner – The inner thread_hierarchy_spec object.
-
inline constexpr mem get_mem(size_t level) const#
Get the memory bytes at a specific level.
- Parameters:
level – The level.
- Returns:
The memory bytes.
-
inline constexpr void set_mem(size_t level, mem value)#
Set the memory bytes at a specific level.
- Parameters:
level – The level.
value – The memory bytes.
-
inline constexpr size_t get_width(size_t level) const#
Get the width at a specific level.
- Parameters:
level – The level.
- Returns:
The width.
-
inline void set_width(size_t level, size_t new_width)#
Set the width.
- Parameters:
new_width – The new width.
Public Static Functions
-
static inline constexpr size_t depth()#
Compute the depth of the thread hierarchy.
- Returns:
The depth.
-
static inline constexpr bool synchronizable()#
Check if synchronization is possible.
- Returns:
A boolean indicating if synchronization is possible.
-
static inline constexpr size_t static_width(size_t level)#
Get the statically-specified width at a specific level.
- Parameters:
level – The level
- Returns:
The width (0 if width is dynamic)
Public Static Attributes
-
template<size_t level>
static constexpr bool is_synchronizable# Checks if the given
thread_hierarchy_specis synchronizable at the givenlevel.- Template Parameters:
level – The level in the hierarchy to check for the
syncproperty. Level starts from 0 (top-level).