monolish  0.14.2
MONOlithic LIner equation Solvers for Highly-parallel architecture
linearOperator_copy.cpp
Go to the documentation of this file.
1 #include "../../../../include/monolish_blas.hpp"
2 #include "../../../internal/monolish_internal.hpp"
3 
4 namespace monolish {
5 
6 namespace {
7 template <typename F>
8 void copy_core(const matrix::LinearOperator<F> &A,
9  matrix::LinearOperator<F> &C) {
10  Logger &logger = Logger::get_instance();
11  logger.util_in(monolish_func);
12 
13  // err
14  assert(util::is_same_size(A, C));
15  assert(util::is_same_device_mem_stat(A, C));
16 
17  if (A.get_matvec_init_flag()) {
18  C.set_matvec(A.get_matvec());
19  }
20  if (A.get_rmatvec_init_flag()) {
21  C.set_rmatvec(A.get_rmatvec());
22  }
23 
24  logger.util_out();
25 }
26 } // namespace
27 
28 namespace blas {
29 
32  copy_core(A, C);
33 }
36  copy_core(A, C);
37 }
38 
39 } // namespace blas
40 } // namespace monolish
monolish::util::is_same_size
bool is_same_size(const T &x, const U &y)
compare size of vector or 1Dview (same as is_same_structure())
Definition: monolish_common.hpp:377
monolish::matrix::LinearOperator
Linear Operator imitating Matrix.
Definition: monolish_coo.hpp:37
monolish_func
#define monolish_func
Definition: monolish_logger.hpp:9
monolish::util::is_same_device_mem_stat
bool is_same_device_mem_stat(const T &arg1, const U &arg2)
compare same device memory status
Definition: monolish_common.hpp:454
monolish::blas::copy
void copy(const matrix::Dense< double > &A, matrix::Dense< double > &C)
Dense matrix copy (C=A)
Definition: dense_copy.cpp:25
monolish
Definition: monolish_matrix_blas.hpp:10
monolish::Logger::get_instance
static Logger & get_instance()
Definition: monolish_logger.hpp:42