Skip to content

Commit

Permalink
Merge pull request #118 from SCOREC/cws/fixCuda
Browse files Browse the repository at this point in the history
fix cuda build with kokkos disabled
  • Loading branch information
cwsmith authored Nov 5, 2024
2 parents 7c2ba19 + 956c46d commit 78c9873
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ add_library(Omega_h::omega_h ALIAS omega_h)
set_property(TARGET omega_h PROPERTY CXX_STANDARD "17")
set_property(TARGET omega_h PROPERTY CXX_STANDARD_REQUIRED ON)
set_property(TARGET omega_h PROPERTY CXX_EXTENSIONS OFF)
if (Omega_h_USE_CUDA)
set_property(TARGET omega_h PROPERTY CUDA_ARCHITECTURES ${Omega_h_CUDA_ARCH})
endif()

bob_library_includes(omega_h)

Expand Down
5 changes: 3 additions & 2 deletions src/Omega_h_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <Omega_h_memory.hpp>
#else
#include <Omega_h_shared_alloc.hpp>
#include <memory> //shared_ptr
#include <string>
#endif

Expand Down Expand Up @@ -136,7 +137,7 @@ class HostRead {
#if defined(OMEGA_H_USE_KOKKOS)
typename Kokkos::View<const T*, Kokkos::HostSpace> mirror_;
#elif defined(OMEGA_H_USE_CUDA)
std::shared_ptr<T> mirror_;
std::shared_ptr<T[]> mirror_;
#endif
public:
using value_type = T;
Expand All @@ -155,7 +156,7 @@ class HostWrite {
#ifdef OMEGA_H_USE_KOKKOS
typename View<T*>::HostMirror mirror_;
#elif defined(OMEGA_H_USE_CUDA)
std::shared_ptr<T> mirror_;
std::shared_ptr<T[]> mirror_;
#endif
public:
using value_type = T;
Expand Down

0 comments on commit 78c9873

Please sign in to comment.