XGCa
view_print.hpp
Go to the documentation of this file.
1 #ifndef VIEW_PRINT_HPP
2 #define VIEW_PRINT_HPP
3 #include "space_settings.hpp"
4 #include "globals.hpp"
5 
6 template<typename T>
7 void view_print(const T& view, std::string label, int stride=1){
8 
9  auto view_h = my_mirror_view(view, HostType());
10  mirror_copy(view_h, view);
11 
12  printf("\nView label: %s - %s\n", view.label().c_str(), label.c_str());
13  for(int i=0; i<view_h.extent(0); i+=stride){
14  printf(" (%d): %1.15e\n", i, view_h(i));
15  }
16  fflush(stdout);
17 }
18 
19 #endif
void mirror_copy(T1 &view_dest, const T2 &view_src)
Definition: my_mirror_view.hpp:122
View< T *, CLayout, Device > my_mirror_view(const View< T *, CLayout, Device > &view, Device nd)
Definition: my_mirror_view.hpp:14
Kokkos::Device< HostExSpace, HostMemSpace > HostType
Definition: space_settings.hpp:57
void view_print(const T &view, std::string label, int stride=1)
Definition: view_print.hpp:7