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

#include <array.h>

Inheritance diagram for bc::tensors::exprs::Array< Shape, Scalar, AllocatorType, Tags >:
Inheritance graph
[legend]
Collaboration diagram for bc::tensors::exprs::Array< Shape, Scalar, AllocatorType, Tags >:
Collaboration graph
[legend]

Public Types

using system_tag = typename bc::allocator_traits< AllocatorType >::system_tag
 
using value_type = Scalar
 
using allocator_type = AllocatorType
 
using stream_type = Stream< system_tag >
 
using shape_type = Shape
 
- Public Types inherited from bc::tensors::exprs::Kernel_Array< Shape, Scalar, bc::allocator_traits< AllocatorType >::system_tag, Tags... >
using value_type = Scalar
 
using system_tag = bc::allocator_traits< AllocatorType >::system_tag
 
using shape_type = Shape
 
- Public Types inherited from bc::tensors::exprs::Kernel_Array_Base< Kernel_Array< Shape, Scalar, bc::allocator_traits< AllocatorType >::system_tag, 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

const stream_typeget_stream () const
 
stream_typeget_stream ()
 
allocator_type get_allocator () const
 
 Array ()
 
 Array (const Array &array)
 
 Array (Array &&array)
 
 Array (bc::Dim< shape_type::tensor_dim > shape)
 
 Array (bc::Dim< shape_type::tensor_dim > shape, allocator_type allocator)
 
 Array (shape_type shape)
 
template<class... ShapeDims, class = std::enable_if_t< traits::sequence_of_v<bc::size_t, ShapeDims...> && sizeof...(ShapeDims) == Shape::tensor_dim>>
 Array (const ShapeDims &... shape_dims)
 
template<class Expression , class = std::enable_if_t< expression_traits<Expression>::is_array::value || expression_traits<Expression>::is_expr::value>>
 Array (const Expression &expression, allocator_type allocator=allocator_type())
 
template<class AltShape , class... SliceTags>
 Array (const Array_Slice< AltShape, value_type, allocator_type, SliceTags... > &expression)
 
Arrayoperator= (Array &&array)
 
- Public Member Functions inherited from bc::tensors::exprs::Kernel_Array< Shape, Scalar, bc::allocator_traits< AllocatorType >::system_tag, Tags... >
BCINLINE Kernel_Array ()
 
BCINLINE Kernel_Array (shape_type shape, value_type *ptr)
 
 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)
 
BCINLINE const return_type & operator() (Integers ... ints) const
 
BCINLINE return_type & operator() (Integers ... ints)
 
BCHOT void deallocate (Allocator allocator)
 
void deallocate () const
 
BCHOT void reset (Allocator allocator)
 
- Public Member Functions inherited from bc::tensors::exprs::Kernel_Array_Base< Kernel_Array< Shape, Scalar, bc::allocator_traits< AllocatorType >::system_tag, Tags... > >
BCINLINE Kernel_Array_Base ()
 
- Public Member Functions inherited from bc::tensors::exprs::Expression_Template_Base< Kernel_Array< Shape, Scalar, bc::allocator_traits< AllocatorType >::system_tag, Tags... > >
BCINLINE const Kernel_Array< Shape, Scalar, bc::allocator_traits< AllocatorType >::system_tag, Tags... > & expression_template () const
 
BCINLINE Kernel_Array< Shape, Scalar, bc::allocator_traits< AllocatorType >::system_tag, 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
 

Protected Member Functions

void deallocate ()
 

Additional Inherited Members

- Static Public Attributes inherited from bc::tensors::exprs::Kernel_Array< Shape, Scalar, bc::allocator_traits< AllocatorType >::system_tag, Tags... >
static constexpr int tensor_dim
 
static constexpr int tensor_iterator_dim
 
- Static Public Attributes inherited from bc::Shape< N >
static constexpr int tensor_dim = N
 
- Protected Attributes inherited from bc::tensors::exprs::Kernel_Array< Shape, Scalar, bc::allocator_traits< AllocatorType >::system_tag, Tags... >
value_typem_data
 

Member Typedef Documentation

◆ allocator_type

template<class Shape, class Scalar, class AllocatorType, class... Tags>
using bc::tensors::exprs::Array< Shape, Scalar, AllocatorType, Tags >::allocator_type = AllocatorType

◆ shape_type

template<class Shape, class Scalar, class AllocatorType, class... Tags>
using bc::tensors::exprs::Array< Shape, Scalar, AllocatorType, Tags >::shape_type = Shape

◆ stream_type

template<class Shape, class Scalar, class AllocatorType, class... Tags>
using bc::tensors::exprs::Array< Shape, Scalar, AllocatorType, Tags >::stream_type = Stream<system_tag>

◆ system_tag

template<class Shape, class Scalar, class AllocatorType, class... Tags>
using bc::tensors::exprs::Array< Shape, Scalar, AllocatorType, Tags >::system_tag = typename bc::allocator_traits<AllocatorType>::system_tag

◆ value_type

template<class Shape, class Scalar, class AllocatorType, class... Tags>
using bc::tensors::exprs::Array< Shape, Scalar, AllocatorType, Tags >::value_type = Scalar

Constructor & Destructor Documentation

◆ Array() [1/9]

template<class Shape, class Scalar, class AllocatorType, class... Tags>
bc::tensors::exprs::Array< Shape, Scalar, AllocatorType, Tags >::Array ( )
inline

◆ Array() [2/9]

template<class Shape, class Scalar, class AllocatorType, class... Tags>
bc::tensors::exprs::Array< Shape, Scalar, AllocatorType, Tags >::Array ( const Array< Shape, Scalar, AllocatorType, Tags > &  array)
inline

◆ Array() [3/9]

template<class Shape, class Scalar, class AllocatorType, class... Tags>
bc::tensors::exprs::Array< Shape, Scalar, AllocatorType, Tags >::Array ( Array< Shape, Scalar, AllocatorType, Tags > &&  array)
inline

◆ Array() [4/9]

template<class Shape, class Scalar, class AllocatorType, class... Tags>
bc::tensors::exprs::Array< Shape, Scalar, AllocatorType, Tags >::Array ( bc::Dim< shape_type::tensor_dim shape)
inline

◆ Array() [5/9]

template<class Shape, class Scalar, class AllocatorType, class... Tags>
bc::tensors::exprs::Array< Shape, Scalar, AllocatorType, Tags >::Array ( bc::Dim< shape_type::tensor_dim shape,
allocator_type  allocator 
)
inline

◆ Array() [6/9]

template<class Shape, class Scalar, class AllocatorType, class... Tags>
bc::tensors::exprs::Array< Shape, Scalar, AllocatorType, Tags >::Array ( shape_type  shape)
inline

◆ Array() [7/9]

template<class Shape, class Scalar, class AllocatorType, class... Tags>
template<class... ShapeDims, class = std::enable_if_t< traits::sequence_of_v<bc::size_t, ShapeDims...> && sizeof...(ShapeDims) == Shape::tensor_dim>>
bc::tensors::exprs::Array< Shape, Scalar, AllocatorType, Tags >::Array ( const ShapeDims &...  shape_dims)
inline

◆ Array() [8/9]

template<class Shape, class Scalar, class AllocatorType, class... Tags>
template<class Expression , class = std::enable_if_t< expression_traits<Expression>::is_array::value || expression_traits<Expression>::is_expr::value>>
bc::tensors::exprs::Array< Shape, Scalar, AllocatorType, Tags >::Array ( const Expression &  expression,
allocator_type  allocator = allocator_type() 
)
inline

◆ Array() [9/9]

template<class Shape, class Scalar, class AllocatorType, class... Tags>
template<class AltShape , class... SliceTags>
bc::tensors::exprs::Array< Shape, Scalar, AllocatorType, Tags >::Array ( const Array_Slice< AltShape, value_type, allocator_type, SliceTags... > &  expression)
inline

Member Function Documentation

◆ deallocate()

template<class Shape, class Scalar, class AllocatorType, class... Tags>
void bc::tensors::exprs::Array< Shape, Scalar, AllocatorType, Tags >::deallocate ( )
inlineprotected

◆ get_allocator()

template<class Shape, class Scalar, class AllocatorType, class... Tags>
allocator_type bc::tensors::exprs::Array< Shape, Scalar, AllocatorType, Tags >::get_allocator ( ) const
inline

◆ get_stream() [1/2]

template<class Shape, class Scalar, class AllocatorType, class... Tags>
const stream_type& bc::tensors::exprs::Array< Shape, Scalar, AllocatorType, Tags >::get_stream ( ) const
inline

◆ get_stream() [2/2]

template<class Shape, class Scalar, class AllocatorType, class... Tags>
stream_type& bc::tensors::exprs::Array< Shape, Scalar, AllocatorType, Tags >::get_stream ( )
inline

◆ operator=()

template<class Shape, class Scalar, class AllocatorType, class... Tags>
Array& bc::tensors::exprs::Array< Shape, Scalar, AllocatorType, Tags >::operator= ( Array< Shape, Scalar, AllocatorType, Tags > &&  array)
inline

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