Low-Level Abstraction of Memory Access
llama::Tuple< TFirstElement, RestElements... > Struct Template Reference

Tuple class like std::tuple but suitable for use with offloading devices like GPUs. More...

#include <Tuple.hpp>

+ Inheritance diagram for llama::Tuple< TFirstElement, RestElements... >:
+ Collaboration diagram for llama::Tuple< TFirstElement, RestElements... >:

Public Types

using FirstElement = TFirstElement
 
using RestTuple = Tuple< RestElements... >
 

Public Member Functions

constexpr Tuple ()=default
 
constexpr Tuple (FirstElement first, RestElements... rest)
 Construct a tuple from values of the same types as the tuple stores. More...
 
template<typename T , typename... Ts, std::enable_if_t< sizeof...(RestElements)==sizeof...(Ts) &&std::is_constructible_v< FirstElement, T > &&(std::is_constructible_v< RestElements, Ts > &&...), int > = 0>
constexpr Tuple (T &&firstArg, Ts &&... restArgs)
 Construct a tuple from forwarded values of potentially different types as the tuple stores. More...
 
constexpr auto first () -> decltype(auto)
 Returns the first element of the tuple. More...
 
constexpr auto first () const -> decltype(auto)
 Returns the first element of the tuple. More...
 
constexpr auto rest () -> RestTuple &
 Returns a tuple of all but the first element. More...
 
constexpr auto rest () const -> const RestTuple &
 Returns a tuple of all but the first element. More...
 
- Public Member Functions inherited from llama::internal::TupleLeaf< 1+sizeof...(RestElements), TFirstElement >
constexpr auto value () -> TFirstElement &
 
constexpr auto value () const -> const TFirstElement &
 

Additional Inherited Members

- Public Attributes inherited from llama::internal::TupleLeaf< 1+sizeof...(RestElements), TFirstElement >
TFirstElement val
 

Detailed Description

template<typename TFirstElement, typename... RestElements>
struct llama::Tuple< TFirstElement, RestElements... >

Tuple class like std::tuple but suitable for use with offloading devices like GPUs.

Definition at line 54 of file Tuple.hpp.

Member Typedef Documentation

◆ FirstElement

template<typename TFirstElement , typename... RestElements>
using llama::Tuple< TFirstElement, RestElements... >::FirstElement = TFirstElement

Definition at line 62 of file Tuple.hpp.

◆ RestTuple

template<typename TFirstElement , typename... RestElements>
using llama::Tuple< TFirstElement, RestElements... >::RestTuple = Tuple<RestElements...>

Definition at line 63 of file Tuple.hpp.

Constructor & Destructor Documentation

◆ Tuple() [1/3]

template<typename TFirstElement , typename... RestElements>
constexpr llama::Tuple< TFirstElement, RestElements... >::Tuple ( )
constexprdefault

◆ Tuple() [2/3]

template<typename TFirstElement , typename... RestElements>
constexpr llama::Tuple< TFirstElement, RestElements... >::Tuple ( FirstElement  first,
RestElements...  rest 
)
inlineexplicitconstexpr

Construct a tuple from values of the same types as the tuple stores.

Definition at line 68 of file Tuple.hpp.

◆ Tuple() [3/3]

template<typename TFirstElement , typename... RestElements>
template<typename T , typename... Ts, std::enable_if_t< sizeof...(RestElements)==sizeof...(Ts) &&std::is_constructible_v< FirstElement, T > &&(std::is_constructible_v< RestElements, Ts > &&...), int > = 0>
constexpr llama::Tuple< TFirstElement, RestElements... >::Tuple ( T &&  firstArg,
Ts &&...  restArgs 
)
inlineexplicitconstexpr

Construct a tuple from forwarded values of potentially different types as the tuple stores.

Definition at line 84 of file Tuple.hpp.

Member Function Documentation

◆ first() [1/2]

template<typename TFirstElement , typename... RestElements>
constexpr auto llama::Tuple< TFirstElement, RestElements... >::first ( ) -> decltype(auto)
inlineconstexpr

Returns the first element of the tuple.

Definition at line 91 of file Tuple.hpp.

◆ first() [2/2]

template<typename TFirstElement , typename... RestElements>
constexpr auto llama::Tuple< TFirstElement, RestElements... >::first ( ) const -> decltype(auto)
inlineconstexpr

Returns the first element of the tuple.

Definition at line 97 of file Tuple.hpp.

◆ rest() [1/2]

template<typename TFirstElement , typename... RestElements>
constexpr auto llama::Tuple< TFirstElement, RestElements... >::rest ( ) -> RestTuple&
inlineconstexpr

Returns a tuple of all but the first element.

Definition at line 103 of file Tuple.hpp.

◆ rest() [2/2]

template<typename TFirstElement , typename... RestElements>
constexpr auto llama::Tuple< TFirstElement, RestElements... >::rest ( ) const -> const RestTuple&
inlineconstexpr

Returns a tuple of all but the first element.

Definition at line 109 of file Tuple.hpp.


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