5#ifndef GKO_PUBLIC_CORE_BASE_DEVICE_MATRIX_DATA_HPP_
6#define GKO_PUBLIC_CORE_BASE_DEVICE_MATRIX_DATA_HPP_
9#include <ginkgo/core/base/array.hpp>
10#include <ginkgo/core/base/dim.hpp>
11#include <ginkgo/core/base/exception_helpers.hpp>
12#include <ginkgo/core/base/executor.hpp>
13#include <ginkgo/core/base/matrix_data.hpp>
14#include <ginkgo/core/base/temporary_clone.hpp>
35template <
typename ValueType,
typename IndexType>
38 using value_type = ValueType;
39 using index_type = IndexType;
82 template <
typename InputValueType,
typename RowIndexType,
83 typename ColIndexType>
85 "explicitly construct the gko::array arguments instead of passing "
88 std::initializer_list<RowIndexType> row_idxs,
89 std::initializer_list<ColIndexType> col_idxs,
90 std::initializer_list<InputValueType> values)
115 std::shared_ptr<const Executor> exec,
const host_type& data);
165 GKO_DEPRECATED(
"use get_num_stored_elements()")
271template <
typename ValueType,
typename IndexType>
273 static std::unique_ptr<device_matrix_data<ValueType, IndexType>> create(
274 std::shared_ptr<const Executor> exec,
278 return std::make_unique<device_matrix_data<ValueType, IndexType>>(
279 std::move(exec), *ptr);
281 return std::make_unique<device_matrix_data<ValueType, IndexType>>(
288template <
typename ValueType,
typename IndexType>
289struct temporary_clone_helper<const device_matrix_data<ValueType, IndexType>> {
290 static std::unique_ptr<const device_matrix_data<ValueType, IndexType>>
291 create(std::shared_ptr<const Executor> exec,
292 const device_matrix_data<ValueType, IndexType>* ptr,
bool)
294 return std::make_unique<const device_matrix_data<ValueType, IndexType>>(
295 std::move(exec), *ptr);
300template <
typename ValueType,
typename IndexType>
301class copy_back_deleter<device_matrix_data<ValueType, IndexType>>
302 :
public copy_back_deleter_from_assignment<
303 device_matrix_data<ValueType, IndexType>> {
305 using copy_back_deleter_from_assignment<device_matrix_data<
306 ValueType, IndexType>>::copy_back_deleter_from_assignment;
Definition executor.hpp:615
value_type * get_data() noexcept
Definition array.hpp:673
std::shared_ptr< const Executor > get_executor() const noexcept
Definition array.hpp:689
const value_type * get_const_data() const noexcept
Definition array.hpp:682
size_type get_size() const noexcept
Definition array.hpp:656
Definition device_matrix_data.hpp:36
dim< 2 > get_size() const
Definition device_matrix_data.hpp:158
static device_matrix_data create_from_host(std::shared_ptr< const Executor > exec, const host_type &data)
const index_type * get_const_row_idxs() const
Definition device_matrix_data.hpp:187
index_type * get_row_idxs()
Definition device_matrix_data.hpp:180
const value_type * get_const_values() const
Definition device_matrix_data.hpp:221
device_matrix_data(std::shared_ptr< const Executor > exec, dim< 2 > size={}, size_type num_entries=0)
size_type get_num_stored_elements() const
Definition device_matrix_data.hpp:173
const index_type * get_const_col_idxs() const
Definition device_matrix_data.hpp:204
void resize_and_reset(size_type new_num_entries)
void resize_and_reset(dim< 2 > new_size, size_type new_num_entries)
size_type get_num_elems() const
Definition device_matrix_data.hpp:166
std::shared_ptr< const Executor > get_executor() const
Definition device_matrix_data.hpp:148
device_matrix_data(std::shared_ptr< const Executor > exec, const device_matrix_data &data)
index_type * get_col_idxs()
Definition device_matrix_data.hpp:197
value_type * get_values()
Definition device_matrix_data.hpp:214
host_type copy_to_host() const
device_matrix_data(std::shared_ptr< const Executor > exec, dim< 2 > size, array< index_type > row_idxs, array< index_type > col_idxs, array< value_type > values)
The Ginkgo namespace.
Definition abstract_factory.hpp:20
std::size_t size_type
Definition types.hpp:89
Definition device_matrix_data.hpp:246
Definition matrix_data.hpp:60
Definition matrix_data.hpp:126