array< T_, N_ > Struct Template Reference

array&lt; T_, N_ &gt; Struct Template Reference#

Composable Kernel: ck_tile::array< T_, N_ > Struct Template Reference

A fixed-size array container similar to std::array with additional utilities. More...

#include <array.hpp>

Public Types

using value_type = T_

Public Member Functions

CK_TILE_HOST_DEVICE constexpr array ()
CK_TILE_HOST_DEVICE constexpr array (std::initializer_list< value_type > ilist)
template<typename Y, typename = std::enable_if_t<std::is_convertible_v<Y, value_type> || std::is_constructible_v<Y, value_type>>>
CK_TILE_HOST_DEVICE constexpr array (Y c)
CK_TILE_HOST_DEVICE constexpr auto & get ()
CK_TILE_HOST_DEVICE constexpr const auto & get () const
CK_TILE_HOST_DEVICE constexpr auto & get (index_t i)
CK_TILE_HOST_DEVICE constexpr const auto & get (index_t i) const
template<index_t I>
CK_TILE_HOST_DEVICE constexpr auto & get ()
template<index_t I>
CK_TILE_HOST_DEVICE constexpr const auto & get () const
template<index_t I>
CK_TILE_HOST_DEVICE constexpr auto & get (number< I >)
template<index_t I>
CK_TILE_HOST_DEVICE constexpr const auto & get (number< I >) const
CK_TILE_HOST_DEVICE constexpr auto & at (index_t i)
CK_TILE_HOST_DEVICE constexpr const auto & at (index_t i) const
template<index_t I>
CK_TILE_HOST_DEVICE constexpr auto & at ()
template<index_t I>
CK_TILE_HOST_DEVICE constexpr const auto & at () const
template<index_t I>
CK_TILE_HOST_DEVICE constexpr auto & at (number< I >)
template<index_t I>
CK_TILE_HOST_DEVICE constexpr const auto & at (number< I >) const
CK_TILE_HOST_DEVICE constexpr const value_typeoperator[] (index_t i) const
CK_TILE_HOST_DEVICE constexpr value_typeoperator[] (index_t i)
CK_TILE_HOST_DEVICE constexpr value_typeoperator() (index_t i)
template<typename Tx>
CK_TILE_HOST_DEVICE constexpr auto & get_as ()
template<typename Tx>
CK_TILE_HOST_DEVICE constexpr const auto & get_as () const
template<typename Tx>
CK_TILE_HOST_DEVICE constexpr auto & get_as (index_t i)
template<typename Tx>
CK_TILE_HOST_DEVICE constexpr const auto & get_as (index_t i) const
template<typename Tx, index_t I>
CK_TILE_HOST_DEVICE constexpr auto & get_as (number< I >)
template<typename Tx, index_t I>
CK_TILE_HOST_DEVICE constexpr const auto & get_as (number< I >) const
template<typename Tx>
CK_TILE_HOST_DEVICE constexpr void set_as (index_t i, const Tx &x)
template<typename Tx, index_t I>
CK_TILE_HOST_DEVICE constexpr void set_as (number< I >, const Tx &x)

Static Public Member Functions

static CK_TILE_HOST_DEVICE constexpr auto size ()
static CK_TILE_HOST_DEVICE constexpr bool is_static ()

Public Attributes

value_type data [N]

Static Public Attributes

static constexpr index_t N = N_

Detailed Description

template<typename T_, index_t N_>
struct ck_tile::array< T_, N_ >

A fixed-size array container similar to std::array with additional utilities.

This template class provides a lightweight fixed-size array with value semantics, supporting both host and device functionality for GPU programming. It includes specialized initialization methods and type punning capabilities.

Template Parameters
T_The type of elements in the array
N_The fixed number of elements in the array
Note
This implementation provides additional features beyond std::array:
  • GPU compatibility via CK_TILE_HOST_DEVICE macros
  • Type punning via get_as() and set_as() methods
  • Various specialized access methods
  • Specialized initialization behaviors

The initializer_list constructor fills remaining elements with the last value provided if the list size is smaller than N, which is different than std::array.

Member Typedef Documentation

◆ value_type

template<typename T_, index_t N_>
using ck_tile::array< T_, N_ >::value_type = T_

Constructor & Destructor Documentation

◆ array() [1/3]

template<typename T_, index_t N_>
CK_TILE_HOST_DEVICE constexpr ck_tile::array< T_, N_ >::array ( )
inlineconstexpr

◆ array() [2/3]

template<typename T_, index_t N_>
CK_TILE_HOST_DEVICE constexpr ck_tile::array< T_, N_ >::array ( std::initializer_list< value_type > ilist)
inlineconstexpr

◆ array() [3/3]

template<typename T_, index_t N_>
template<typename Y, typename = std::enable_if_t<std::is_convertible_v<Y, value_type> || std::is_constructible_v<Y, value_type>>>
CK_TILE_HOST_DEVICE constexpr ck_tile::array< T_, N_ >::array ( Y c)
inlineexplicitconstexpr

Member Function Documentation

◆ at() [1/6]

template<typename T_, index_t N_>
template<index_t I>
CK_TILE_HOST_DEVICE constexpr auto & ck_tile::array< T_, N_ >::at ( )
inlineconstexpr

◆ at() [2/6]

template<typename T_, index_t N_>
template<index_t I>
CK_TILE_HOST_DEVICE constexpr const auto & ck_tile::array< T_, N_ >::at ( ) const
inlineconstexpr

◆ at() [3/6]

template<typename T_, index_t N_>
CK_TILE_HOST_DEVICE constexpr auto & ck_tile::array< T_, N_ >::at ( index_t i)
inlineconstexpr

◆ at() [4/6]

template<typename T_, index_t N_>
CK_TILE_HOST_DEVICE constexpr const auto & ck_tile::array< T_, N_ >::at ( index_t i) const
inlineconstexpr

◆ at() [5/6]

template<typename T_, index_t N_>
template<index_t I>
CK_TILE_HOST_DEVICE constexpr auto & ck_tile::array< T_, N_ >::at ( number< I > )
inlineconstexpr

◆ at() [6/6]

template<typename T_, index_t N_>
template<index_t I>
CK_TILE_HOST_DEVICE constexpr const auto & ck_tile::array< T_, N_ >::at ( number< I > ) const
inlineconstexpr

◆ get() [1/8]

template<typename T_, index_t N_>
template<index_t I>
CK_TILE_HOST_DEVICE constexpr auto & ck_tile::array< T_, N_ >::get ( )
inlineconstexpr

◆ get() [2/8]

template<typename T_, index_t N_>
CK_TILE_HOST_DEVICE constexpr auto & ck_tile::array< T_, N_ >::get ( )
inlineconstexpr

◆ get() [3/8]

template<typename T_, index_t N_>
template<index_t I>
CK_TILE_HOST_DEVICE constexpr const auto & ck_tile::array< T_, N_ >::get ( ) const
inlineconstexpr

◆ get() [4/8]

template<typename T_, index_t N_>
CK_TILE_HOST_DEVICE constexpr const auto & ck_tile::array< T_, N_ >::get ( ) const
inlineconstexpr

◆ get() [5/8]

template<typename T_, index_t N_>
CK_TILE_HOST_DEVICE constexpr auto & ck_tile::array< T_, N_ >::get ( index_t i)
inlineconstexpr

◆ get() [6/8]

template<typename T_, index_t N_>
CK_TILE_HOST_DEVICE constexpr const auto & ck_tile::array< T_, N_ >::get ( index_t i) const
inlineconstexpr

◆ get() [7/8]

template<typename T_, index_t N_>
template<index_t I>
CK_TILE_HOST_DEVICE constexpr auto & ck_tile::array< T_, N_ >::get ( number< I > )
inlineconstexpr

◆ get() [8/8]

template<typename T_, index_t N_>
template<index_t I>
CK_TILE_HOST_DEVICE constexpr const auto & ck_tile::array< T_, N_ >::get ( number< I > ) const
inlineconstexpr

◆ get_as() [1/6]

template<typename T_, index_t N_>
template<typename Tx>
CK_TILE_HOST_DEVICE constexpr auto & ck_tile::array< T_, N_ >::get_as ( )
inlineconstexpr

◆ get_as() [2/6]

template<typename T_, index_t N_>
template<typename Tx>
CK_TILE_HOST_DEVICE constexpr const auto & ck_tile::array< T_, N_ >::get_as ( ) const
inlineconstexpr

◆ get_as() [3/6]

template<typename T_, index_t N_>
template<typename Tx>
CK_TILE_HOST_DEVICE constexpr auto & ck_tile::array< T_, N_ >::get_as ( index_t i)
inlineconstexpr

◆ get_as() [4/6]

template<typename T_, index_t N_>
template<typename Tx>
CK_TILE_HOST_DEVICE constexpr const auto & ck_tile::array< T_, N_ >::get_as ( index_t i) const
inlineconstexpr

◆ get_as() [5/6]

template<typename T_, index_t N_>
template<typename Tx, index_t I>
CK_TILE_HOST_DEVICE constexpr auto & ck_tile::array< T_, N_ >::get_as ( number< I > )
inlineconstexpr

◆ get_as() [6/6]

template<typename T_, index_t N_>
template<typename Tx, index_t I>
CK_TILE_HOST_DEVICE constexpr const auto & ck_tile::array< T_, N_ >::get_as ( number< I > ) const
inlineconstexpr

◆ is_static()

template<typename T_, index_t N_>
CK_TILE_HOST_DEVICE constexpr bool ck_tile::array< T_, N_ >::is_static ( )
inlinestaticconstexpr

◆ operator()()

template<typename T_, index_t N_>
CK_TILE_HOST_DEVICE constexpr value_type & ck_tile::array< T_, N_ >::operator() ( index_t i)
inlineconstexpr

◆ operator[]() [1/2]

template<typename T_, index_t N_>
CK_TILE_HOST_DEVICE constexpr value_type & ck_tile::array< T_, N_ >::operator[] ( index_t i)
inlineconstexpr

◆ operator[]() [2/2]

template<typename T_, index_t N_>
CK_TILE_HOST_DEVICE constexpr const value_type & ck_tile::array< T_, N_ >::operator[] ( index_t i) const
inlineconstexpr

◆ set_as() [1/2]

template<typename T_, index_t N_>
template<typename Tx>
CK_TILE_HOST_DEVICE constexpr void ck_tile::array< T_, N_ >::set_as ( index_t i,
const Tx & x )
inlineconstexpr

◆ set_as() [2/2]

template<typename T_, index_t N_>
template<typename Tx, index_t I>
CK_TILE_HOST_DEVICE constexpr void ck_tile::array< T_, N_ >::set_as ( number< I > ,
const Tx & x )
inlineconstexpr

◆ size()

template<typename T_, index_t N_>
CK_TILE_HOST_DEVICE constexpr auto ck_tile::array< T_, N_ >::size ( )
inlinestaticconstexpr

Member Data Documentation

◆ data

template<typename T_, index_t N_>
value_type ck_tile::array< T_, N_ >::data[N]

◆ N

template<typename T_, index_t N_>
index_t ck_tile::array< T_, N_ >::N = N_
staticconstexpr

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