-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding DualView examples for constexpr (17) and the copy constructor.…
… WIP on the view with two meshes
- Loading branch information
1 parent
3c7394d
commit 9d55398
Showing
5 changed files
with
333 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
project(mesh_prototype) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
find_package(MPI REQUIRED) | ||
find_package(Kokkos REQUIRED) | ||
find_package(CUDA REQUIRED) | ||
|
||
add_executable(mesh_DV_constexpr mesh_DV_constexpr.cc) | ||
target_link_libraries(mesh_DV_constexpr PUBLIC Kokkos::kokkoscore) | ||
|
||
add_executable(mesh_DV_layer mesh_DV_layer.cc) | ||
target_link_libraries(mesh_DV_layer PUBLIC Kokkos::kokkoscore) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
template<typename Data, typename ExecutionSpace = Kokkos::DefaultExecutionSpace> | ||
struct CSR; | ||
|
||
|
||
// | ||
// Note, this API is consistent with amanzi/ecoon/mesh_refactor src/mesh/MeshCache.hh API. | ||
// | ||
// If it helped, these could be dual views? | ||
// | ||
template<typename ExecutionSpace = Kokkos::DefaultExecutionSpace> | ||
struct MeshCache { | ||
|
||
using Double_View = Kokkos::View<double*, ExecutionSpace>; // ????? | ||
using cDouble_View = Kokkos::View<const double*, ExecutionSpace>; // ????? | ||
using Entity_ID_View = Kokkos::View<Entity_ID*, ExecutionSpace>; | ||
using cEntity_ID_View = Kokkos::View<const Entity_ID*, ExecutionSpace>; | ||
|
||
MeshCache(Teuchos::RCP<MeshFramework>& mf); // note, feel free to make shared_ptr or raw ptr for now... | ||
|
||
double getCellVolume(const Entity_ID c) const; | ||
Double_View cell_volumes; // note, this is public and can be used inside kernels directly | ||
// is there a const problem with exposing this directly? Specifically, | ||
// assume you have a const MeshCache. Can you still change | ||
// mc.cell_volumes(3) = 1? Should this be cDoubleView? | ||
|
||
std::size_t getCellNumFaces(const Entity_ID c) const; | ||
cEntity_ID_View getCellFaces(const Entity_ID c) const; | ||
Entity_ID getCellFace(Entity_ID c, std::size_t i) const; | ||
CRS<Entity_ID, ExecutionSpace> cell_faces; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.