Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples,hip: use find_package(hip) once in proj #3896

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions examples/hello/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ add_subdirectory(bpStepsWriteRead)
if(ADIOS2_HAVE_CUDA OR ADIOS2_HAVE_Kokkos_CUDA)
add_subdirectory(bpStepsWriteReadCuda)
endif()
find_package(hip QUIET)
if(ADIOS2_HAVE_Kokkos_HIP OR hip_FOUND)
if(ADIOS2_HAVE_Kokkos_HIP)
add_subdirectory(bpStepsWriteReadHip)
endif()
if(ADIOS2_HAVE_Kokkos)
Expand Down
22 changes: 9 additions & 13 deletions examples/hello/bpStepsWriteReadHip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,15 @@ cmake_minimum_required(VERSION 3.12)
project(ADIOS2HelloBPStepsWriteReadHipExample)

if(NOT TARGET adios2_core)
set(_components CXX)
find_package(ADIOS2 REQUIRED COMPONENTS CXX)
endif()

find_package(hip QUIET)
if(hip_FOUND)
enable_language(HIP)
endif()
enable_language(HIP)

find_package(ADIOS2 REQUIRED COMPONENTS ${_components})
endif()
# Needed for the hip cmake targets
find_package(hip REQUIRED)
vicentebolea marked this conversation as resolved.
Show resolved Hide resolved

if(ADIOS2_HAVE_Kokkos_HIP OR hip_FOUND)
add_executable(adios2_hello_bpStepsWriteReadHip bpStepsWriteReadHip.cpp)
target_link_libraries(adios2_hello_bpStepsWriteReadHip adios2::cxx11 hip::device)
set_source_files_properties(bpStepsWriteReadHip.cpp PROPERTIES LANGUAGE HIP)
install(TARGETS adios2_hello_bpStepsWriteReadHip RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endif()
add_executable(adios2_hello_bpStepsWriteReadHip bpStepsWriteReadHip.cpp)
target_link_libraries(adios2_hello_bpStepsWriteReadHip adios2::cxx11 hip::device)
set_source_files_properties(bpStepsWriteReadHip.cpp PROPERTIES LANGUAGE HIP)
install(TARGETS adios2_hello_bpStepsWriteReadHip RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
Loading