Skip to content

Commit

Permalink
Test nvcc log per source file in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ahendriksen committed Mar 21, 2023
1 parent 9acd1d0 commit 2aec639
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
15 changes: 15 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,21 @@ if(RAFT_COMPILE_LIBRARY)
# ensure CUDA symbols aren't relocated to the middle of the debug build binaries
target_link_options(raft_lib PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/fatbin.ld")

# For each source file in raft_lib generate a CSV file in cpp/build with filename
# nvcc_log_[...].csv if(CUDA_LOG_COMPILE_TIME)
get_target_property(sources raft_lib SOURCES)
foreach(source IN LISTS sources)
cmake_path(IS_ABSOLUTE source is_abs)
if(is_abs)
cmake_path(
RELATIVE_PATH source BASE_DIRECTORY ${PROJECT_SOURCE_DIR}
) # convert to relative path if not already one
endif()
string(MAKE_C_IDENTIFIER "nvcc_log_${source}" filename) # convert to valid filename
set_source_files_properties(${source} PROPERTIES COMPILE_FLAGS "--time=${filename}.csv")
endforeach()
# endif()

endif()

if(TARGET raft_lib AND (NOT TARGET raft::raft_lib))
Expand Down
4 changes: 0 additions & 4 deletions cpp/cmake/modules/ConfigureCUDA.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ if(CMAKE_COMPILER_IS_GNUCXX)
list(APPEND RAFT_CXX_FLAGS -Wall -Werror -Wno-unknown-pragmas -Wno-error=deprecated-declarations)
endif()

if(CUDA_LOG_COMPILE_TIME)
list(APPEND RAFT_CUDA_FLAGS "--time=nvcc_compile_log.csv")
endif()

list(APPEND RAFT_CUDA_FLAGS --expt-extended-lambda --expt-relaxed-constexpr)
list(APPEND RAFT_CXX_FLAGS "-DCUDA_API_PER_THREAD_DEFAULT_STREAM")
list(APPEND RAFT_CUDA_FLAGS "-DCUDA_API_PER_THREAD_DEFAULT_STREAM")
Expand Down

0 comments on commit 2aec639

Please sign in to comment.