Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt to rmm logger changes #2513

Merged
merged 6 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ target_include_directories(
)

# Keep RAFT as lightweight as possible. Only CUDA libs and rmm should be used in global target.
target_link_libraries(raft INTERFACE rmm::rmm cuco::cuco nvidia::cutlass::cutlass CCCL::CCCL)
target_link_libraries(
raft INTERFACE rmm::rmm rmm::rmm_logger spdlog::spdlog_header_only cuco::cuco
nvidia::cutlass::cutlass CCCL::CCCL
)

target_compile_features(raft INTERFACE cxx_std_17 $<BUILD_INTERFACE:cuda_std_17>)
target_compile_options(
Expand Down Expand Up @@ -288,8 +291,10 @@ if(RAFT_COMPILE_LIBRARY)
"$<$<COMPILE_LANGUAGE:CUDA>:${RAFT_CUDA_FLAGS}>"
)

add_library(raft_lib SHARED $<TARGET_OBJECTS:raft_objs>)
add_library(raft_lib_static STATIC $<TARGET_OBJECTS:raft_objs>)
# Make sure not to add the rmm logger twice since it will be brought in as an interface source by
# the rmm::rmm_logger_impl target.
add_library(raft_lib SHARED $<FILTER:$<TARGET_OBJECTS:raft_objs>,EXCLUDE,rmm.*logger>)
add_library(raft_lib_static STATIC $<FILTER:$<TARGET_OBJECTS:raft_objs>,EXCLUDE,rmm.*logger>)

set_target_properties(
raft_lib raft_lib_static
Expand All @@ -313,6 +318,8 @@ if(RAFT_COMPILE_LIBRARY)
# ensure CUDA symbols aren't relocated to the middle of the debug build binaries
target_link_options(${target} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/fatbin.ld")
endforeach()
target_link_libraries(raft_lib PRIVATE rmm::rmm_logger_impl)
target_link_libraries(raft_lib_static PRIVATE rmm::rmm_logger_impl)
endif()

if(TARGET raft_lib AND (NOT TARGET raft::raft_lib))
Expand Down
4 changes: 4 additions & 0 deletions cpp/bench/prims/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function(ConfigureBench)
PRIVATE raft::raft
raft_internal
$<$<BOOL:${ConfigureBench_LIB}>:raft::compiled>
$<$<NOT:$<BOOL:${ConfigureBench_LIB}>>:bench_rmm_logger>
${RAFT_CTK_MATH_DEPENDENCIES}
benchmark::benchmark
Threads::Threads
Expand Down Expand Up @@ -73,6 +74,9 @@ function(ConfigureBench)

endfunction()

add_library(bench_rmm_logger OBJECT)
target_link_libraries(bench_rmm_logger PRIVATE rmm::rmm_logger_impl)

if(BUILD_PRIMS_BENCH)
ConfigureBench(NAME CORE_BENCH PATH core/bitset.cu core/copy.cu main.cpp)

Expand Down
6 changes: 3 additions & 3 deletions cpp/cmake/thirdparty/get_spdlog.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
function(find_and_configure_spdlog)

include(${rapids-cmake-dir}/cpm/spdlog.cmake)
rapids_cpm_spdlog(FMT_OPTION "EXTERNAL_FMT_HO" INSTALL_EXPORT_SET rmm-exports)
rapids_export_package(BUILD spdlog rmm-exports)
rapids_cpm_spdlog(FMT_OPTION "EXTERNAL_FMT_HO" INSTALL_EXPORT_SET raft-exports)
rapids_export_package(BUILD spdlog raft-exports)

endfunction()

find_and_configure_spdlog()
find_and_configure_spdlog()
Loading