mgcpp
A C++ Math Library Based on CUDA
Public Types | Public Member Functions | Static Public Member Functions | List of all members
mgcpp::device_vector< Type, Alloc > Class Template Reference

#include <device_vector.hpp>

Inheritance diagram for mgcpp::device_vector< Type, Alloc >:
Inheritance graph
[legend]
Collaboration diagram for mgcpp::device_vector< Type, Alloc >:
Collaboration graph
[legend]

Public Types

using this_type = device_vector< Type, Alloc >
 
using value_type = Type
 
using pointer = value_type *
 
using const_pointer = value_type const *
 
using device_value_type = typename device_value_type< Type >::type
 
using device_pointer = device_value_type *
 
using const_device_pointer = device_value_type const *
 
using result_type = this_type
 
template<typename T >
using result_expr_type = dvec_expr< T >
 
using allocator_type = Alloc
 
using shape_type = mgcpp::shape< 1 >
 
using parent_type = dense_vector< device_vector< Type, Alloc >, Type >
 

Public Member Functions

 device_vector () noexcept
 
 ~device_vector () noexcept
 
 device_vector (Alloc const &alloc) noexcept
 
 device_vector (size_t size, Alloc const &alloc=Alloc())
 
 device_vector (size_t size, value_type init, Alloc const &alloc=Alloc())
 
 device_vector (size_t size, const_pointer data, Alloc const &alloc=Alloc())
 
 device_vector (std::initializer_list< value_type > const &array, Alloc const &alloc=Alloc())
 
 device_vector (std::vector< value_type > const &vec, Alloc const &alloc=Alloc())
 
template<typename HostVec , MGCPP_CONCEPT(adapter< HostVec >::value) >
 device_vector (HostVec const &host_mat, Alloc const &alloc=Alloc())
 
 device_vector (device_vector< Type, Alloc > const &other)
 
template<typename DenseVec >
 device_vector (dense_vector< DenseVec, Type > const &other)
 
 device_vector (device_vector< Type, Alloc > &&other) noexcept
 
template<typename DenseVec >
device_vector< Type, Alloc > & operator= (dense_vector< DenseVec, Type > const &other)
 
device_vector< Type, Alloc > & operator= (device_vector< Type, Alloc > const &other)
 
device_vector< Type, Alloc > & operator= (device_vector< Type, Alloc > &&other) noexcept
 
device_vector< Type, Alloc > & zero ()
 
device_vector< Type, Alloc > & resize (size_t size, value_type pad_value=value_type{})
 
void copy_to_host (pointer host_p) const
 
value_type check_value (size_t i) const
 
void set_value (size_t i, value_type value)
 
const_device_pointer data () const noexcept
 
device_pointer data_mutable () noexcept
 
size_t capacity () const noexcept
 
device_pointer release_data () noexcept
 
thread_contextcontext () const noexcept
 
shape_type shape () const noexcept
 
Alloc allocator () const noexcept
 
size_t device_id () const noexcept
 
size_t size () const noexcept
 
- Public Member Functions inherited from mgcpp::vector_base< VectorType, Type >
VectorType const & operator~ () const noexcept
 
VectorType & operator~ () noexcept
 

Static Public Member Functions

template<size_t S>
static device_vector from_c_array (Type(&arr)[S], Alloc const &alloc=Alloc())
 

Member Typedef Documentation

◆ allocator_type

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
using mgcpp::device_vector< Type, Alloc >::allocator_type = Alloc

◆ const_device_pointer

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
using mgcpp::device_vector< Type, Alloc >::const_device_pointer = device_value_type const*

◆ const_pointer

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
using mgcpp::device_vector< Type, Alloc >::const_pointer = value_type const*

◆ device_pointer

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
using mgcpp::device_vector< Type, Alloc >::device_pointer = device_value_type*

◆ device_value_type

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
using mgcpp::device_vector< Type, Alloc >::device_value_type = typename device_value_type<Type>::type

◆ parent_type

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
using mgcpp::device_vector< Type, Alloc >::parent_type = dense_vector<device_vector<Type, Alloc>, Type>

◆ pointer

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
using mgcpp::device_vector< Type, Alloc >::pointer = value_type*

◆ result_expr_type

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
template<typename T >
using mgcpp::device_vector< Type, Alloc >::result_expr_type = dvec_expr<T>

◆ result_type

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
using mgcpp::device_vector< Type, Alloc >::result_type = this_type

◆ shape_type

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
using mgcpp::device_vector< Type, Alloc >::shape_type = mgcpp::shape<1>

◆ this_type

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
using mgcpp::device_vector< Type, Alloc >::this_type = device_vector<Type, Alloc>

◆ value_type

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
using mgcpp::device_vector< Type, Alloc >::value_type = Type

Constructor & Destructor Documentation

◆ device_vector() [1/11]

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
mgcpp::device_vector< Type, Alloc >::device_vector ( )
inlinenoexcept

◆ ~device_vector()

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
mgcpp::device_vector< Type, Alloc >::~device_vector ( )
inlinenoexcept

◆ device_vector() [2/11]

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
mgcpp::device_vector< Type, Alloc >::device_vector ( Alloc const &  alloc)
inlineexplicitnoexcept

◆ device_vector() [3/11]

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
mgcpp::device_vector< Type, Alloc >::device_vector ( size_t  size,
Alloc const &  alloc = Alloc() 
)
inlineexplicit

◆ device_vector() [4/11]

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
mgcpp::device_vector< Type, Alloc >::device_vector ( size_t  size,
value_type  init,
Alloc const &  alloc = Alloc() 
)
inlineexplicit

◆ device_vector() [5/11]

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
mgcpp::device_vector< Type, Alloc >::device_vector ( size_t  size,
const_pointer  data,
Alloc const &  alloc = Alloc() 
)
inlineexplicit

◆ device_vector() [6/11]

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
mgcpp::device_vector< Type, Alloc >::device_vector ( std::initializer_list< value_type > const &  array,
Alloc const &  alloc = Alloc() 
)
inlineexplicit

◆ device_vector() [7/11]

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
mgcpp::device_vector< Type, Alloc >::device_vector ( std::vector< value_type > const &  vec,
Alloc const &  alloc = Alloc() 
)
inlineexplicit

◆ device_vector() [8/11]

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
template<typename HostVec , MGCPP_CONCEPT(adapter< HostVec >::value) >
mgcpp::device_vector< Type, Alloc >::device_vector ( HostVec const &  host_mat,
Alloc const &  alloc = Alloc() 
)
inlineexplicit

◆ device_vector() [9/11]

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
mgcpp::device_vector< Type, Alloc >::device_vector ( device_vector< Type, Alloc > const &  other)
inline

◆ device_vector() [10/11]

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
template<typename DenseVec >
mgcpp::device_vector< Type, Alloc >::device_vector ( dense_vector< DenseVec, Type > const &  other)
inlineexplicit

◆ device_vector() [11/11]

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
mgcpp::device_vector< Type, Alloc >::device_vector ( device_vector< Type, Alloc > &&  other)
inlinenoexcept

Member Function Documentation

◆ allocator()

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
Alloc mgcpp::device_vector< Type, Alloc >::allocator ( ) const
inlinenoexcept

◆ capacity()

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
size_t mgcpp::device_vector< Type, Alloc >::capacity ( ) const
inlinenoexcept

◆ check_value()

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
value_type mgcpp::device_vector< Type, Alloc >::check_value ( size_t  i) const
inline

◆ context()

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
thread_context* mgcpp::device_vector< Type, Alloc >::context ( ) const
inlinenoexcept

◆ copy_to_host()

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
void mgcpp::device_vector< Type, Alloc >::copy_to_host ( pointer  host_p) const
inline

◆ data()

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
const_device_pointer mgcpp::device_vector< Type, Alloc >::data ( ) const
inlinenoexcept

◆ data_mutable()

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
device_pointer mgcpp::device_vector< Type, Alloc >::data_mutable ( )
inlinenoexcept

◆ device_id()

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
size_t mgcpp::device_vector< Type, Alloc >::device_id ( ) const
inlinenoexcept

◆ from_c_array()

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
template<size_t S>
static device_vector mgcpp::device_vector< Type, Alloc >::from_c_array ( Type(&)  arr[S],
Alloc const &  alloc = Alloc() 
)
inlinestatic

◆ operator=() [1/3]

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
template<typename DenseVec >
device_vector<Type, Alloc>& mgcpp::device_vector< Type, Alloc >::operator= ( dense_vector< DenseVec, Type > const &  other)
inline

◆ operator=() [2/3]

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
device_vector<Type, Alloc>& mgcpp::device_vector< Type, Alloc >::operator= ( device_vector< Type, Alloc > const &  other)
inline

◆ operator=() [3/3]

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
device_vector<Type, Alloc>& mgcpp::device_vector< Type, Alloc >::operator= ( device_vector< Type, Alloc > &&  other)
inlinenoexcept

◆ release_data()

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
device_pointer mgcpp::device_vector< Type, Alloc >::release_data ( )
inlinenoexcept

◆ resize()

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
device_vector<Type, Alloc>& mgcpp::device_vector< Type, Alloc >::resize ( size_t  size,
value_type  pad_value = value_type{} 
)
inline

◆ set_value()

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
void mgcpp::device_vector< Type, Alloc >::set_value ( size_t  i,
value_type  value 
)
inline

◆ shape()

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
shape_type mgcpp::device_vector< Type, Alloc >::shape ( ) const
inlinenoexcept

◆ size()

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
size_t mgcpp::device_vector< Type, Alloc >::size ( ) const
inlinenoexcept

◆ zero()

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
device_vector<Type, Alloc>& mgcpp::device_vector< Type, Alloc >::zero ( )
inline

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