Skip to content

Commit

Permalink
kokkos,cmake: toggle building kokkosview example
Browse files Browse the repository at this point in the history
  • Loading branch information
vicentebolea committed Feb 21, 2023
1 parent a9ad351 commit bf256c7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ add_subdirectory(plugins)
#------------------------------------------------------------------------------#
option(ADIOS2_BUILD_EXAMPLES "Build examples" ON)
option(ADIOS2_BUILD_EXAMPLES_EXPERIMENTAL "Build experimental examples" OFF)

cmake_dependent_option(ADIOS2_BUILD_EXAMPLE_KOKKOSVIEW
"Build KokkosView example" ON "ADIOS2_HAVE_Kokkos" OFF)

if(ADIOS2_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
Expand Down
7 changes: 1 addition & 6 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ if(ADIOS2_HAVE_CUDA OR ADIOS2_HAVE_Kokkos_CUDA)
add_subdirectory(cuda)
endif()

if(ADIOS2_HAVE_Kokkos)
if(ADIOS2_BUILD_EXAMPLE_KOKKOSVIEW)
add_subdirectory(kokkos)
elseif(ADIOS2_HAVE_CUDA)
find_package(Kokkos QUIET)
if(Kokkos_FOUND)
add_subdirectory(kokkos)
endif()
endif()
4 changes: 4 additions & 0 deletions examples/kokkos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
# accompanying file Copyright.txt for details.
#------------------------------------------------------------------------------#

if(NOT Kokkos_FOUND)
find_package(Kokkos REQUIRED)
endif()

add_executable(KokkosWriteRead kokkosWriteRead.cpp)
target_link_libraries(KokkosWriteRead PUBLIC adios2::cxx11 Kokkos::kokkos)

Expand Down

0 comments on commit bf256c7

Please sign in to comment.