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

Add CMake install rules for tests #969

Merged
merged 3 commits into from
Feb 7, 2022
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
8 changes: 7 additions & 1 deletion benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ function(ConfigureBench BENCH_NAME)
${BENCH_NAME}
PROPERTIES POSITION_INDEPENDENT_CODE ON
RUNTIME_OUTPUT_DIRECTORY "$<BUILD_INTERFACE:${RMM_BINARY_DIR}/gbenchmarks>"
CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES}")
CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES}"
robertmaynard marked this conversation as resolved.
Show resolved Hide resolved
robertmaynard marked this conversation as resolved.
Show resolved Hide resolved
INSTALL_RPATH "\$ORIGIN/../../../lib")
target_link_libraries(${BENCH_NAME} benchmark::benchmark pthread rmm)
target_compile_definitions(${BENCH_NAME}
PUBLIC "SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_${RMM_LOGGING_LEVEL}")
Expand All @@ -55,6 +56,11 @@ function(ConfigureBench BENCH_NAME)
PUBLIC $<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-declarations>)
endif()

install(
TARGETS ${BENCH_NAME}
COMPONENT testing
DESTINATION bin/benchmarks/librmm
EXCLUDE_FROM_ALL)
endfunction(ConfigureBench)

# random allocations benchmark
Expand Down
9 changes: 8 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ function(ConfigureTestInternal TEST_NAME)
${TEST_NAME}
PROPERTIES POSITION_INDEPENDENT_CODE ON
RUNTIME_OUTPUT_DIRECTORY "$<BUILD_INTERFACE:${RMM_BINARY_DIR}/gtests>"
CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES}")
CUDA_ARCHITECTURES "${CMAKE_CUDA_ARCHITECTURES}"
INSTALL_RPATH "\$ORIGIN/../../../lib")
target_compile_definitions(${TEST_NAME}
PUBLIC "SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_${RMM_LOGGING_LEVEL}")
if(DEFINED CUDA_MALLOC_ASYNC_SUPPORT AND NOT CUDA_MALLOC_ASYNC_SUPPORT)
Expand Down Expand Up @@ -71,6 +72,12 @@ function(ConfigureTestInternal TEST_NAME)
endif()

add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME})

install(
TARGETS ${TEST_NAME}
COMPONENT testing
DESTINATION bin/gtests/librmm
EXCLUDE_FROM_ALL)
endfunction()

# Wrapper around `ConfigureTestInternal` that builds tests both with and without per thread default
Expand Down