7 #ifndef _MGCPP_MATRIX_DEVICE_MATRIX_HPP_ 8 #define _MGCPP_MATRIX_DEVICE_MATRIX_HPP_ 23 #include <initializer_list> 24 #include <type_traits> 27 template <
typename Type,
typename Alloc = mgcpp::allocator<Type>>
52 static inline size_t determine_ndim(
53 std::initializer_list<std::initializer_list<value_type>>
const&
67 Alloc const& alloc = Alloc());
71 Alloc const& alloc = Alloc());
75 Alloc const& alloc = Alloc());
77 template <
size_t S1,
size_t S2>
79 Alloc const& alloc = Alloc());
83 Alloc const& alloc = Alloc());
87 template <typename DenseMatrix>
95 template <typename DenseMatrix>
124 inline
size_t capacity() const noexcept;
132 inline
size_t device_id() const noexcept;
134 inline
shape_type const& shape() const noexcept;
138 #include <mgcpp/matrix/device_matrix.tpp> thread_context * context() const noexcept
Definition: adapter_base.hpp:14
Definition: adapter_base.hpp:12
Type value_type
Definition: device_matrix.hpp:33
Definition: thread_context.hpp:20
void set_value(size_t i, size_t j, value_type value)
value_type check_value(size_t i, size_t j) const
void copy_to_host(pointer host_p) const
typename device_value_type< Type >::type device_value_type
Definition: device_matrix.hpp:36
device_matrix< Type, Alloc > this_type
Definition: device_matrix.hpp:32
Definition: column_view.hpp:19
device_value_type * device_pointer
Definition: device_matrix.hpp:37
value_type * pointer
Definition: device_matrix.hpp:34
static device_matrix from_list(std::initializer_list< std::initializer_list< value_type >> const &array, Alloc const &alloc=Alloc())
device_value_type const * const_device_pointer
Definition: device_matrix.hpp:38
Definition: dmat_expr.hpp:19
const_device_pointer data() const noexcept
device_matrix< Type, Alloc > & zero()
Definition: is_supported_type.hpp:16
device_pointer data_mutable() noexcept
Definition: dense_matrix.hpp:15
size_t device_id() const noexcept
#define MGCPP_CONCEPT(...)
Definition: concept.hpp:10
Alloc allocator_type
Definition: device_matrix.hpp:42
Definition: allocator.hpp:12
size_t capacity() const noexcept
void init(bool print_system_info=true)
column_view< this_type, Type > column(size_t i) noexcept
device_matrix< Type, Alloc > & resize(shape_type new_shape)
value_type const * const_pointer
Definition: device_matrix.hpp:35
device_pointer release_data() noexcept
Definition: device_matrix.hpp:28
static device_matrix from_c_array(Type(&arr)[S1][S2], Alloc const &alloc=Alloc())
Type type
Definition: device_value_type.hpp:20