monolish  0.14.0
MONOlithic LIner equation Solvers for Highly-parallel architecture
vecmax.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 namespace monolish {
4 namespace {
5 template <typename F1, typename F2, typename F3>
6 void vvmax_core(const F1 &a, const F2 &b, F3 &y) {
7  Logger &logger = Logger::get_instance();
8  logger.func_in(monolish_func);
9 
10  // err
11  assert(util::is_same_size(a, b, y));
12  assert(util::is_same_device_mem_stat(a, b, y));
13 
14  internal::vmax(y.size(), a.data() + a.get_offset(), b.data() + b.get_offset(),
15  y.data() + y.get_offset(), y.get_device_mem_stat());
16 
17  logger.func_out();
18 }
19 
20 template <typename F1, typename F2> F2 vmax_core(const F1 &y) {
21  Logger &logger = Logger::get_instance();
22  logger.func_in(monolish_func);
23 
24  F2 ret = internal::vmax(y.size(), y.data() + y.get_offset(),
25  y.get_device_mem_stat());
26 
27  logger.func_out();
28  return ret;
29 }
30 } // namespace
31 } // 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