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

#include <vector.h>

Public Types

using value_type = ValueType
 
using system_tag = typename bc::allocator_traits< AllocatorType >::system_tag
 
using stream_type = bc::streams::Stream< system_tag >
 
using allocator_type = std::conditional_t< std::is_same< bc::device_tag, system_tag >::value, bc::allocators::allocator_to_thrust_allocator_t< AllocatorType >, AllocatorType >
 
using array_type = std::conditional_t< std::is_same< system_tag, bc::host_tag >::value, thrust::host_vector< value_type, allocator_type >, thrust::device_vector< value_type, allocator_type > >
 
using expression_template_array_type = std::true_type
 

Public Member Functions

 Vector ()=default
 
 Vector (const array_type &vector)
 
 Vector (array_type &&vector)
 
 Vector (bc::Dim< 1 > dim)
 
 Vector (bc::size_t size)
 
auto get_shape () const
 
size_t size () const
 
size_t rows () const
 
size_t cols () const
 
size_t dim (int i) const
 
size_t outer_dim () const
 
size_t leading_dim (int i=0) const
 
auto inner_shape () const
 
const_expression_template_type expression_template () const
 
expression_template_type expression_template ()
 
const stream_typeget_stream () const
 
stream_typeget_stream ()
 
allocator_type get_allocator () const
 
value_typedata () const
 
value_typedata ()
 
void clear ()
 
void reserve (bc::size_t reserve_sz)
 
void resize (bc::size_t new_sz)
 
void push_back (value_type &&value)
 
void push_back (const value_type &value)
 
void emplace_back (value_type &&value)
 
void emplace_back (const value_type &value)
 
void pop_back ()
 
auto & at (bc::size_t index) const
 
auto & at (bc::size_t index)
 
bool empty () const
 
std::size_t max_size () const
 
std::size_t capacity () const
 
void shrink_to_fit ()
 

Static Public Attributes

static constexpr int tensor_dim = 1
 
static constexpr int tensor_iterator_dim = 1
 

Protected Member Functions

void deallocate ()
 

Member Typedef Documentation

◆ allocator_type

template<class ValueType , class AllocatorType >
using bc::tensors::exprs::Vector< ValueType, AllocatorType >::allocator_type = std::conditional_t< std::is_same<bc::device_tag, system_tag>::value, bc::allocators::allocator_to_thrust_allocator_t<AllocatorType>, AllocatorType>

◆ array_type

template<class ValueType , class AllocatorType >
using bc::tensors::exprs::Vector< ValueType, AllocatorType >::array_type = std::conditional_t< std::is_same<system_tag, bc::host_tag>::value, thrust::host_vector<value_type, allocator_type>, thrust::device_vector<value_type, allocator_type> >

◆ expression_template_array_type

template<class ValueType , class AllocatorType >
using bc::tensors::exprs::Vector< ValueType, AllocatorType >::expression_template_array_type = std::true_type

◆ stream_type

template<class ValueType , class AllocatorType >
using bc::tensors::exprs::Vector< ValueType, AllocatorType >::stream_type = bc::streams::Stream<system_tag>

◆ system_tag

template<class ValueType , class AllocatorType >
using bc::tensors::exprs::Vector< ValueType, AllocatorType >::system_tag = typename bc::allocator_traits<AllocatorType>::system_tag

◆ value_type

template<class ValueType , class AllocatorType >
using bc::tensors::exprs::Vector< ValueType, AllocatorType >::value_type = ValueType

Constructor & Destructor Documentation

◆ Vector() [1/5]

template<class ValueType , class AllocatorType >
bc::tensors::exprs::Vector< ValueType, AllocatorType >::Vector ( )
default

◆ Vector() [2/5]

template<class ValueType , class AllocatorType >
bc::tensors::exprs::Vector< ValueType, AllocatorType >::Vector ( const array_type vector)
inline

◆ Vector() [3/5]

template<class ValueType , class AllocatorType >
bc::tensors::exprs::Vector< ValueType, AllocatorType >::Vector ( array_type &&  vector)
inline

◆ Vector() [4/5]

template<class ValueType , class AllocatorType >
bc::tensors::exprs::Vector< ValueType, AllocatorType >::Vector ( bc::Dim< 1 >  dim)
inline

◆ Vector() [5/5]

template<class ValueType , class AllocatorType >
bc::tensors::exprs::Vector< ValueType, AllocatorType >::Vector ( bc::size_t  size)
inline

Member Function Documentation

◆ at() [1/2]

template<class ValueType , class AllocatorType >
auto& bc::tensors::exprs::Vector< ValueType, AllocatorType >::at ( bc::size_t  index) const
inline

◆ at() [2/2]

template<class ValueType , class AllocatorType >
auto& bc::tensors::exprs::Vector< ValueType, AllocatorType >::at ( bc::size_t  index)
inline

◆ capacity()

template<class ValueType , class AllocatorType >
std::size_t bc::tensors::exprs::Vector< ValueType, AllocatorType >::capacity ( ) const
inline

◆ clear()

template<class ValueType , class AllocatorType >
void bc::tensors::exprs::Vector< ValueType, AllocatorType >::clear ( )
inline

◆ cols()

template<class ValueType , class AllocatorType >
size_t bc::tensors::exprs::Vector< ValueType, AllocatorType >::cols ( ) const
inline

◆ data() [1/2]

template<class ValueType , class AllocatorType >
value_type* bc::tensors::exprs::Vector< ValueType, AllocatorType >::data ( ) const
inline

◆ data() [2/2]

template<class ValueType , class AllocatorType >
value_type* bc::tensors::exprs::Vector< ValueType, AllocatorType >::data ( )
inline

◆ deallocate()

template<class ValueType , class AllocatorType >
void bc::tensors::exprs::Vector< ValueType, AllocatorType >::deallocate ( )
inlineprotected

◆ dim()

template<class ValueType , class AllocatorType >
size_t bc::tensors::exprs::Vector< ValueType, AllocatorType >::dim ( int  i) const
inline

◆ emplace_back() [1/2]

template<class ValueType , class AllocatorType >
void bc::tensors::exprs::Vector< ValueType, AllocatorType >::emplace_back ( value_type &&  value)
inline

◆ emplace_back() [2/2]

template<class ValueType , class AllocatorType >
void bc::tensors::exprs::Vector< ValueType, AllocatorType >::emplace_back ( const value_type value)
inline

◆ empty()

template<class ValueType , class AllocatorType >
bool bc::tensors::exprs::Vector< ValueType, AllocatorType >::empty ( ) const
inline

◆ expression_template() [1/2]

template<class ValueType , class AllocatorType >
const_expression_template_type bc::tensors::exprs::Vector< ValueType, AllocatorType >::expression_template ( ) const
inline

◆ expression_template() [2/2]

template<class ValueType , class AllocatorType >
expression_template_type bc::tensors::exprs::Vector< ValueType, AllocatorType >::expression_template ( )
inline

◆ get_allocator()

template<class ValueType , class AllocatorType >
allocator_type bc::tensors::exprs::Vector< ValueType, AllocatorType >::get_allocator ( ) const
inline

◆ get_shape()

template<class ValueType , class AllocatorType >
auto bc::tensors::exprs::Vector< ValueType, AllocatorType >::get_shape ( ) const
inline

◆ get_stream() [1/2]

template<class ValueType , class AllocatorType >
const stream_type& bc::tensors::exprs::Vector< ValueType, AllocatorType >::get_stream ( ) const
inline

◆ get_stream() [2/2]

template<class ValueType , class AllocatorType >
stream_type& bc::tensors::exprs::Vector< ValueType, AllocatorType >::get_stream ( )
inline

◆ inner_shape()

template<class ValueType , class AllocatorType >
auto bc::tensors::exprs::Vector< ValueType, AllocatorType >::inner_shape ( ) const
inline

◆ leading_dim()

template<class ValueType , class AllocatorType >
size_t bc::tensors::exprs::Vector< ValueType, AllocatorType >::leading_dim ( int  i = 0) const
inline

◆ max_size()

template<class ValueType , class AllocatorType >
std::size_t bc::tensors::exprs::Vector< ValueType, AllocatorType >::max_size ( ) const
inline

◆ outer_dim()

template<class ValueType , class AllocatorType >
size_t bc::tensors::exprs::Vector< ValueType, AllocatorType >::outer_dim ( ) const
inline

◆ pop_back()

template<class ValueType , class AllocatorType >
void bc::tensors::exprs::Vector< ValueType, AllocatorType >::pop_back ( )
inline

◆ push_back() [1/2]

template<class ValueType , class AllocatorType >
void bc::tensors::exprs::Vector< ValueType, AllocatorType >::push_back ( value_type &&  value)
inline

◆ push_back() [2/2]

template<class ValueType , class AllocatorType >
void bc::tensors::exprs::Vector< ValueType, AllocatorType >::push_back ( const value_type value)
inline

◆ reserve()

template<class ValueType , class AllocatorType >
void bc::tensors::exprs::Vector< ValueType, AllocatorType >::reserve ( bc::size_t  reserve_sz)
inline

◆ resize()

template<class ValueType , class AllocatorType >
void bc::tensors::exprs::Vector< ValueType, AllocatorType >::resize ( bc::size_t  new_sz)
inline

◆ rows()

template<class ValueType , class AllocatorType >
size_t bc::tensors::exprs::Vector< ValueType, AllocatorType >::rows ( ) const
inline

◆ shrink_to_fit()

template<class ValueType , class AllocatorType >
void bc::tensors::exprs::Vector< ValueType, AllocatorType >::shrink_to_fit ( )
inline

◆ size()

template<class ValueType , class AllocatorType >
size_t bc::tensors::exprs::Vector< ValueType, AllocatorType >::size ( ) const
inline

Member Data Documentation

◆ tensor_dim

template<class ValueType , class AllocatorType >
constexpr int bc::tensors::exprs::Vector< ValueType, AllocatorType >::tensor_dim = 1
static

◆ tensor_iterator_dim

template<class ValueType , class AllocatorType >
constexpr int bc::tensors::exprs::Vector< ValueType, AllocatorType >::tensor_iterator_dim = 1
static

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