Skip to content

Commit

Permalink
Merge branch 'fix-test-fixtures' of github.com:harrism/cuspatial into…
Browse files Browse the repository at this point in the history
… fix-test-fixtures
  • Loading branch information
harrism committed Oct 17, 2024
2 parents 1e96184 + a687be7 commit 5488ac6
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 8 deletions.
3 changes: 1 addition & 2 deletions ci/build_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ rapids-print-env

export RAPIDS_VERSION="$(rapids-version)"
export RAPIDS_VERSION_MAJOR_MINOR="$(rapids-version-major-minor)"
export RAPIDS_VERSION_NUMBER="24.12"
export RAPIDS_DOCS_DIR="$(mktemp -d)"

rapids-logger "Build cuSpatial CPP docs"
Expand Down Expand Up @@ -54,4 +53,4 @@ mkdir -p "${RAPIDS_DOCS_DIR}/cuproj/html"
mv _html/* "${RAPIDS_DOCS_DIR}/cuproj/html"
popd

rapids-upload-docs
RAPIDS_VERSION_NUMBER="${RAPIDS_VERSION_MAJOR_MINOR}" rapids-upload-docs
1 change: 0 additions & 1 deletion ci/release/update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ echo "${NEXT_FULL_TAG}" > VERSION
for FILE in .github/workflows/*.yaml; do
sed_runner "/shared-workflows/ s/@.*/@branch-${NEXT_SHORT_TAG}/g" "${FILE}"
done
sed_runner "s/RAPIDS_VERSION_NUMBER=\".*/RAPIDS_VERSION_NUMBER=\"${NEXT_SHORT_TAG}\"/g" ci/build_docs.sh

DEPENDENCIES=(
pylibcudf
Expand Down
2 changes: 1 addition & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ set(CUSPATIAL_BUILD_TESTS ${BUILD_TESTS})
set(CUSPATIAL_BUILD_BENCHMARKS ${BUILD_BENCHMARKS})

set(CUSPATIAL_CXX_FLAGS "")
set(CUSPATIAL_CUDA_FLAGS "")
set(CUSPATIAL_CUDA_FLAGS --expt-extended-lambda --expt-relaxed-constexpr)
set(CUSPATIAL_CXX_DEFINITIONS "")
set(CUSPATIAL_CUDA_DEFINITIONS "")

Expand Down
6 changes: 5 additions & 1 deletion cpp/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ add_library(cuspatial_benchmark_common OBJECT

target_compile_features(cuspatial_benchmark_common PUBLIC cxx_std_17 cuda_std_17)

target_compile_options(cuspatial_benchmark_common PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:${CUSPATIAL_CXX_FLAGS}>"
"$<$<COMPILE_LANGUAGE:CUDA>:${CUSPATIAL_CUDA_FLAGS}>")

set_target_properties(cuspatial_benchmark_common
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$<BUILD_INTERFACE:${CUSPATIAL_BINARY_DIR}/benchmarks>"
INSTALL_RPATH "\$ORIGIN/../../../lib"
Expand All @@ -38,7 +41,8 @@ target_link_libraries(cuspatial_benchmark_common
PUBLIC benchmark::benchmark
cudf::cudftestutil
ranger::ranger
cuspatial)
cuspatial GTest::gtest GTest::gmock
PRIVATE cudf::cudftestutil_impl)

target_compile_options(cuspatial_benchmark_common
PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:${CUSPATIAL_CXX_FLAGS}>"
Expand Down
4 changes: 2 additions & 2 deletions cpp/cmake/thirdparty/get_cudf.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2021-2023, NVIDIA CORPORATION.
# Copyright (c) 2021-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,7 +27,7 @@ function(find_and_configure_cudf)
set(cudf_components "")

if(BUILD_TESTS OR BUILD_BENCHMARKS)
list(APPEND global_targets cudf::cudftestutil)
list(APPEND global_targets cudf::cudftestutil cudf::cudftestutil_impl)
set(cudf_components COMPONENTS testing)
endif()

Expand Down
28 changes: 27 additions & 1 deletion cpp/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,32 @@
###################################################################################################
# - compiler function -----------------------------------------------------------------------------

# cudftestutil_impl is an interface source library, this empty object
# library is used to speed-up compilation and linking against it,
# otherwise we pay the non-trivial compilation cost repeatedly for each
# test executable
add_library(cuspatial_test_common OBJECT test_common.cpp)

target_compile_features(cuspatial_test_common PUBLIC cxx_std_17 cuda_std_17)

set_target_properties(cuspatial_test_common
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$<BUILD_INTERFACE:${CUSPATIAL_BINARY_DIR}/tests>"
INSTALL_RPATH "\$ORIGIN/../../../lib"
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
CUDA_STANDARD 17
CUDA_STANDARD_REQUIRED ON
POSITION_INDEPENDENT_CODE ON
INTERFACE_POSITION_INDEPENDENT_CODE ON
)

target_link_libraries(cuspatial_test_common
PUBLIC cudf::cudftestutil GTest::gtest GTest::gmock
PRIVATE cudf::cudftestutil_impl)

target_compile_options(cuspatial_test_common PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:${CUSPATIAL_CXX_FLAGS}>"
"$<$<COMPILE_LANGUAGE:CUDA>:${CUSPATIAL_CUDA_FLAGS}>")

function(ConfigureTest CMAKE_TEST_NAME)
add_executable(${CMAKE_TEST_NAME} ${ARGN})
target_compile_options(${CMAKE_TEST_NAME}
Expand All @@ -34,7 +60,7 @@ function(ConfigureTest CMAKE_TEST_NAME)
CUDA_STANDARD 17
CUDA_STANDARD_REQUIRED ON
)
target_link_libraries(${CMAKE_TEST_NAME} GTest::gtest_main GTest::gmock_main ranger::ranger cudf::cudftestutil cuspatial)
target_link_libraries(${CMAKE_TEST_NAME} GTest::gtest_main GTest::gmock_main ranger::ranger cudf::cudftestutil cuspatial cuspatial_test_common)
add_test(NAME ${CMAKE_TEST_NAME} COMMAND ${CMAKE_TEST_NAME})
install(
TARGETS ${CMAKE_TEST_NAME}
Expand Down
15 changes: 15 additions & 0 deletions cpp/tests/test_common.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright (c) 2024, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

0 comments on commit 5488ac6

Please sign in to comment.