Commit 1b49fc4a authored by David M. Rogers's avatar David M. Rogers
Browse files

Added thrust libraries.

parent 2e1a1e2e
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -25,12 +25,24 @@ find_package(MPI REQUIRED)
if(CMAKE_CUDA_ARCHITECTURES)
    set(ENABLE_GPU TRUE)
    include(setup_cuda)

    find_package(Thrust REQUIRED CONFIG)
    thrust_create_target(Thrust HOST CPP DEVICE CUDA)
elseif(CMAKE_HIP_ARCHITECTURES)
    set(ENABLE_GPU TRUE)
    include(setup_hip)

    find_package(rocprim REQUIRED CONFIG)
    find_package(rocthrust REQUIRED CONFIG)
    # includes rocThrust headers and roc::rocprim_hip target
    add_library(Thrust INTERFACE)
    target_link_libraries(Thrust roc::rocthrust)
else()
    set(ENABLE_GPU FALSE)
    include(setup_cpu)

    find_package(Thrust REQUIRED CONFIG)
    thrust_create_target(Thrust HOST CPP DEVICE OMP)
endif()

##########  TARGETS  ################################################
@@ -46,7 +58,7 @@ runtime_link(mpitest)
configure_file(include/config.hh.in include/config.hh)

target_compile_features(mpiwrap PUBLIC cxx_std_17)
target_link_libraries(mpiwrap PUBLIC OpenMP::OpenMP_CXX MPI::MPI_CXX)
target_link_libraries(mpiwrap PUBLIC Thrust OpenMP::OpenMP_CXX MPI::MPI_CXX)
target_include_directories(mpiwrap PUBLIC
                            $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
                            $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>