HostTensorDescriptor Struct Reference

HostTensorDescriptor Struct Reference#

Composable Kernel: HostTensorDescriptor Struct Reference
HostTensorDescriptor Struct Reference

#include <host_tensor.hpp>

Public Member Functions

 HostTensorDescriptor ()=default
 
void CalculateStrides ()
 
template<typename X , typename = std::enable_if_t<std::is_convertible_v<X, std::size_t>>>
 HostTensorDescriptor (const std::initializer_list< X > &lens)
 
 HostTensorDescriptor (const std::initializer_list< ck::long_index_t > &lens)
 
template<typename Lengths , typename = std::enable_if_t< std::is_convertible_v<ck::ranges::range_value_t<Lengths>, std::size_t> || std::is_convertible_v<ck::ranges::range_value_t<Lengths>, ck::long_index_t>>>
 HostTensorDescriptor (const Lengths &lens)
 
template<typename X , typename Y , typename = std::enable_if_t<std::is_convertible_v<X, std::size_t> && std::is_convertible_v<Y, std::size_t>>>
 HostTensorDescriptor (const std::initializer_list< X > &lens, const std::initializer_list< Y > &strides)
 
 HostTensorDescriptor (const std::initializer_list< ck::long_index_t > &lens, const std::initializer_list< ck::long_index_t > &strides)
 
template<typename Lengths , typename Strides , typename = std::enable_if_t< (std::is_convertible_v<ck::ranges::range_value_t<Lengths>, std::size_t> && std::is_convertible_v<ck::ranges::range_value_t<Strides>, std::size_t>) || (std::is_convertible_v<ck::ranges::range_value_t<Lengths>, ck::long_index_t> && std::is_convertible_v<ck::ranges::range_value_t<Strides>, ck::long_index_t>)>>
 HostTensorDescriptor (const Lengths &lens, const Strides &strides)
 
std::size_t GetNumOfDimension () const
 
std::size_t GetElementSize () const
 
std::size_t GetElementSpaceSize () const
 
const std::vector< std::size_t > & GetLengths () const
 
const std::vector< std::size_t > & GetStrides () const
 
template<typename... Is>
std::size_t GetOffsetFromMultiIndex (Is... is) const
 
std::size_t GetOffsetFromMultiIndex (std::vector< std::size_t > iss) const
 

Friends

std::ostream & operator<< (std::ostream &os, const HostTensorDescriptor &desc)
 

Constructor & Destructor Documentation

◆ HostTensorDescriptor() [1/7]

HostTensorDescriptor::HostTensorDescriptor ( )
default

◆ HostTensorDescriptor() [2/7]

template<typename X , typename = std::enable_if_t<std::is_convertible_v<X, std::size_t>>>
HostTensorDescriptor::HostTensorDescriptor ( const std::initializer_list< X > &  lens)
inline

◆ HostTensorDescriptor() [3/7]

HostTensorDescriptor::HostTensorDescriptor ( const std::initializer_list< ck::long_index_t > &  lens)
inline

◆ HostTensorDescriptor() [4/7]

template<typename Lengths , typename = std::enable_if_t< std::is_convertible_v<ck::ranges::range_value_t<Lengths>, std::size_t> || std::is_convertible_v<ck::ranges::range_value_t<Lengths>, ck::long_index_t>>>
HostTensorDescriptor::HostTensorDescriptor ( const Lengths &  lens)
inline

◆ HostTensorDescriptor() [5/7]

template<typename X , typename Y , typename = std::enable_if_t<std::is_convertible_v<X, std::size_t> && std::is_convertible_v<Y, std::size_t>>>
HostTensorDescriptor::HostTensorDescriptor ( const std::initializer_list< X > &  lens,
const std::initializer_list< Y > &  strides 
)
inline

◆ HostTensorDescriptor() [6/7]

HostTensorDescriptor::HostTensorDescriptor ( const std::initializer_list< ck::long_index_t > &  lens,
const std::initializer_list< ck::long_index_t > &  strides 
)
inline

◆ HostTensorDescriptor() [7/7]

template<typename Lengths , typename Strides , typename = std::enable_if_t< (std::is_convertible_v<ck::ranges::range_value_t<Lengths>, std::size_t> && std::is_convertible_v<ck::ranges::range_value_t<Strides>, std::size_t>) || (std::is_convertible_v<ck::ranges::range_value_t<Lengths>, ck::long_index_t> && std::is_convertible_v<ck::ranges::range_value_t<Strides>, ck::long_index_t>)>>
HostTensorDescriptor::HostTensorDescriptor ( const Lengths &  lens,
const Strides &  strides 
)
inline

Member Function Documentation

◆ CalculateStrides()

void HostTensorDescriptor::CalculateStrides ( )

◆ GetElementSize()

std::size_t HostTensorDescriptor::GetElementSize ( ) const

◆ GetElementSpaceSize()

std::size_t HostTensorDescriptor::GetElementSpaceSize ( ) const

◆ GetLengths()

const std::vector<std::size_t>& HostTensorDescriptor::GetLengths ( ) const

◆ GetNumOfDimension()

std::size_t HostTensorDescriptor::GetNumOfDimension ( ) const

◆ GetOffsetFromMultiIndex() [1/2]

template<typename... Is>
std::size_t HostTensorDescriptor::GetOffsetFromMultiIndex ( Is...  is) const
inline

◆ GetOffsetFromMultiIndex() [2/2]

std::size_t HostTensorDescriptor::GetOffsetFromMultiIndex ( std::vector< std::size_t >  iss) const
inline

◆ GetStrides()

const std::vector<std::size_t>& HostTensorDescriptor::GetStrides ( ) const

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const HostTensorDescriptor desc 
)
friend

The documentation for this struct was generated from the following file:
  • /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-composable-kernel/checkouts/docs-6.4.3/include/ck/library/utility/host_tensor.hpp