diff --git a/SetupBLT.cmake b/SetupBLT.cmake index 460c8d75c..c642a9ee5 100644 --- a/SetupBLT.cmake +++ b/SetupBLT.cmake @@ -80,6 +80,12 @@ if (NOT BLT_LOADED) cmake_policy(SET CMP0076 OLD) endif() + # Sets CUDA_ARCHITECTURES target property based on CMAKE_CUDA_ARCHITECTURES + # Policy added in 3.18+ + if(POLICY CMP0104) + cmake_policy(SET CMP0104 NEW) + endif() + ################################ # Invoke CMake Fortran setup # if ENABLE_FORTRAN == ON diff --git a/cmake/BLTMacros.cmake b/cmake/BLTMacros.cmake index 42d77c8fc..72f6928ce 100644 --- a/cmake/BLTMacros.cmake +++ b/cmake/BLTMacros.cmake @@ -254,7 +254,7 @@ macro(blt_add_target_link_flags) set(_flags ${arg_FLAGS}) # Convert rpath flag if linking with CUDA - if (CUDA_LINK_WITH_NVCC) + if (BLT_CUDA_LINK_WITH_NVCC) string(REPLACE "-Wl,-rpath," "-Xlinker -rpath -Xlinker " _flags "${_flags}") endif() @@ -361,7 +361,7 @@ macro(blt_register_library) mark_as_advanced(_BLT_${uppercase_name}_IS_OBJECT_LIBRARY) # PGI does not support -isystem - if( (${arg_TREAT_INCLUDES_AS_SYSTEM}) AND (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "PGI")) + if( (${arg_TREAT_INCLUDES_AS_SYSTEM}) AND (NOT ${C_COMPILER_FAMILY_IS_PGI})) set(_BLT_${uppercase_name}_TREAT_INCLUDES_AS_SYSTEM TRUE CACHE BOOL "" FORCE) else() set(_BLT_${uppercase_name}_TREAT_INCLUDES_AS_SYSTEM FALSE CACHE BOOL "" FORCE) @@ -480,7 +480,7 @@ macro(blt_patch_target) endif() # PGI does not support -isystem - if( (${arg_TREAT_INCLUDES_AS_SYSTEM}) AND (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "PGI")) + if( (${arg_TREAT_INCLUDES_AS_SYSTEM}) AND (NOT ${C_COMPILER_FAMILY_IS_PGI})) get_target_property(_target_includes ${arg_NAME} INTERFACE_INCLUDE_DIRECTORIES) # Don't copy if the target had no include directories if(_target_includes) @@ -1383,7 +1383,7 @@ macro(blt_export_tpl_targets) endif() set(_blt_tpl_targets) - blt_list_append(TO _blt_tpl_targets ELEMENTS cuda cuda_runtime IF ENABLE_CUDA) + blt_list_append(TO _blt_tpl_targets ELEMENTS blt_cuda blt_cuda_runtime IF ENABLE_CUDA) blt_list_append(TO _blt_tpl_targets ELEMENTS blt_hip blt_hip_runtime IF ENABLE_HIP) blt_list_append(TO _blt_tpl_targets ELEMENTS openmp IF ENABLE_OPENMP) blt_list_append(TO _blt_tpl_targets ELEMENTS mpi IF ENABLE_MPI) diff --git a/cmake/BLTOptions.cmake b/cmake/BLTOptions.cmake index ec4594537..a0e12923a 100644 --- a/cmake/BLTOptions.cmake +++ b/cmake/BLTOptions.cmake @@ -53,14 +53,17 @@ option(ENABLE_FORTRAN "Enables Fortran compiler support" ${_fortran_already option(ENABLE_MPI "Enables MPI support" OFF) option(ENABLE_OPENMP "Enables OpenMP compiler support" OFF) option(ENABLE_CUDA "Enable CUDA support" OFF) -cmake_dependent_option(ENABLE_CLANG_CUDA "Enable Clang's native CUDA support" OFF - "ENABLE_CUDA" OFF) -mark_as_advanced(ENABLE_CLANG_CUDA) -set(BLT_CLANG_CUDA_ARCH "sm_30" CACHE STRING "Compute architecture to use when generating CUDA code with Clang") -mark_as_advanced(BLT_CLANG_CUDA_ARCH) -option(ENABLE_HIP "Enable HIP support" OFF) + +option(ENABLE_HIP "Enable HIP support" OFF) set(CMAKE_HIP_ARCHITECTURES "gfx900" CACHE STRING "gfx architecture to use when generating HIP/ROCm code") +set(_link_with_nvcc OFF) +if (DEFINED CUDA_LINK_WITH_NVCC) + message(WARNING "CUDA_LINK_WITH_NVCC is deprecated and will eventually be removed.") + set(_link_with_nvcc ${CUDA_LINK_WITH_NVCC}) +endif() +option(BLT_CUDA_LINK_WITH_NVCC "Enable linking with NVCC" ${_link_with_nvcc}) + #------------------------------------------------------------------------------ # Test Options # diff --git a/cmake/BLTPrivateMacros.cmake b/cmake/BLTPrivateMacros.cmake index 5c980accd..c454accbc 100644 --- a/cmake/BLTPrivateMacros.cmake +++ b/cmake/BLTPrivateMacros.cmake @@ -255,10 +255,13 @@ macro(blt_inherit_target_info) blt_determine_scope(TARGET ${arg_TO} OUT _scope) - get_target_property(_interface_system_includes - ${arg_FROM} INTERFACE_SYSTEM_INCLUDE_DIRECTORIES) - if ( _interface_system_includes ) - target_include_directories(${arg_TO} SYSTEM ${_scope} ${_interface_system_includes}) + # PGI does not support -isystem + if(NOT ${C_COMPILER_FAMILY_IS_PGI}) + get_target_property(_interface_system_includes + ${arg_FROM} INTERFACE_SYSTEM_INCLUDE_DIRECTORIES) + if ( _interface_system_includes ) + target_include_directories(${arg_TO} SYSTEM ${_scope} ${_interface_system_includes}) + endif() endif() get_target_property(_interface_includes @@ -469,7 +472,7 @@ macro(blt_setup_target) # Check if a separate device link is needed if(ENABLE_CUDA AND "${_dep_type}" STREQUAL "OBJECT_LIBRARY") get_target_property(_device_link ${dependency} CUDA_RESOLVE_DEVICE_SYMBOLS) - if(_device_link AND CUDA_LINK_WITH_NVCC) + if(_device_link AND BLT_CUDA_LINK_WITH_NVCC) set(_dlink_obj "${dependency}_device_link${CMAKE_CUDA_OUTPUT_EXTENSION}") # Make sure a target wasn't already added get_source_file_property(_generated ${_dlink_obj} GENERATED) @@ -518,19 +521,22 @@ macro(blt_setup_cuda_target) endif() # Determine if cuda or cuda_runtime are in DEPENDS_ON - list(FIND arg_DEPENDS_ON "cuda" _cuda_index) + list(FIND arg_DEPENDS_ON "blt_cuda" _blt_cuda_index) + list(FIND arg_DEPENDS_ON "blt::cuda" _blt_cuda_alias_index) set(_depends_on_cuda FALSE) - if(${_cuda_index} GREATER -1) + if((${_blt_cuda_index} GREATER -1) OR (${_blt_cuda_alias_index} GREATER -1)) set(_depends_on_cuda TRUE) endif() - list(FIND arg_DEPENDS_ON "cuda_runtime" _cuda_runtime_index) + + list(FIND arg_DEPENDS_ON "blt_cuda" _blt_cuda_runtime_index) + list(FIND arg_DEPENDS_ON "blt::cuda" _blt_cuda_runtime_alias_index) set(_depends_on_cuda_runtime FALSE) - if(${_cuda_runtime_index} GREATER -1) + if((${_blt_cuda_runtime_index} GREATER -1) OR (${_blt_cuda_runtime_alias_index} GREATER -1)) set(_depends_on_cuda_runtime TRUE) endif() if (${_depends_on_cuda_runtime} OR ${_depends_on_cuda}) - if (CUDA_LINK_WITH_NVCC) + if (BLT_CUDA_LINK_WITH_NVCC) set_target_properties( ${arg_NAME} PROPERTIES LINKER_LANGUAGE CUDA) # This will be propagated up to executable targets that depend on this # library, which will need the HIP linker diff --git a/cmake/thirdparty/SetupCUDA.cmake b/cmake/thirdparty/SetupCUDA.cmake index 7dc73d224..acd6ffbaa 100644 --- a/cmake/thirdparty/SetupCUDA.cmake +++ b/cmake/thirdparty/SetupCUDA.cmake @@ -8,10 +8,10 @@ ################################ # Rare case of two flags being incompatible -if (DEFINED CMAKE_SKIP_BUILD_RPATH AND DEFINED CUDA_LINK_WITH_NVCC) - if (NOT CMAKE_SKIP_BUILD_RPATH AND CUDA_LINK_WITH_NVCC) +if (DEFINED CMAKE_SKIP_BUILD_RPATH AND DEFINED BLT_CUDA_LINK_WITH_NVCC) + if (NOT CMAKE_SKIP_BUILD_RPATH AND BLT_CUDA_LINK_WITH_NVCC) message( FATAL_ERROR - "CMAKE_SKIP_BUILD_RPATH (FALSE) and CUDA_LINK_WITH_NVCC (TRUE) " + "CMAKE_SKIP_BUILD_RPATH (FALSE) and BLT_CUDA_LINK_WITH_NVCC (TRUE) " "are incompatible when linking explicit shared libraries. Set " "CMAKE_SKIP_BUILD_RPATH to TRUE.") endif() @@ -53,7 +53,7 @@ else() endif() # Override rpath link flags for nvcc -if (CUDA_LINK_WITH_NVCC) +if (BLT_CUDA_LINK_WITH_NVCC) set(CMAKE_SHARED_LIBRARY_RUNTIME_CUDA_FLAG "-Xlinker -rpath -Xlinker " CACHE STRING "") set(CMAKE_SHARED_LIBRARY_RPATH_LINK_CUDA_FLAG "-Xlinker -rpath -Xlinker " CACHE STRING "") endif() @@ -62,10 +62,7 @@ endif() ############################################################ # Basics ############################################################ -# language check fails when using clang-cuda -if (NOT ENABLE_CLANG_CUDA) - enable_language(CUDA) -endif () +enable_language(CUDA) if(CMAKE_CUDA_STANDARD STREQUAL "17") if(NOT DEFINED CMAKE_CUDA_COMPILE_FEATURES OR (NOT "cuda_std_17" IN_LIST CMAKE_CUDA_COMPILE_FEATURES)) @@ -79,50 +76,27 @@ if(CMAKE_CUDA_STANDARD STREQUAL "20") endif() endif() -############################################################ -# Map Legacy FindCUDA variables to native cmake variables -############################################################ -# if we are linking with NVCC, define the link rule here -# Note that some mpi wrappers might have things like -Wl,-rpath defined, which when using -# FindMPI can break nvcc. In that case, you should set ENABLE_FIND_MPI to Off and control -# the link using CMAKE_CUDA_LINK_FLAGS. -Wl,-rpath, equivalent would be -Xlinker -rpath -Xlinker -if (CUDA_LINK_WITH_NVCC) - set(CMAKE_CUDA_LINK_EXECUTABLE - "${CMAKE_CUDA_COMPILER} -o ") - # do a no-op for the device links - for some reason the device link library dependencies are only a subset of the - # executable link dependencies so the device link fails if there are any missing CUDA library dependencies. Since - # we are doing a link with the nvcc compiler, the device link step is unnecessary . - # Frustratingly, nvcc-link errors out if you pass it an empty file, so we have to first compile the empty file. - set(CMAKE_CUDA_DEVICE_LINK_LIBRARY "touch .cu ; ${CMAKE_CUDA_COMPILER} -std=c++${CMAKE_CUDA_STANDARD} -dc .cu -o ") - set(CMAKE_CUDA_DEVICE_LINK_EXECUTABLE "touch .cu ; ${CMAKE_CUDA_COMPILER} -std=c++${CMAKE_CUDA_STANDARD} -dc .cu -o ") -endif() - -# If CUDA_TOOLKIT_ROOT_DIR is not set, it should be set by find_package(CUDA) -find_package(CUDA REQUIRED) -blt_assert_exists( DIRECTORIES ${CUDA_TOOLKIT_ROOT_DIR} ) +find_package(CUDAToolkit REQUIRED) # Append the path to the NVIDIA SDK to the link flags -if ( IS_DIRECTORY "${CUDA_TOOLKIT_ROOT_DIR}/lib64" ) - list(APPEND CMAKE_CUDA_LINK_FLAGS "-L${CUDA_TOOLKIT_ROOT_DIR}/lib64" ) -endif() -if ( IS_DIRECTORY "${CUDA_TOOLKIT_ROOT_DIR}/lib}" ) - list(APPEND CMAKE_CUDA_LINK_FLAGS "-L${CUDA_TOOLKIT_ROOT_DIR}/lib" ) +if(IS_DIRECTORY "${CUDAToolkit_LIBRARY_DIR}" ) + list(APPEND CMAKE_CUDA_LINK_FLAGS "-L${CUDAToolkit_LIBRARY_DIR}" ) endif() -message(STATUS "CUDA Version: ${CUDA_VERSION_STRING}") -message(STATUS "CUDA Toolkit Root Dir: ${CUDA_TOOLKIT_ROOT_DIR}") -message(STATUS "CUDA Compiler: ${CMAKE_CUDA_COMPILER}") +message(STATUS "CUDA Version: ${CUDAToolkit_VERSION}") +message(STATUS "CUDA Toolkit Bin Dir: ${CUDAToolkit_BIN_DIR}") +message(STATUS "CUDA Compiler: ${CUDAToolkit_NVCC_EXECUTABLE}") if( ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.9.0" ) message(STATUS "CUDA Host Compiler: ${CMAKE_CUDA_HOST_COMPILER}") else() message(STATUS "CUDA Host Compiler: ${CUDA_HOST_COMPILER}") endif() -message(STATUS "CUDA Include Path: ${CUDA_INCLUDE_DIRS}") -message(STATUS "CUDA Libraries: ${CUDA_LIBRARIES}") +message(STATUS "CUDA Architectures: ${CMAKE_CUDA_ARCHITECTURES}") +message(STATUS "CUDA Include Path: ${CUDAToolkit_INCLUDE_DIRS}") message(STATUS "CUDA Compile Flags: ${CMAKE_CUDA_FLAGS}") message(STATUS "CUDA Link Flags: ${CMAKE_CUDA_LINK_FLAGS}") message(STATUS "CUDA Separable Compilation: ${CUDA_SEPARABLE_COMPILATION}") -message(STATUS "CUDA Link with NVCC: ${CUDA_LINK_WITH_NVCC}") +message(STATUS "CUDA Link with NVCC: ${BLT_CUDA_LINK_WITH_NVCC}") message(STATUS "CUDA Implicit Link Libraries: ${CMAKE_CUDA_IMPLICIT_LINK_LIBRARIES}") message(STATUS "CUDA Implicit Link Directories: ${CMAKE_CUDA_IMPLICIT_LINK_DIRECTORIES}") @@ -142,33 +116,29 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "PGI") endif() -set(_cuda_compile_flags " ") -if (ENABLE_CLANG_CUDA) - set (_cuda_compile_flags -x cuda --cuda-gpu-arch=${BLT_CLANG_CUDA_ARCH} --cuda-path=${CUDA_TOOLKIT_ROOT_DIR}) - message(STATUS "Clang CUDA Enabled. CUDA compile flags added: ${_cuda_compile_flags}") -endif() +# cuda targets must be global for aliases when created as imported targets +set(_blt_cuda_is_global On) +if (${BLT_EXPORT_THIRDPARTY}) + set(_blt_cuda_is_global Off) +endif () -# depend on 'cuda', if you need to use cuda -# headers, link to cuda libs, and need to compile your -# source files with the cuda compiler (nvcc) instead of -# leaving it to the default source file language. -# This logic is handled in the blt_add_library/executable -# macros -blt_import_library(NAME cuda - COMPILE_FLAGS ${_cuda_compile_flags} - INCLUDES ${CUDA_INCLUDE_DIRS} - LIBRARIES ${CUDA_LIBRARIES} +blt_import_library(NAME blt_cuda LINK_FLAGS "${CMAKE_CUDA_LINK_FLAGS}" + TREAT_INCLUDES_AS_SYSTEM ON EXPORTABLE ${BLT_EXPORT_THIRDPARTY} - ) - -# same as 'cuda' but we don't flag your source files as -# CUDA language. This causes your source files to use -# the regular C/CXX compiler. This is separate from -# linking with nvcc. -# This logic is handled in the blt_add_library/executable -# macros -blt_import_library(NAME cuda_runtime - INCLUDES ${CUDA_INCLUDE_DIRS} - LIBRARIES ${CUDA_LIBRARIES} - EXPORTABLE ${BLT_EXPORT_THIRDPARTY}) + GLOBAL ${_blt_cuda_is_global}) + +# Hard-copy inheritable properties instead of depending on CUDA::cudart so that we can export all required +# information in our target blt_cuda +blt_inherit_target_info(TO blt_cuda FROM CUDA::cudart OBJECT FALSE) + +add_library(blt::cuda ALIAS blt_cuda) + +blt_import_library(NAME blt_cuda_runtime + TREAT_INCLUDES_AS_SYSTEM ON + EXPORTABLE ${BLT_EXPORT_THIRDPARTY} + GLOBAL ${_blt_cuda_is_global}) + +blt_inherit_target_info(TO blt_cuda_runtime FROM CUDA::cudart OBJECT FALSE) + +add_library(blt::cuda_runtime ALIAS blt_cuda_runtime) diff --git a/cmake/thirdparty/SetupMPI.cmake b/cmake/thirdparty/SetupMPI.cmake index b808a9fda..3d0b819fd 100644 --- a/cmake/thirdparty/SetupMPI.cmake +++ b/cmake/thirdparty/SetupMPI.cmake @@ -109,7 +109,7 @@ if (ENABLE_FIND_MPI) string(REPLACE " -pthread" ";-pthread" _mpi_link_flags "${_mpi_link_flags}") # Fixes for linking with NVCC - if (CUDA_LINK_WITH_NVCC) + if (BLT_CUDA_LINK_WITH_NVCC) # Convert rpath flag if linking with CUDA string(REPLACE "-Wl,-rpath," "-Xlinker -rpath -Xlinker " _mpi_link_flags "${_mpi_link_flags}") diff --git a/docs/api/target_properties.rst b/docs/api/target_properties.rst index 70af9464a..c0047c804 100644 --- a/docs/api/target_properties.rst +++ b/docs/api/target_properties.rst @@ -128,7 +128,7 @@ or with the corresponding :ref:`blt_add_executable` and :ref:`blt_add_library` m ``PRIVATE`` flags are used for the given target. ``INTERFACE`` flags are inherited by any target that depends on this target. ``PUBLIC`` flags are both ``INTERFACE`` and ``PRIVATE``. -If ``CUDA_LINK_WITH_NVCC`` is set to ``ON``, this macro will automatically +If ``BLT_CUDA_LINK_WITH_NVCC`` is set to ``ON``, this macro will automatically convert ``-Wl,-rpath,`` to :literal:`-Xlinker -rpath -Xlinker\ `. .. note:: diff --git a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_link_with_nvcc.cmake b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_link_with_nvcc.cmake index be9a065d6..a82bd22a8 100644 --- a/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_link_with_nvcc.cmake +++ b/host-configs/llnl/blueos_3_ppc64le_ib_p9/clang@upstream_link_with_nvcc.cmake @@ -67,7 +67,7 @@ set(_cuda_arch "sm_${CMAKE_CUDA_ARCHITECTURES}") set(CMAKE_CUDA_FLAGS "-restrict -arch ${_cuda_arch} --expt-extended-lambda -G" CACHE STRING "" ) set(CUDA_SEPARABLE_COMPILATION ON CACHE BOOL "" ) -set(CUDA_LINK_WITH_NVCC ON CACHE BOOL "") +set(BLT_CUDA_LINK_WITH_NVCC ON CACHE BOOL "") # nvcc does not like gtest's 'pthreads' flag set(gtest_disable_pthreads ON CACHE BOOL "") diff --git a/host-configs/llnl/blueos_3_ppc64le_ib_p9/pgi@20.4_nvcc.cmake b/host-configs/llnl/blueos_3_ppc64le_ib_p9/pgi@20.4_nvcc.cmake index 5750e57fc..346356dc7 100644 --- a/host-configs/llnl/blueos_3_ppc64le_ib_p9/pgi@20.4_nvcc.cmake +++ b/host-configs/llnl/blueos_3_ppc64le_ib_p9/pgi@20.4_nvcc.cmake @@ -6,20 +6,14 @@ #------------------------------------------------------------------------------ # Example host-config file for using PGI and CUDA #------------------------------------------------------------------------------ -set (CMAKE_CXX_COMPILER "/usr/tce/packages/pgi/pgi-20.4/bin/pgc++" CACHE PATH "") -set (CMAKE_C_COMPILER "/usr/tce/packages/pgi/pgi-20.4/bin/pgcc" CACHE PATH "") +set(CMAKE_CXX_COMPILER "/usr/tce/packages/pgi/pgi-20.4/bin/pgc++" CACHE PATH "") +set(CMAKE_C_COMPILER "/usr/tce/packages/pgi/pgi-20.4/bin/pgcc" CACHE PATH "") set(ENABLE_FORTRAN OFF CACHE BOOL "") set(ENABLE_MPI OFF CACHE BOOL "") set(ENABLE_OPENMP OFF CACHE BOOL "") set(ENABLE_CUDA ON CACHE BOOL "") - set(CUDA_TOOLKIT_ROOT_DIR "/usr/tce/packages/cuda/cuda-11.1.1" CACHE PATH "") -set(CMAKE_CUDA_COMPILER "${CUDA_TOOLKIT_ROOT_DIR}/bin/nvcc" CACHE PATH "") -set(CMAKE_CUDA_HOST_COMPILER ${CMAKE_CXX_COMPILER} CACHE PATH "") - -set(CUDA_SEPARABLE_COMPILATION ON CACHE BOOL "" ) - -set (_cuda_arch "sm_70") -set (CMAKE_CUDA_FLAGS "-restrict -arch ${_cuda_arch} -std=c++11 --expt-extended-lambda -G" CACHE STRING "" ) +set(CUDA_SEPARABLE_COMPILATION ON CACHE BOOL "") +set(CMAKE_CUDA_ARCHITECTURES "70" CACHE BOOL "") diff --git a/tests/internal/CMakeLists.txt b/tests/internal/CMakeLists.txt index 3bcacf7d2..f2a2c0bbc 100644 --- a/tests/internal/CMakeLists.txt +++ b/tests/internal/CMakeLists.txt @@ -243,7 +243,7 @@ if (ENABLE_CUDA AND ENABLE_MPI AND blt_add_executable( NAME test_cuda_mpi SOURCES src/test_cuda_mpi.cpp - DEPENDS_ON cuda mpi hwloc) + DEPENDS_ON blt::cuda mpi hwloc) # Tests on a 2^24 elements array. # It can go much bigger, but will not @@ -255,7 +255,7 @@ endif() message(STATUS "Exercising blt_print_target_properties macro on some targets and non-targets.") message(STATUS "") -foreach(_target gtest example t_example_smoke not-a-target blt_header_only mpi cuda cuda_runtime blt::hip blt::hip_runtime) +foreach(_target gtest example t_example_smoke not-a-target blt_header_only mpi blt::cuda blt::cuda_runtime blt::hip blt::hip_runtime) blt_print_target_properties(TARGET ${_target}) endforeach() @@ -414,7 +414,7 @@ endif() # create example depending on all available TPLs to test export set(_example_tpl_depends) -blt_list_append(TO _example_tpl_depends ELEMENTS cuda cuda_runtime IF ENABLE_CUDA) +blt_list_append(TO _example_tpl_depends ELEMENTS blt_cuda blt_cuda_runtime IF ENABLE_CUDA) blt_list_append(TO _example_tpl_depends ELEMENTS blt_hip blt_hip_runtime IF ENABLE_HIP) blt_list_append(TO _example_tpl_depends ELEMENTS openmp IF ENABLE_OPENMP) blt_list_append(TO _example_tpl_depends ELEMENTS mpi IF ENABLE_MPI) diff --git a/tests/internal/src/test_cuda_device_call_from_kernel/CMakeLists.txt b/tests/internal/src/test_cuda_device_call_from_kernel/CMakeLists.txt index 059fbaf43..19549ee9d 100644 --- a/tests/internal/src/test_cuda_device_call_from_kernel/CMakeLists.txt +++ b/tests/internal/src/test_cuda_device_call_from_kernel/CMakeLists.txt @@ -19,14 +19,14 @@ set(t_cuda_device_call_from_kernel_sources blt_add_library(NAME t_cuda_device_call_from_kernel_lib SOURCES ${t_cuda_device_call_from_kernel_sources} HEADERS ${t_cuda_device_call_from_kernel_headers} - DEPENDS_ON cuda) + DEPENDS_ON blt::cuda) set(t_cuda_device_call_from_kernel_exec_src CudaTests.cpp) blt_add_executable( NAME t_cuda_device_call_from_kernel_exec SOURCES ${t_cuda_device_call_from_kernel_exec_src} - DEPENDS_ON t_cuda_device_call_from_kernel_lib gtest cuda) + DEPENDS_ON t_cuda_device_call_from_kernel_lib gtest blt::cuda) blt_add_test(NAME t_cuda_device_call_from_kernel COMMAND t_cuda_device_call_from_kernel_exec) diff --git a/tests/smoke/CMakeLists.txt b/tests/smoke/CMakeLists.txt index 266461591..b6824b60f 100644 --- a/tests/smoke/CMakeLists.txt +++ b/tests/smoke/CMakeLists.txt @@ -128,7 +128,7 @@ if (ENABLE_CUDA) blt_add_executable(NAME blt_cuda_smoke SOURCES blt_cuda_smoke.cpp OUTPUT_DIR ${TEST_OUTPUT_DIRECTORY} - DEPENDS_ON cuda + DEPENDS_ON blt::cuda FOLDER blt/tests ) blt_add_test(NAME blt_cuda_smoke @@ -137,7 +137,7 @@ if (ENABLE_CUDA) blt_add_executable(NAME blt_cuda_runtime_smoke SOURCES blt_cuda_runtime_smoke.cpp OUTPUT_DIR ${TEST_OUTPUT_DIRECTORY} - DEPENDS_ON cuda_runtime + DEPENDS_ON blt::cuda_runtime FOLDER blt/tests ) blt_add_test(NAME blt_cuda_runtime_smoke @@ -146,7 +146,7 @@ if (ENABLE_CUDA) blt_add_executable(NAME blt_cuda_version_smoke SOURCES blt_cuda_version_smoke.cpp OUTPUT_DIR ${TEST_OUTPUT_DIRECTORY} - DEPENDS_ON cuda_runtime + DEPENDS_ON blt::cuda_runtime FOLDER blt/tests ) blt_add_test(NAME blt_cuda_version_smoke @@ -155,7 +155,7 @@ if (ENABLE_CUDA) blt_add_executable(NAME blt_cuda_openmp_smoke SOURCES blt_cuda_openmp_smoke.cpp OUTPUT_DIR ${TEST_OUTPUT_DIRECTORY} - DEPENDS_ON cuda openmp + DEPENDS_ON blt::cuda openmp FOLDER blt/tests ) blt_add_test(NAME blt_cuda_openmp_smoke @@ -166,7 +166,7 @@ if (ENABLE_CUDA) blt_add_executable(NAME blt_cuda_mpi_smoke SOURCES blt_cuda_mpi_smoke.cpp OUTPUT_DIR ${TEST_OUTPUT_DIRECTORY} - DEPENDS_ON cuda mpi + DEPENDS_ON blt::cuda mpi FOLDER blt/tests ) blt_add_test(NAME blt_cuda_mpi_smoke COMMAND blt_cuda_mpi_smoke @@ -177,7 +177,7 @@ if (ENABLE_CUDA) blt_add_executable(NAME blt_cuda_gtest_smoke SOURCES blt_cuda_gtest_smoke.cpp OUTPUT_DIR ${TEST_OUTPUT_DIRECTORY} - DEPENDS_ON cuda gtest + DEPENDS_ON blt::cuda gtest FOLDER blt/tests ) blt_add_test(NAME blt_cuda_gtest_smoke