monolish  0.14.0
MONOlithic LIner equation Solvers for Highly-parallel architecture
copy.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 namespace monolish {
4 namespace {
5 template <typename F1, typename F2> void copy_core(const F1 &x, F2 &y) {
6  Logger &logger = Logger::get_instance();
7  logger.util_in(monolish_func);
8 
9  const size_t xoffset = x.get_offset();
10  const size_t yoffset = y.get_offset();
11 
12  // err
13  assert(util::is_same_size(x, y));
14  assert(util::is_same_device_mem_stat(x, y));
15 
16  internal::vcopy(y.size(), x.data() + xoffset, y.data() + yoffset,
17  y.get_device_mem_stat());
18 
19  logger.util_out();
20 }
21 } // namespace
22 } // 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:358
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:431
monolish
Definition: monolish_matrix_blas.hpp:9
monolish::Logger::get_instance
static Logger & get_instance()
Definition: monolish_logger.hpp:42