File tree Expand file tree Collapse file tree 5 files changed +19
-7
lines changed
Expand file tree Collapse file tree 5 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,10 @@ function(add_bench_dir bench_dir)
113113 add_bench (base_bench_target ${base_bench_name} "${bench_src} " )
114114 add_dependencies (${benches_meta_target} ${base_bench_target} )
115115 target_compile_definitions (${base_bench_target} PRIVATE TUNE_BASE=1 )
116- target_compile_options (${base_bench_target} PRIVATE "--extended-lambda" )
116+ target_compile_options (
117+ ${base_bench_target}
118+ PRIVATE "$<$<COMPILE_LANG_AND_ID :CUDA ,NVIDIA >:--extended -lambda >"
119+ )
117120
118121 if (CUB_ENABLE_TUNING)
119122 # tuning
@@ -131,7 +134,7 @@ function(add_bench_dir bench_dir)
131134 target_compile_options (
132135 ${bench_target}
133136 PRIVATE #
134- "--extended-lambda"
137+ "$<$< COMPILE_LANG_AND_ID : CUDA , NVIDIA >: --extended -lambda > "
135138 "-include${tuning_path} "
136139 )
137140 else ()
Original file line number Diff line number Diff line change @@ -56,7 +56,10 @@ function(add_bench_dir bench_dir)
5656
5757 add_bench (base_bench_target ${bench_name} "${bench_src} " )
5858 target_link_libraries (${bench_name} PRIVATE cudax.compiler_interface )
59- target_compile_options (${bench_name} PRIVATE "--extended-lambda" )
59+ target_compile_options (
60+ ${bench_name}
61+ PRIVATE "$<$<COMPILE_LANG_AND_ID :CUDA ,NVIDIA >:--extended -lambda >"
62+ )
6063 endforeach ()
6164endfunction ()
6265
Original file line number Diff line number Diff line change @@ -54,8 +54,8 @@ if (CMAKE_CUDA_COMPILER)
5454 target_compile_options (
5555 simple_stf
5656 PUBLIC
57- $<$<COMPILE_LANGUAGE :CUDA >:--expt -relaxed -constexpr >
58- $<$<COMPILE_LANGUAGE :CUDA >:--extended -lambda >
57+ $<$<COMPILE_LANG_AND_ID :CUDA , NVIDIA >:--expt -relaxed -constexpr >
58+ $<$<COMPILE_LANG_AND_ID :CUDA , NVIDIA >:--extended -lambda >
5959 )
6060endif ()
6161
Original file line number Diff line number Diff line change @@ -81,7 +81,10 @@ function(add_bench_dir bench_dir)
8181 add_bench (base_bench_target ${base_bench_name} "${bench_src} " )
8282 add_dependencies (${benches_meta_target} ${base_bench_target} )
8383 target_compile_definitions (${base_bench_target} PRIVATE TUNE_BASE=1 )
84- target_compile_options (${base_bench_target} PRIVATE "--extended-lambda" )
84+ target_compile_options (
85+ ${base_bench_target}
86+ PRIVATE "$<$<COMPILE_LANG_AND_ID :CUDA ,NVIDIA >:--extended -lambda >"
87+ )
8588 # benchmarking
8689 register_cccl_benchmark ("${bench_name} " "" )
8790 endforeach ()
Original file line number Diff line number Diff line change @@ -80,7 +80,10 @@ function(add_bench_dir bench_dir)
8080 target_link_libraries (${bench_name} PRIVATE ${thrust_target} )
8181
8282 if ("CUDA" STREQUAL "${config_device} " )
83- target_compile_options (${bench_name} PRIVATE "--extended-lambda" )
83+ target_compile_options (
84+ ${bench_name}
85+ PRIVATE "$<$<COMPILE_LANG_AND_ID :CUDA ,NVIDIA >:--extended -lambda >"
86+ )
8487 endif ()
8588 endforeach ()
8689 endforeach ()
You can’t perform that action at this time.
0 commit comments