-
Notifications
You must be signed in to change notification settings - Fork 0
Description
I added the different types of accessors as specified in: https://github.com/amanzi/mesh_cache_prototype/blob/master/base_class_example.hpp
Please complete this file with more details on the desired implementation.
I will do some tests to see if the creation of Kokkos::subview is slower than the access via getCellFace(i,j).
Example 1: DV and if constexpr, see mesh_DV_constexpr.cc
The default accessor is based on the type of the MeshCache. Host access needs to be specified in each calls.
Example of Device Access:
mesh_cache_prototype/mesh_DV_constexpr.cc
Line 156 in 9d55398
| if(mc.getCellVolume(i) != i) |
Example of Host Access:
mesh_cache_prototype/mesh_DV_constexpr.cc
Line 174 in 9d55398
| v_h = mc.getCellFaces<memory::host>(2); |
Example 2: DV and copy constructor, see mesh_DV_layer.cc
In this case the MeshCache is "copied" (which doesnt imply deep copy for the Kokkos::View) and the type of MeshCache can be changed when rquesting the Mesh. This is a first version and can be improved.
Example of Device MeshCache and access:
mesh_cache_prototype/mesh_DV_layer.cc
Line 164 in 9d55398
| MeshCache mc(&m); |
Example of Host MeshCache creation (from the Device MeshCache):
mesh_cache_prototype/mesh_DV_layer.cc
Line 183 in 9d55398
| MeshCache<host> mc_h(mc); |
This could be solved in the state when requesting the MeshCache with state->getMesh<host>().
Example 3: Multiple MeshCache with Kokkos::View (no DV), see mesh_V_dual.cc
WIP