From fda475d5bf1eb299ac76a0425881a246016e9326 Mon Sep 17 00:00:00 2001 From: Thomas Gibson Date: Wed, 4 Jan 2023 19:42:47 -0600 Subject: [PATCH] Rework Thrust CMake options --- CMake/VTKmDeviceAdapters.cmake | 10 +++------- CMakeLists.txt | 6 +++++- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CMake/VTKmDeviceAdapters.cmake b/CMake/VTKmDeviceAdapters.cmake index 8c66b055e..fb13d0bf8 100644 --- a/CMake/VTKmDeviceAdapters.cmake +++ b/CMake/VTKmDeviceAdapters.cmake @@ -359,14 +359,10 @@ if(VTKm_ENABLE_KOKKOS AND NOT TARGET vtkm_kokkos) install(TARGETS vtkm_kokkos_hip EXPORT ${VTKm_EXPORT_NAME}) # Make sure rocthrust is available if requested - # If it is not available, warn the user and continue with thrust disabled - if(${VTKm_ENABLE_KOKKOS_THRUST}) + if(VTKm_ENABLE_KOKKOS_THRUST) find_package(rocthrust) - if(${rocthrust_FOUND}) - message(STATUS "Kokkos HIP enabled with rocthrust support") - else() - set(VTKm_ENABLE_KOKKOS_THRUST OFF CACHE BOOL "Enable thrust within Kokkos algorithms" FORCE) - message(WARNING "Kokkos HIP enabled, but rocthrust not found. Install rocthrust for improved performance.") + if(NOT rocthrust_FOUND) + message(FATAL_ERROR "rocthrust not found. Please set VTKm_ENABLE_KOKKOS_THRUST to OFF.") endif() endif() endif() diff --git a/CMakeLists.txt b/CMakeLists.txt index ebfe20d8d..d043d8ec2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,7 +90,6 @@ endmacro () # Configurable Options vtkm_option(VTKm_ENABLE_CUDA "Enable Cuda support" OFF) vtkm_option(VTKm_ENABLE_KOKKOS "Enable Kokkos support" OFF) -vtkm_option(VTKm_ENABLE_KOKKOS_THRUST "Enable Kokkos thrust support (only valid with CUDA and HIP)" ON) vtkm_option(VTKm_ENABLE_OPENMP "Enable OpenMP support" OFF) vtkm_option(VTKm_ENABLE_TBB "Enable TBB support" OFF) vtkm_option(VTKm_ENABLE_RENDERING "Enable rendering library" ON) @@ -113,6 +112,11 @@ cmake_dependent_option(VTKm_ENABLE_TESTING_LIBRARY "Enable VTKm Testing Library" OFF "NOT VTKm_ENABLE_TESTING;NOT VTKm_ENABLE_BENCHMARKS" ON) mark_as_advanced(VTKm_ENABLE_TESTING_LIBRARY) +# By default: Set VTKm_ENABLE_KOKKOS_THRUST to ON if VTKm_ENABLE_KOKKOS is ON, otherwise +# disable it (or if the user explicitly turns this option OFF) +cmake_dependent_option(VTKm_ENABLE_KOKKOS_THRUST "Enable Kokkos thrust support (only valid with CUDA and HIP)" + ON "VTKm_ENABLE_KOKKOS" OFF) + # We may want to make finer controls on whether libraries/modules get built. # VTK uses the concept of groups for its modules vtkm_option(VTKm_BUILD_ALL_LIBRARIES