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

#include <device_matrix.hpp>

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

Public Types

using this_type = device_matrix< 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 = dmat_expr< T >
 
using allocator_type = Alloc
 
using shape_type = mgcpp::shape< 2 >
 

Public Member Functions

 device_matrix () noexcept
 
 ~device_matrix () noexcept
 
 device_matrix (Alloc const &alloc)
 
 device_matrix (shape_type shape, Alloc const &alloc=Alloc())
 
 device_matrix (shape_type shape, value_type init, Alloc const &alloc=Alloc())
 
 device_matrix (shape_type shape, const_pointer data, Alloc const &alloc=Alloc())
 
template<typename HostMat , MGCPP_CONCEPT(adapter< HostMat >::value) >
 device_matrix (HostMat const &host_mat, Alloc const &alloc=Alloc())
 
 device_matrix (device_matrix< Type, Alloc > const &other)
 
template<typename DenseMatrix >
 device_matrix (dense_matrix< DenseMatrix, Type > const &other)
 
 device_matrix (device_matrix< Type, Alloc > &&other) noexcept
 
device_matrix< Type, Alloc > & operator= (device_matrix< Type, Alloc > const &other)
 
template<typename DenseMatrix >
device_matrix< Type, Alloc > & operator= (dense_matrix< DenseMatrix, Type > const &other)
 
device_matrix< Type, Alloc > & operator= (device_matrix< Type, Alloc > &&other) noexcept
 
device_matrix< Type, Alloc > & zero ()
 
device_matrix< Type, Alloc > & resize (shape_type new_shape)
 
device_matrix< Type, Alloc > & resize (shape_type new_shape, value_type init)
 
column_view< this_type, Type > column (size_t i) noexcept
 
void copy_to_host (pointer host_p) const
 
value_type check_value (size_t i, size_t j) const
 
void set_value (size_t i, size_t j, value_type value)
 
const_device_pointer data () const noexcept
 
device_pointer data_mutable () noexcept
 
size_t capacity () const noexcept
 
thread_contextcontext () const noexcept
 
device_pointer release_data () noexcept
 
Alloc allocator () const noexcept
 
size_t device_id () const noexcept
 
shape_type const & shape () const noexcept
 
- Public Member Functions inherited from mgcpp::matrix_base< MatrixType, Type >
MatrixType const & operator~ () const noexcept
 
MatrixType & operator~ () noexcept
 

Static Public Member Functions

static device_matrix from_list (std::initializer_list< std::initializer_list< value_type >> const &array, Alloc const &alloc=Alloc())
 
template<size_t S1, size_t S2>
static device_matrix from_c_array (Type(&arr)[S1][S2], Alloc const &alloc=Alloc())
 

Member Typedef Documentation

◆ allocator_type

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

◆ const_device_pointer

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

◆ const_pointer

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

◆ device_pointer

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

◆ device_value_type

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

◆ pointer

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

◆ result_expr_type

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
template<typename T >
using mgcpp::device_matrix< Type, Alloc >::result_expr_type = dmat_expr<T>

◆ result_type

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

◆ shape_type

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
using mgcpp::device_matrix< Type, Alloc >::shape_type = mgcpp::shape<2>

◆ this_type

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

◆ value_type

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

Constructor & Destructor Documentation

◆ device_matrix() [1/9]

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

◆ ~device_matrix()

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

◆ device_matrix() [2/9]

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

◆ device_matrix() [3/9]

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
mgcpp::device_matrix< Type, Alloc >::device_matrix ( shape_type  shape,
Alloc const &  alloc = Alloc() 
)
inlineexplicit

◆ device_matrix() [4/9]

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
mgcpp::device_matrix< Type, Alloc >::device_matrix ( shape_type  shape,
value_type  init,
Alloc const &  alloc = Alloc() 
)
inlineexplicit

◆ device_matrix() [5/9]

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
mgcpp::device_matrix< Type, Alloc >::device_matrix ( shape_type  shape,
const_pointer  data,
Alloc const &  alloc = Alloc() 
)
inlineexplicit

◆ device_matrix() [6/9]

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

◆ device_matrix() [7/9]

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

◆ device_matrix() [8/9]

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
template<typename DenseMatrix >
mgcpp::device_matrix< Type, Alloc >::device_matrix ( dense_matrix< DenseMatrix, Type > const &  other)
inlineexplicit

◆ device_matrix() [9/9]

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

Member Function Documentation

◆ allocator()

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

◆ capacity()

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

◆ check_value()

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

◆ column()

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
column_view<this_type, Type> mgcpp::device_matrix< Type, Alloc >::column ( size_t  i)
inlinenoexcept

◆ context()

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

◆ copy_to_host()

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

◆ data()

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

◆ data_mutable()

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

◆ device_id()

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

◆ from_c_array()

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

◆ from_list()

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
static device_matrix mgcpp::device_matrix< Type, Alloc >::from_list ( std::initializer_list< std::initializer_list< value_type >> const &  array,
Alloc const &  alloc = Alloc() 
)
inlinestatic

◆ operator=() [1/3]

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

◆ operator=() [2/3]

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

◆ operator=() [3/3]

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

◆ release_data()

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

◆ resize() [1/2]

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
device_matrix<Type, Alloc>& mgcpp::device_matrix< Type, Alloc >::resize ( shape_type  new_shape)
inline

◆ resize() [2/2]

template<typename Type , typename Alloc = mgcpp::allocator<Type>>
device_matrix<Type, Alloc>& mgcpp::device_matrix< Type, Alloc >::resize ( shape_type  new_shape,
value_type  init 
)
inline

◆ set_value()

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

◆ shape()

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

◆ zero()

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

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