Skip to content

Commit

Permalink
added extended lambda flag to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DiamonDinoia committed Aug 28, 2024
1 parent d29cbba commit 71ad464
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions perftest/cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ add_executable(cuperftest cuperftest.cu)
target_include_directories(cuperftest PUBLIC ${CUFINUFFT_INCLUDE_DIRS})
target_link_libraries(cuperftest PUBLIC cufinufft)
target_compile_features(cuperftest PRIVATE cxx_std_17)
target_compile_options(cuperftest
PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
set_target_properties(
cuperftest
PROPERTIES LINKER_LANGUAGE CUDA
Expand Down
7 changes: 5 additions & 2 deletions src/cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ set(FINUFFT_CUDA_FLAGS
-fmad=true
-restrict
--extra-device-vectorization
# $<$<CONFIG:Debug>:-G -maxrregcount 64 >
$<$<CONFIG:Debug>:-G
-maxrregcount
64
>
>)

add_library(cufinufft_common_objects OBJECT ${PRECISION_INDEPENDENT_SRC})
Expand Down Expand Up @@ -81,7 +84,7 @@ set_target_properties(
CUDA_STANDARD_REQUIRED ON
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
target_compile_features(cufinufft PRIVATE cxx_std_17)
target_compile_options(cufinufft PUBLIC ${FINUFFT_CUDA_FLAGS})
target_compile_options(cufinufft PRIVATE ${FINUFFT_CUDA_FLAGS})
if(WIN32)
target_link_libraries(cufinufft PUBLIC CUDA::cudart CUDA::cufft
CUDA::nvToolsExt)
Expand Down
6 changes: 4 additions & 2 deletions test/cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ foreach(srcfile ${test_src})
get_filename_component(executable ${executable} NAME)
add_executable(${executable} ${srcfile})
target_include_directories(${executable} PUBLIC ${CUFINUFFT_INCLUDE_DIRS})
target_compile_options(${executable}
PUBLIC $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
find_library(MathLib m)
if(MathLib)
target_link_libraries(${executable} PUBLIC cufinufft ${MathLib})
endif()
target_compile_features(${executable} PUBLIC cxx_std_17)
set_target_properties(
${executable} PROPERTIES LINKER_LANGUAGE CUDA CUDA_ARCHITECTURES
"${FINUFFT_CUDA_ARCHITECTURES}")
${executable} PROPERTIES LINKER_LANGUAGE CUDA
CUDA_ARCHITECTURES "${FINUFFT_CUDA_ARCHITECTURES}")
message(STATUS "Adding test ${executable}"
" with CUDA_ARCHITECTURES=${FINUFFT_CUDA_ARCHITECTURES}"
" and INCLUDE=${CUFINUFFT_INCLUDE_DIRS}")
Expand Down

0 comments on commit 71ad464

Please sign in to comment.