5#ifndef GKO_PUBLIC_CORE_MATRIX_CSR_HPP_
6#define GKO_PUBLIC_CORE_MATRIX_CSR_HPP_
9#include <ginkgo/core/base/array.hpp>
10#include <ginkgo/core/base/index_set.hpp>
11#include <ginkgo/core/base/lin_op.hpp>
12#include <ginkgo/core/base/math.hpp>
13#include <ginkgo/core/matrix/permutation.hpp>
14#include <ginkgo/core/matrix/scaled_permutation.hpp>
21template <
typename ValueType>
24template <
typename ValueType>
27template <
typename ValueType,
typename IndexType>
30template <
typename ValueType,
typename IndexType>
33template <
typename ValueType,
typename IndexType>
36template <
typename ValueType,
typename IndexType>
39template <
typename ValueType,
typename IndexType>
42template <
typename ValueType,
typename IndexType>
45template <
typename ValueType,
typename IndexType>
48template <
typename ValueType,
typename IndexType>
55template <
typename ValueType = default_precision,
typename IndexType =
int32>
100template <
typename ValueType = default_precision,
typename IndexType =
int32>
102 public ConvertibleTo<Csr<next_precision<ValueType>, IndexType>>,
116 remove_complex<Csr<ValueType, IndexType>>>,
119 friend class Coo<ValueType, IndexType>;
120 friend class Dense<ValueType>;
122 friend class Ell<ValueType, IndexType>;
123 friend class Hybrid<ValueType, IndexType>;
124 friend class Sellp<ValueType, IndexType>;
126 friend class Fbcsr<ValueType, IndexType>;
127 friend class CsrBuilder<ValueType, IndexType>;
151 using value_type = ValueType;
152 using index_type = IndexType;
208 virtual std::shared_ptr<strategy_type>
copy() = 0;
211 void set_name(std::string name) { name_ = name; }
245 max_length_per_row_ = 0;
247 max_length_per_row_ = std::max(max_length_per_row_,
256 return max_length_per_row_;
259 std::shared_ptr<strategy_type>
copy()
override
261 return std::make_shared<classical>();
265 index_type max_length_per_row_;
286 std::shared_ptr<strategy_type>
copy()
override
288 return std::make_shared<merge_path>();
311 std::shared_ptr<strategy_type>
copy()
override
313 return std::make_shared<cusparse>();
335 std::shared_ptr<strategy_type>
copy()
override
337 return std::make_shared<sparselib>();
363 :
load_balance(exec->get_num_warps(), exec->get_warp_size())
462 if (warp_size_ > 0) {
473 if (strategy_name_ ==
"intel") {
481#if GINKGO_HIP_PLATFORM_HCC
482 if (!cuda_strategy_) {
492 auto nwarps = nwarps_ * multiple;
499 std::shared_ptr<strategy_type>
copy()
override
501 return std::make_shared<load_balance>(
502 nwarps_, warp_size_, cuda_strategy_, strategy_name_);
509 std::string strategy_name_;
516 const index_type nvidia_row_len_limit = 1024;
519 const index_type nvidia_nnz_limit{
static_cast<index_type
>(1
e6)};
522 const index_type amd_row_len_limit = 768;
525 const index_type amd_nnz_limit{
static_cast<index_type
>(1
e8)};
528 const index_type intel_row_len_limit = 25600;
531 const index_type intel_nnz_limit{
static_cast<index_type
>(3
e8)};
551 :
automatical(exec->get_num_warps(), exec->get_warp_size())
593 max_length_per_row_(0)
604 if (strategy_name_ ==
"intel") {
608#if GINKGO_HIP_PLATFORM_HCC
609 if (!cuda_strategy_) {
628 cuda_strategy_, strategy_name_);
642 nwarps_, warp_size_, cuda_strategy_, strategy_name_);
653 max_length_per_row_ =
657 max_length_per_row_ =
667 return std::make_shared<load_balance>(
668 nwarps_, warp_size_, cuda_strategy_, strategy_name_)
674 return max_length_per_row_;
677 std::shared_ptr<strategy_type>
copy()
override
679 return std::make_shared<automatical>(
680 nwarps_, warp_size_, cuda_strategy_, strategy_name_);
687 std::string strategy_name_;
688 index_type max_length_per_row_;
772 bool invert =
false)
const;
804 bool invert =
false)
const;
841 bool is_sorted_by_column_index()
const;
955 strategy_ = std::move(strategy->copy());
968 GKO_ASSERT_EQUAL_DIMENSIONS(alpha,
dim<2>(1, 1));
981 GKO_ASSERT_EQUAL_DIMENSIONS(alpha,
dim<2>(1, 1));
993 static std::unique_ptr<Csr>
create(std::shared_ptr<const Executor> exec,
994 std::shared_ptr<strategy_type> strategy);
1008 std::shared_ptr<const Executor> exec,
const dim<2>& size = {},
1010 std::shared_ptr<strategy_type> strategy =
nullptr);
1032 std::shared_ptr<const Executor> exec,
const dim<2>& size,
1035 std::shared_ptr<strategy_type> strategy =
nullptr);
1044 "explicitly construct the gko::array argument instead of passing "
1045 "initializer lists")
1073 std::shared_ptr<const Executor> exec,
const dim<2>& size,
1074 gko::detail::const_array_view<ValueType>&& values,
1075 gko::detail::const_array_view<IndexType>&& col_idxs,
1076 gko::detail::const_array_view<IndexType>&&
row_ptrs,
1077 std::shared_ptr<strategy_type> strategy =
nullptr);
1134 Csr(std::shared_ptr<const Executor> exec,
const dim<2>& size = {},
1136 std::shared_ptr<strategy_type> strategy =
nullptr);
1138 Csr(std::shared_ptr<const Executor> exec,
const dim<2>& size,
1141 std::shared_ptr<strategy_type> strategy =
nullptr);
1143 void apply_impl(
const LinOp* b,
LinOp* x)
const override;
1145 void apply_impl(
const LinOp* alpha,
const LinOp* b,
const LinOp* beta,
1146 LinOp* x)
const override;
1149 static std::shared_ptr<strategy_type> make_default_strategy(
1150 std::shared_ptr<const Executor> exec)
1152 auto cuda_exec = std::dynamic_pointer_cast<const CudaExecutor>(exec);
1153 auto hip_exec = std::dynamic_pointer_cast<const HipExecutor>(exec);
1154 auto dpcpp_exec = std::dynamic_pointer_cast<const DpcppExecutor>(exec);
1169 template <
typename CsrType>
1173 std::shared_ptr<typename CsrType::strategy_type>
new_strat;
1174 if (
dynamic_cast<classical*
>(
strat)) {
1175 new_strat = std::make_shared<typename CsrType::classical>();
1176 }
else if (
dynamic_cast<merge_path*
>(
strat)) {
1177 new_strat = std::make_shared<typename CsrType::merge_path>();
1178 }
else if (
dynamic_cast<cusparse*
>(
strat)) {
1179 new_strat = std::make_shared<typename CsrType::cusparse>();
1180 }
else if (
dynamic_cast<sparselib*
>(
strat)) {
1181 new_strat = std::make_shared<typename CsrType::sparselib>();
1185 std::dynamic_pointer_cast<const CudaExecutor>(
rexec);
1186 auto hip_exec = std::dynamic_pointer_cast<const HipExecutor>(
rexec);
1188 std::dynamic_pointer_cast<const DpcppExecutor>(
rexec);
1189 auto lb =
dynamic_cast<load_balance*
>(
strat);
1193 std::make_shared<typename CsrType::load_balance>(
1196 new_strat = std::make_shared<typename CsrType::automatical>(
1202 std::make_shared<typename CsrType::load_balance>(
1205 new_strat = std::make_shared<typename CsrType::automatical>(
1211 std::make_shared<typename CsrType::load_balance>(
1214 new_strat = std::make_shared<typename CsrType::automatical>(
1220 std::dynamic_pointer_cast<const CudaExecutor>(
1223 std::dynamic_pointer_cast<const HipExecutor>(
1226 std::dynamic_pointer_cast<const DpcppExecutor>(
1231 std::make_shared<typename CsrType::load_balance>(
1235 std::make_shared<typename CsrType::automatical>(
1241 std::make_shared<typename CsrType::load_balance>(
1245 std::make_shared<typename CsrType::automatical>(
1251 std::make_shared<typename CsrType::load_balance>(
1255 std::make_shared<typename CsrType::automatical>(
1263 new_strat = std::make_shared<typename CsrType::classical>();
1276 strategy_->process(row_ptrs_, &srow_);
1285 virtual void scale_impl(
const LinOp* alpha);
1293 virtual void inv_scale_impl(
const LinOp* alpha);
1296 std::shared_ptr<strategy_type> strategy_;
1297 array<value_type> values_;
1298 array<index_type> col_idxs_;
1299 array<index_type> row_ptrs_;
1300 array<index_type> srow_;
1302 void add_scaled_identity_impl(
const LinOp*
a,
const LinOp* b)
override;
1315template <
typename ValueType,
typename IndexType>
1316void strategy_rebuild_helper(Csr<ValueType, IndexType>*
result)
1318 using load_balance =
typename Csr<ValueType, IndexType>::load_balance;
1319 using automatical =
typename Csr<ValueType, IndexType>::automatical;
1320 auto strategy =
result->get_strategy();
1322 if (std::dynamic_pointer_cast<load_balance>(strategy)) {
1324 std::dynamic_pointer_cast<const HipExecutor>(
executor)) {
1325 result->set_strategy(std::make_shared<load_balance>(exec));
1326 }
else if (
auto exec = std::dynamic_pointer_cast<const CudaExecutor>(
1328 result->set_strategy(std::make_shared<load_balance>(exec));
1330 }
else if (std::dynamic_pointer_cast<automatical>(strategy)) {
1332 std::dynamic_pointer_cast<const HipExecutor>(
executor)) {
1333 result->set_strategy(std::make_shared<automatical>(exec));
1334 }
else if (
auto exec = std::dynamic_pointer_cast<const CudaExecutor>(
1336 result->set_strategy(std::make_shared<automatical>(exec));
ConvertibleTo interface is used to mark that the implementer can be converted to the object of Result...
Definition polymorphic_object.hpp:471
This is the Executor subclass which represents the CUDA device.
Definition executor.hpp:1485
The EnableAbsoluteComputation mixin provides the default implementations of compute_absolute_linop an...
Definition lin_op.hpp:795
The EnableLinOp mixin can be used to provide sensible default implementations of the majority of the ...
Definition lin_op.hpp:880
This mixin inherits from (a subclass of) PolymorphicObject and provides a base implementation of a ne...
Definition polymorphic_object.hpp:663
The first step in using the Ginkgo library consists of creating an executor.
Definition executor.hpp:616
Definition lin_op.hpp:118
This is the Executor subclass which represents the OpenMP device (typically CPU).
Definition executor.hpp:1338
Linear operators which support permutation should implement the Permutable interface.
Definition lin_op.hpp:485
std::shared_ptr< const Executor > get_executor() const noexcept
Returns the Executor of the object.
Definition polymorphic_object.hpp:235
A LinOp implementing this interface can read its data from a matrix_data structure.
Definition lin_op.hpp:606
Adds the operation M <- a I + b M for matrix M, identity operator I and scalars a and b,...
Definition lin_op.hpp:819
Linear operators which support transposition should implement the Transposable interface.
Definition lin_op.hpp:434
A LinOp implementing this interface can write its data to a matrix_data structure.
Definition lin_op.hpp:661
An array is a container which encapsulates fixed-sized arrays, stored on the Executor tied to the arr...
Definition array.hpp:167
void resize_and_reset(size_type size)
Resizes the array so it is able to hold the specified number of elements.
Definition array.hpp:623
value_type * get_data() noexcept
Returns a pointer to the block of memory used to store the elements of the array.
Definition array.hpp:674
const value_type * get_const_data() const noexcept
Returns a constant pointer to the block of memory used to store the elements of the array.
Definition array.hpp:683
size_type get_size() const noexcept
Returns the number of elements in the array.
Definition array.hpp:657
This type is a device-side equivalent to matrix_data.
Definition device_matrix_data.hpp:35
An index set class represents an ordered set of intervals.
Definition index_set.hpp:57
COO stores a matrix in the coordinate matrix format.
Definition coo.hpp:58
std::shared_ptr< strategy_type > copy() override
Copy a strategy.
Definition csr.hpp:677
automatical(int64_t nwarps, int warp_size=32, bool cuda_strategy=true, std::string strategy_name="none")
Creates an automatical strategy with specified parameters.
Definition csr.hpp:585
automatical()
Creates an automatical strategy.
Definition csr.hpp:540
int64_t clac_size(const int64_t nnz) override
Computes the srow size according to the number of nonzeros.
Definition csr.hpp:665
automatical(std::shared_ptr< const CudaExecutor > exec)
Creates an automatical strategy with CUDA executor.
Definition csr.hpp:550
void process(const array< index_type > &mtx_row_ptrs, array< index_type > *mtx_srow) override
Computes srow according to row pointers.
Definition csr.hpp:596
automatical(std::shared_ptr< const DpcppExecutor > exec)
Creates an automatical strategy with Dpcpp executor.
Definition csr.hpp:570
automatical(std::shared_ptr< const HipExecutor > exec)
Creates an automatical strategy with HIP executor.
Definition csr.hpp:559
classical is a strategy_type which uses the same number of threads on each row.
Definition csr.hpp:223
void process(const array< index_type > &mtx_row_ptrs, array< index_type > *mtx_srow) override
Computes srow according to row pointers.
Definition csr.hpp:230
std::shared_ptr< strategy_type > copy() override
Copy a strategy.
Definition csr.hpp:259
classical()
Creates a classical strategy.
Definition csr.hpp:228
int64_t clac_size(const int64_t nnz) override
Computes the srow size according to the number of nonzeros.
Definition csr.hpp:252
cusparse is a strategy_type which uses the sparselib csr.
Definition csr.hpp:298
int64_t clac_size(const int64_t nnz) override
Computes the srow size according to the number of nonzeros.
Definition csr.hpp:309
std::shared_ptr< strategy_type > copy() override
Copy a strategy.
Definition csr.hpp:311
cusparse()
Creates a cusparse strategy.
Definition csr.hpp:303
void process(const array< index_type > &mtx_row_ptrs, array< index_type > *mtx_srow) override
Computes srow according to row pointers.
Definition csr.hpp:305
load_balance is a strategy_type which uses the load balance algorithm.
Definition csr.hpp:344
void process(const array< index_type > &mtx_row_ptrs, array< index_type > *mtx_srow) override
Computes srow according to row pointers.
Definition csr.hpp:407
std::shared_ptr< strategy_type > copy() override
Copy a strategy.
Definition csr.hpp:499
load_balance(std::shared_ptr< const HipExecutor > exec)
Creates a load_balance strategy with HIP executor.
Definition csr.hpp:371
load_balance()
Creates a load_balance strategy.
Definition csr.hpp:352
int64_t clac_size(const int64_t nnz) override
Computes the srow size according to the number of nonzeros.
Definition csr.hpp:460
load_balance(int64_t nwarps, int warp_size=32, bool cuda_strategy=true, std::string strategy_name="none")
Creates a load_balance strategy with specified parameters.
Definition csr.hpp:397
load_balance(std::shared_ptr< const CudaExecutor > exec)
Creates a load_balance strategy with CUDA executor.
Definition csr.hpp:362
load_balance(std::shared_ptr< const DpcppExecutor > exec)
Creates a load_balance strategy with DPCPP executor.
Definition csr.hpp:382
merge_path is a strategy_type which uses the merge_path algorithm.
Definition csr.hpp:273
int64_t clac_size(const int64_t nnz) override
Computes the srow size according to the number of nonzeros.
Definition csr.hpp:284
std::shared_ptr< strategy_type > copy() override
Copy a strategy.
Definition csr.hpp:286
merge_path()
Creates a merge_path strategy.
Definition csr.hpp:278
void process(const array< index_type > &mtx_row_ptrs, array< index_type > *mtx_srow) override
Computes srow according to row pointers.
Definition csr.hpp:280
sparselib is a strategy_type which uses the sparselib csr.
Definition csr.hpp:322
int64_t clac_size(const int64_t nnz) override
Computes the srow size according to the number of nonzeros.
Definition csr.hpp:333
void process(const array< index_type > &mtx_row_ptrs, array< index_type > *mtx_srow) override
Computes srow according to row pointers.
Definition csr.hpp:329
sparselib()
Creates a sparselib strategy.
Definition csr.hpp:327
std::shared_ptr< strategy_type > copy() override
Copy a strategy.
Definition csr.hpp:335
strategy_type is to decide how to set the csr algorithm.
Definition csr.hpp:166
virtual int64_t clac_size(const int64_t nnz)=0
Computes the srow size according to the number of nonzeros.
std::string get_name()
Returns the name of strategy.
Definition csr.hpp:184
virtual std::shared_ptr< strategy_type > copy()=0
Copy a strategy.
virtual void process(const array< index_type > &mtx_row_ptrs, array< index_type > *mtx_srow)=0
Computes srow according to row pointers.
strategy_type(std::string name)
Creates a strategy_type.
Definition csr.hpp:175
CSR is a matrix format which stores only the nonzero coefficients by compressing each row of the matr...
Definition csr.hpp:117
std::unique_ptr< LinOp > column_permute(const array< IndexType > *permutation_indices) const override
Returns a LinOp representing the column permutation of the Permutable object.
Csr & operator=(const Csr &)
Copy-assigns a Csr matrix.
std::unique_ptr< Csr > scale_permute(ptr_param< const ScaledPermutation< value_type, index_type > > permutation, permute_mode=permute_mode::symmetric) const
Creates a scaled and permuted copy of this matrix.
void write(mat_data &data) const override
Writes a matrix to a matrix_data structure.
std::unique_ptr< absolute_type > compute_absolute() const override
Gets the AbsoluteLinOp.
const index_type * get_const_row_ptrs() const noexcept
Returns the row pointers of the matrix.
Definition csr.hpp:895
std::unique_ptr< Csr< ValueType, IndexType > > create_submatrix(const span &row_span, const span &column_span) const
Creates a submatrix from this Csr matrix given row and column spans.
static std::unique_ptr< Csr > create(std::shared_ptr< const Executor > exec, const dim< 2 > &size={}, size_type num_nonzeros={}, std::shared_ptr< strategy_type > strategy=nullptr)
Creates an uninitialized CSR matrix of the specified size.
void read(device_mat_data &&data) override
Reads a matrix from a device_matrix_data structure.
const index_type * get_const_srow() const noexcept
Returns the starting rows.
Definition csr.hpp:914
void set_strategy(std::shared_ptr< strategy_type > strategy)
Set the strategy.
Definition csr.hpp:953
void inv_scale(ptr_param< const LinOp > alpha)
Scales the matrix with the inverse of a scalar.
Definition csr.hpp:978
void read(const device_mat_data &data) override
Reads a matrix from a device_matrix_data structure.
index_type * get_srow() noexcept
Returns the starting rows.
Definition csr.hpp:905
static std::unique_ptr< Csr > create(std::shared_ptr< const Executor > exec, std::shared_ptr< strategy_type > strategy)
Creates an uninitialized CSR matrix of the specified size.
size_type get_num_srow_elements() const noexcept
Returns the number of the srow stored elements (involved warps)
Definition csr.hpp:924
std::unique_ptr< LinOp > inverse_permute(const array< IndexType > *inverse_permutation_indices) const override
Returns a LinOp representing the symmetric inverse row and column permutation of the Permutable objec...
std::unique_ptr< LinOp > row_permute(const array< IndexType > *permutation_indices) const override
Returns a LinOp representing the row permutation of the Permutable object.
std::unique_ptr< Csr< ValueType, IndexType > > create_submatrix(const index_set< IndexType > &row_index_set, const index_set< IndexType > &column_index_set) const
Creates a submatrix from this Csr matrix given row and column index_set objects.
std::unique_ptr< Diagonal< ValueType > > extract_diagonal() const override
Extracts the diagonal entries of the matrix into a vector.
static std::unique_ptr< Csr > create(std::shared_ptr< const Executor > exec, const dim< 2 > &size, array< value_type > values, array< index_type > col_idxs, array< index_type > row_ptrs, std::shared_ptr< strategy_type > strategy=nullptr)
Creates a CSR matrix from already allocated (and initialized) row pointer, column index and value arr...
index_type * get_row_ptrs() noexcept
Returns the row pointers of the matrix.
Definition csr.hpp:886
std::unique_ptr< Csr > permute(ptr_param< const Permutation< index_type > > permutation, permute_mode mode=permute_mode::symmetric) const
Creates a permuted copy of this matrix with the given permutation .
static std::unique_ptr< const Csr > create_const(std::shared_ptr< const Executor > exec, const dim< 2 > &size, gko::detail::const_array_view< ValueType > &&values, gko::detail::const_array_view< IndexType > &&col_idxs, gko::detail::const_array_view< IndexType > &&row_ptrs, std::shared_ptr< strategy_type > strategy=nullptr)
Creates a constant (immutable) Csr matrix from a set of constant arrays.
Csr(const Csr &)
Copy-constructs a Csr matrix.
Csr & operator=(Csr &&)
Move-assigns a Csr matrix.
std::unique_ptr< LinOp > transpose() const override
Returns a LinOp representing the transpose of the Transposable object.
const value_type * get_const_values() const noexcept
Returns the values of the matrix.
Definition csr.hpp:857
std::unique_ptr< LinOp > inverse_column_permute(const array< IndexType > *inverse_permutation_indices) const override
Returns a LinOp representing the row permutation of the inverse permuted object.
std::unique_ptr< LinOp > inverse_row_permute(const array< IndexType > *inverse_permutation_indices) const override
Returns a LinOp representing the row permutation of the inverse permuted object.
void compute_absolute_inplace() override
Compute absolute inplace on each element.
size_type get_num_stored_elements() const noexcept
Returns the number of elements explicitly stored in the matrix.
Definition csr.hpp:934
std::shared_ptr< strategy_type > get_strategy() const noexcept
Returns the strategy.
Definition csr.hpp:943
std::unique_ptr< LinOp > permute(const array< IndexType > *permutation_indices) const override
Returns a LinOp representing the symmetric row and column permutation of the Permutable object.
const index_type * get_const_col_idxs() const noexcept
Returns the column indexes of the matrix.
Definition csr.hpp:876
void read(const mat_data &data) override
Reads a matrix from a matrix_data structure.
void sort_by_column_index()
Sorts all (value, col_idx) pairs in each row by column index.
std::unique_ptr< Csr > scale_permute(ptr_param< const ScaledPermutation< value_type, index_type > > row_permutation, ptr_param< const ScaledPermutation< value_type, index_type > > column_permutation, bool invert=false) const
Creates a scaled and permuted copy of this matrix.
void scale(ptr_param< const LinOp > alpha)
Scales the matrix with a scalar.
Definition csr.hpp:965
value_type * get_values() noexcept
Returns the values of the matrix.
Definition csr.hpp:848
index_type * get_col_idxs() noexcept
Returns the column indexes of the matrix.
Definition csr.hpp:867
Csr(Csr &&)
Move-constructs a Csr matrix.
std::unique_ptr< Csr > permute(ptr_param< const Permutation< index_type > > row_permutation, ptr_param< const Permutation< index_type > > column_permutation, bool invert=false) const
Creates a non-symmetrically permuted copy of this matrix with the given row and column permutations...
std::unique_ptr< LinOp > conj_transpose() const override
Returns a LinOp representing the conjugate transpose of the Transposable object.
Dense is a matrix format which explicitly stores all values of the matrix.
Definition dense.hpp:107
This class is a utility which efficiently implements the diagonal matrix (a linear operator which sca...
Definition diagonal.hpp:50
ELL is a matrix format where stride with explicit zeros is used such that all rows have the same numb...
Definition ell.hpp:60
Fixed-block compressed sparse row storage matrix format.
Definition fbcsr.hpp:109
HYBRID is a matrix format which splits the matrix into ELLPACK and COO format.
Definition hybrid.hpp:52
Permutation is a matrix format that represents a permutation matrix, i.e.
Definition permutation.hpp:113
ScaledPermutation is a matrix combining a permutation with scaling factors.
Definition scaled_permutation.hpp:39
SELL-P is a matrix format similar to ELL format.
Definition sellp.hpp:51
SparsityCsr is a matrix format which stores only the sparsity pattern of a sparse matrix by compressi...
Definition sparsity_csr.hpp:57
This class is used for function parameters in the place of raw pointers.
Definition utils_helper.hpp:43
permute_mode
Specifies how a permutation will be applied to a matrix.
Definition permutation.hpp:43
@ symmetric
The rows and columns will be permuted.
The Ginkgo namespace.
Definition abstract_factory.hpp:20
constexpr T one()
Returns the multiplicative identity for T.
Definition math.hpp:775
typename detail::remove_complex_s< T >::type remove_complex
Obtain the type which removed the complex of complex/scalar type or the template parameter of class b...
Definition math.hpp:326
typename detail::next_precision_impl< T >::type next_precision
Obtains the next type in the singly-linked precision list.
Definition math.hpp:462
typename detail::to_complex_s< T >::type to_complex
Obtain the type which adds the complex of complex/scalar type or the template parameter of class by a...
Definition math.hpp:345
constexpr int64 ceildiv(int64 num, int64 den)
Performs integer division with rounding up.
Definition math.hpp:613
std::size_t size_type
Integral type used for allocation quantities.
Definition types.hpp:92
constexpr T min(const T &x, const T &y)
Returns the smaller of the arguments.
Definition math.hpp:863
detail::temporary_clone< detail::pointee< Ptr > > make_temporary_clone(std::shared_ptr< const Executor > exec, Ptr &&ptr)
Creates a temporary_clone.
Definition temporary_clone.hpp:179
A type representing the dimensions of a multidimensional object.
Definition dim.hpp:27
This structure is used as an intermediate data type to store a sparse matrix.
Definition matrix_data.hpp:127
A span is a lightweight structure used to create sub-ranges from other ranges.
Definition range.hpp:47