BlackCat_Tensors
A GPU-supported autograd and linear algebra library, designed for neural network construction
Public Types | Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
bc::tensors::exprs::Kernel_Array< Shape, ValueType, SystemTag, Tags > Struct Template Reference

#include <array_kernel_array.h>

Inheritance diagram for bc::tensors::exprs::Kernel_Array< Shape, ValueType, SystemTag, Tags >:
Inheritance graph
[legend]
Collaboration diagram for bc::tensors::exprs::Kernel_Array< Shape, ValueType, SystemTag, Tags >:
Collaboration graph
[legend]

Public Types

using value_type = ValueType
 
using system_tag = SystemTag
 
using shape_type = Shape
 
- Public Types inherited from bc::tensors::exprs::Kernel_Array_Base< Kernel_Array< Shape, ValueType, SystemTag, Tags... > >
using expression_template_array_type = std::true_type
 
- Public Types inherited from bc::Shape< N >
using size_t = bc::size_t
 
using value_type = size_t
 

Public Member Functions

BCINLINE Kernel_Array ()
 
BCINLINE Kernel_Array (shape_type shape, value_type *ptr)
 
template<class AllocatorType , class = std::enable_if_t< bc::traits::true_v< decltype(std::declval<AllocatorType>().allocate(0))>>>
 Kernel_Array (shape_type shape, AllocatorType allocator)
 
BCINLINE value_typedata () const
 
BCINLINE shape_type get_shape () const
 
BCINLINE const return_type & operator[] (bc::size_t index) const
 
BCINLINE return_type & operator[] (bc::size_t index)
 
template<class ... Integers>
BCINLINE const return_type & operator() (Integers ... ints) const
 
template<class ... Integers>
BCINLINE return_type & operator() (Integers ... ints)
 
template<class Allocator >
BCHOT void deallocate (Allocator allocator)
 
void deallocate () const
 
template<class Allocator >
BCHOT void reset (Allocator allocator)
 
- Public Member Functions inherited from bc::tensors::exprs::Kernel_Array_Base< Kernel_Array< Shape, ValueType, SystemTag, Tags... > >
BCINLINE Kernel_Array_Base ()
 
- Public Member Functions inherited from bc::tensors::exprs::Expression_Template_Base< Kernel_Array< Shape, ValueType, SystemTag, Tags... > >
BCINLINE const Kernel_Array< Shape, ValueType, SystemTag, Tags... > & expression_template () const
 
BCINLINE Kernel_Array< Shape, ValueType, SystemTag, Tags... > & expression_template ()
 
BCINLINE Expression_Template_Base ()
 
void deallocate () const
 
- Public Member Functions inherited from bc::Shape< N >
BCINLINE Shape ()
 
template<class... Integers, class = std::enable_if_t< bc::traits::sequence_of_v<size_t, Integers...> && (sizeof...(Integers) == N)>>
BCINLINE Shape (Integers... ints)
 
template<int X, class = std::enable_if_t<(X > N>
BCINLINE Shape (const Shape< X > &shape)
 
BCINLINE Shape (Dim< N > new_shape, const Shape< N > &parent_shape)
 
BCINLINE Shape (const Shape< N > &new_shape, const Shape< N > &parent_shape)
 
BCINLINE Shape (Dim< N > dims)
 
BCINLINE const auto & inner_shape () const
 
BCINLINE const auto & outer_shape () const
 
BCINLINE size_t operator[] (size_t i) const
 
BCINLINE size_t size () const
 
BCINLINE size_t rows () const
 
BCINLINE size_t cols () const
 
BCINLINE size_t dim (int i) const
 
BCINLINE size_t outer_dim () const
 
BCINLINE size_t leading_dim (int i=N-1) const
 
BCINLINE bool operator== (const Shape &other) const
 
BCINLINE size_t coefficientwise_dims_to_index (size_t index) const
 
template<class... Integers, class = std::enable_if_t< bc::traits::sequence_of_v<size_t, Integers...> && (sizeof...(Integers) >= N>
BCINLINE size_t dims_to_index (Integers... ints) const
 
template<int D, class = std::enable_if_t<(D>=N>
BCINLINE size_t dims_to_index (const Dim< D > &var) const
 

Static Public Attributes

static constexpr int tensor_dim = Shape::tensor_dim
 
static constexpr int tensor_iterator_dim
 
- Static Public Attributes inherited from bc::Shape< N >
static constexpr int tensor_dim = N
 

Protected Attributes

value_typem_data = nullptr
 

Member Typedef Documentation

◆ shape_type

template<class Shape, class ValueType, class SystemTag, class... Tags>
using bc::tensors::exprs::Kernel_Array< Shape, ValueType, SystemTag, Tags >::shape_type = Shape

◆ system_tag

template<class Shape, class ValueType, class SystemTag, class... Tags>
using bc::tensors::exprs::Kernel_Array< Shape, ValueType, SystemTag, Tags >::system_tag = SystemTag

◆ value_type

template<class Shape, class ValueType, class SystemTag, class... Tags>
using bc::tensors::exprs::Kernel_Array< Shape, ValueType, SystemTag, Tags >::value_type = ValueType

Constructor & Destructor Documentation

◆ Kernel_Array() [1/3]

template<class Shape, class ValueType, class SystemTag, class... Tags>
BCINLINE bc::tensors::exprs::Kernel_Array< Shape, ValueType, SystemTag, Tags >::Kernel_Array ( )
inline

◆ Kernel_Array() [2/3]

template<class Shape, class ValueType, class SystemTag, class... Tags>
BCINLINE bc::tensors::exprs::Kernel_Array< Shape, ValueType, SystemTag, Tags >::Kernel_Array ( shape_type  shape,
value_type ptr 
)
inline

◆ Kernel_Array() [3/3]

template<class Shape, class ValueType, class SystemTag, class... Tags>
template<class AllocatorType , class = std::enable_if_t< bc::traits::true_v< decltype(std::declval<AllocatorType>().allocate(0))>>>
bc::tensors::exprs::Kernel_Array< Shape, ValueType, SystemTag, Tags >::Kernel_Array ( shape_type  shape,
AllocatorType  allocator 
)
inline

Member Function Documentation

◆ data()

template<class Shape, class ValueType, class SystemTag, class... Tags>
BCINLINE value_type* bc::tensors::exprs::Kernel_Array< Shape, ValueType, SystemTag, Tags >::data ( ) const
inline

◆ deallocate() [1/2]

template<class Shape, class ValueType, class SystemTag, class... Tags>
template<class Allocator >
BCHOT void bc::tensors::exprs::Kernel_Array< Shape, ValueType, SystemTag, Tags >::deallocate ( Allocator  allocator)
inline

◆ deallocate() [2/2]

template<class Shape, class ValueType, class SystemTag, class... Tags>
void bc::tensors::exprs::Kernel_Array< Shape, ValueType, SystemTag, Tags >::deallocate ( ) const
inline

◆ get_shape()

template<class Shape, class ValueType, class SystemTag, class... Tags>
BCINLINE shape_type bc::tensors::exprs::Kernel_Array< Shape, ValueType, SystemTag, Tags >::get_shape ( ) const
inline

◆ operator()() [1/2]

template<class Shape, class ValueType, class SystemTag, class... Tags>
template<class ... Integers>
BCINLINE const return_type& bc::tensors::exprs::Kernel_Array< Shape, ValueType, SystemTag, Tags >::operator() ( Integers ...  ints) const
inline

◆ operator()() [2/2]

template<class Shape, class ValueType, class SystemTag, class... Tags>
template<class ... Integers>
BCINLINE return_type& bc::tensors::exprs::Kernel_Array< Shape, ValueType, SystemTag, Tags >::operator() ( Integers ...  ints)
inline

◆ operator[]() [1/2]

template<class Shape, class ValueType, class SystemTag, class... Tags>
BCINLINE const return_type& bc::tensors::exprs::Kernel_Array< Shape, ValueType, SystemTag, Tags >::operator[] ( bc::size_t  index) const
inline

◆ operator[]() [2/2]

template<class Shape, class ValueType, class SystemTag, class... Tags>
BCINLINE return_type& bc::tensors::exprs::Kernel_Array< Shape, ValueType, SystemTag, Tags >::operator[] ( bc::size_t  index)
inline

◆ reset()

template<class Shape, class ValueType, class SystemTag, class... Tags>
template<class Allocator >
BCHOT void bc::tensors::exprs::Kernel_Array< Shape, ValueType, SystemTag, Tags >::reset ( Allocator  allocator)
inline

Member Data Documentation

◆ m_data

template<class Shape, class ValueType, class SystemTag, class... Tags>
value_type* bc::tensors::exprs::Kernel_Array< Shape, ValueType, SystemTag, Tags >::m_data = nullptr
protected

◆ tensor_dim

template<class Shape, class ValueType, class SystemTag, class... Tags>
constexpr int bc::tensors::exprs::Kernel_Array< Shape, ValueType, SystemTag, Tags >::tensor_dim = Shape::tensor_dim
static

◆ tensor_iterator_dim

template<class Shape, class ValueType, class SystemTag, class... Tags>
constexpr int bc::tensors::exprs::Kernel_Array< Shape, ValueType, SystemTag, Tags >::tensor_iterator_dim
static
Initial value:
=
bc::traits::sequence_contains_v<noncontinuous_memory_tag, Tags...> ?

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