1 #include "../../../include/monolish_blas.hpp"
2 #include "../../../include/monolish_vml.hpp"
3 #include "../../internal/monolish_internal.hpp"
19 double *val = target.data();
20 if (get_device_mem_stat() ==
true && force_cpu ==
false) {
23 for (
size_t i = first; i < last; i++) {
24 printf(
"%f\n", val[i]);
27 throw std::runtime_error(
28 "error USE_GPU is false, but get_device_mem_stat() == true");
31 for (
size_t i = first; i < last; i++) {
32 printf(
"%f\n", val[i]);
40 bool force_cpu)
const {
44 double *val = target.val.data();
45 if (get_device_mem_stat() ==
true && force_cpu ==
false) {
48 for (
size_t i = first; i < last; i++) {
49 printf(
"%f\n", val[i]);
52 throw std::runtime_error(
53 "error USE_GPU is false, but get_device_mem_stat() == true");
56 for (
size_t i = first; i < last; i++) {
57 printf(
"%f\n", val[i]);
68 float *val = target.data();
69 if (get_device_mem_stat() ==
true && force_cpu ==
false) {
72 for (
size_t i = first; i < last; i++) {
73 printf(
"%f\n", val[i]);
76 throw std::runtime_error(
77 "error USE_GPU is false, but get_device_mem_stat() == true");
80 for (
size_t i = first; i < last; i++) {
81 printf(
"%f\n", val[i]);
89 bool force_cpu)
const {
93 float *val = target.val.data();
94 if (get_device_mem_stat() ==
true && force_cpu ==
false) {
97 for (
size_t i = first; i < last; i++) {
98 printf(
"%f\n", val[i]);
101 throw std::runtime_error(
102 "error USE_GPU is false, but get_device_mem_stat() == true");
105 for (
size_t i = first; i < last; i++) {
106 printf(
"%f\n", val[i]);