mirror of
https://github.com/NVIDIA/nvbench.git
synced 2026-03-14 20:27:24 +00:00
- /W4 on MSVC - -Wall -Wextra + others on gcc/clang - New NVBench_ENABLE_WERROR option to toggle "warnings as errors" - Mark the nlohmann_json library as IMPORTED to switch to system includes - Rename nvbench_main -> nvbench.main to follow target name conventions - Explicitly suppress some cudafe warnings when compiling templates in nlohmann_json headers. - Explicitly suppress some warnings from Thrust headers. - Various fixes for warnings exposed by new flags. - Disable CUPTI on CTK < 11.3 (See #52).
51 lines
1.5 KiB
CMake
51 lines
1.5 KiB
CMake
set(example_srcs
|
|
axes.cu
|
|
enums.cu
|
|
exec_tag_sync.cu
|
|
exec_tag_timer.cu
|
|
skip.cu
|
|
throughput.cu
|
|
auto_throughput.cu
|
|
)
|
|
|
|
# Metatarget for all examples:
|
|
add_custom_target(nvbench.example.all)
|
|
add_dependencies(nvbench.all nvbench.example.all)
|
|
|
|
foreach(example_src IN LISTS example_srcs)
|
|
get_filename_component(example_name "${example_src}" NAME_WLE)
|
|
string(PREPEND example_name "nvbench.example.")
|
|
add_executable(${example_name} "${example_src}")
|
|
nvbench_config_target(${example_name})
|
|
target_include_directories(${example_name} PRIVATE "${CMAKE_CURRENT_LIST_DIR}")
|
|
target_link_libraries(${example_name} PRIVATE nvbench::main)
|
|
set_target_properties(${example_name} PROPERTIES COMPILE_FEATURES cuda_std_17)
|
|
add_test(NAME ${example_name}
|
|
COMMAND "$<TARGET_FILE:${example_name}>" --timeout 0.1
|
|
)
|
|
|
|
add_dependencies(nvbench.example.all ${example_name})
|
|
endforeach()
|
|
|
|
# Silence some warnings from old thrust headers:
|
|
set(thrust_examples
|
|
auto_throughput
|
|
axes
|
|
exec_tag_sync
|
|
exec_tag_timer
|
|
skip
|
|
throughput
|
|
)
|
|
foreach (example IN LISTS thrust_examples)
|
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
|
# C4324: structure was padded due to alignment specifier
|
|
nvbench_add_cxx_flag(nvbench.example.${example} PRIVATE "/wd4324")
|
|
|
|
# warning C4201: nonstandard extension used: nameless struct/union:
|
|
# Fixed in Thrust 1.12.0 (CTK 11.4, NV HPC 21.3)
|
|
if (${CUDAToolkit_VERSION} VERSION_LESS 11.4)
|
|
nvbench_add_cxx_flag(nvbench.example.${example} PRIVATE "/wd4201")
|
|
endif()
|
|
endif()
|
|
endforeach()
|