This repository has been archived by the owner on Mar 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 446
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update how RDC settings are applied to Catch2 utilities.
- Loading branch information
1 parent
1fdce39
commit ab1c756
Showing
2 changed files
with
8 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,14 +18,6 @@ CPMAddPackage("gh:brunocodutra/[email protected]") | |
|
||
find_package(CUDAToolkit REQUIRED) | ||
|
||
# Some tests always build with RDC, so make sure that the sm_XX flags are | ||
# compatible. See note in CubCudaConfig.cmake. | ||
# TODO once we're using CUDA_ARCHITECTURES, we can setup non-rdc fallback | ||
# tests to build for non-rdc arches. But for now, all files in a given directory | ||
# must build with the same `CMAKE_CUDA_FLAGS` due to CMake constraints around | ||
# how CUDA_FLAGS works. | ||
set(CMAKE_CUDA_FLAGS "${CUB_CUDA_FLAGS_BASE} ${CUB_CUDA_FLAGS_RDC}") | ||
|
||
# The function below reads the filepath `src`, extracts the %PARAM% comments, | ||
# and fills `labels_var` with a list of `label1_value1.label2_value2...` | ||
# strings, and puts the corresponding `DEFINITION=value1:DEFINITION=value2` | ||
|
@@ -144,6 +136,11 @@ function(cub_add_test target_name_var test_name test_src cub_target) | |
set(config_meta_target ${config_prefix}.tests) | ||
|
||
if (is_catch2_test) | ||
set(use_rdc_for_catch2_utils OFF) | ||
if (CUB_ENABLE_RDC_TESTS OR CUB_FORCE_RDC) | ||
set(use_rdc_for_catch2_utils ON) | ||
endif() | ||
|
||
# Per config helper library: | ||
set(config_c2h_target ${config_prefix}.test.catch2_helper) | ||
if (NOT TARGET ${config_c2h_target}) | ||
|
@@ -162,15 +159,12 @@ function(cub_add_test target_name_var test_name test_src cub_target) | |
) | ||
|
||
cub_clone_target_properties(${config_c2h_target} ${cub_target}) | ||
cub_configure_cuda_target(${config_c2h_target} RDC ${use_rdc_for_catch2_utils}) | ||
target_link_libraries(${config_c2h_target} PRIVATE CUDA::curand ${cub_target}) | ||
|
||
if (CUB_IN_THRUST) | ||
thrust_fix_clang_nvcc_build_for(${config_c2h_target}) | ||
endif() | ||
|
||
if (CUB_ENABLE_TESTS_WITH_RDC) | ||
cub_enable_rdc_for_cuda_target(${config_c2h_target}) | ||
endif() | ||
endif() # config_c2h_target | ||
|
||
if (CUB_SEPARATE_CATCH2) | ||
|
@@ -191,6 +185,7 @@ function(cub_add_test target_name_var test_name test_src cub_target) | |
Catch2::Catch2 | ||
) | ||
cub_clone_target_properties(${config_c2run_target} ${cub_target}) | ||
cub_configure_cuda_target(${config_c2run_target} RDC ${use_rdc_for_catch2_utils}) | ||
add_dependencies(${config_meta_target} ${config_c2run_target}) | ||
target_include_directories(${config_c2run_target} PRIVATE | ||
"${CUB_SOURCE_DIR}/test" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters