diff --git a/ci/test_cpp.sh b/ci/test_cpp.sh index 846b90c78e5..545ea386d53 100755 --- a/ci/test_cpp.sh +++ b/ci/test_cpp.sh @@ -7,27 +7,13 @@ EXITCODE=0 trap "EXITCODE=1" ERR set +e -# Get library for finding incorrect default stream usage. -STREAM_IDENTIFY_LIB_MODE_CUDF="${CONDA_PREFIX}/lib/libcudf_identify_stream_usage_mode_cudf.so" -STREAM_IDENTIFY_LIB_MODE_TESTING="${CONDA_PREFIX}/lib/libcudf_identify_stream_usage_mode_testing.so" - -echo "STREAM_IDENTIFY_LIB=${STREAM_IDENTIFY_LIB_MODE_CUDF}" - # Run libcudf and libcudf_kafka gtests from libcudf-tests package rapids-logger "Run gtests" cd $CONDA_PREFIX/bin/gtests/libcudf/ -export GTEST_CUDF_STREAM_MODE="new_cudf_default" export GTEST_OUTPUT=xml:${RAPIDS_TESTS_DIR}/ -export LD_PRELOAD=${STREAM_IDENTIFY_LIB_MODE_CUDF} - -ctest -E SPAN_TEST -j20 --output-on-failure -# This one test is specifically designed to test using a thrust device vector, -# so we expect and allow it to include default stream usage. -_allowlist_filter="SpanTest.CanConstructFromDeviceContainers" -GTEST_FILTER="-${_allowlist_filter}" ctest -R SPAN_TEST -VV -LD_PRELOAD= GTEST_CUDF_STREAM_MODE=default GTEST_FILTER="${_allowlist_filter}" ctest -R SPAN_TEST -VV +ctest -j20 --output-on-failure SUITEERROR=$? diff --git a/cpp/tests/CMakeLists.txt b/cpp/tests/CMakeLists.txt index 097fe8a0ca3..2178e9fe52b 100644 --- a/cpp/tests/CMakeLists.txt +++ b/cpp/tests/CMakeLists.txt @@ -24,7 +24,7 @@ rapids_test_init() # properties and linking to build the test function(ConfigureTest CMAKE_TEST_NAME) set(options) - set(one_value GPUS PERCENT) + set(one_value GPUS PERCENT STREAM_MODE) set(multi_value) cmake_parse_arguments(_CUDF_TEST "${options}" "${one_value}" "${multi_value}" ${ARGN}) if(NOT DEFINED _CUDF_TEST_GPUS AND NOT DEFINED _CUDF_TEST_PERCENT) @@ -37,6 +37,9 @@ function(ConfigureTest CMAKE_TEST_NAME) if(NOT DEFINED _CUDF_TEST_PERCENT) set(_CUDF_TEST_PERCENT 100) endif() + if(NOT DEFINED _CUDF_TEST_STREAM_MODE) + set(_CUDF_TEST_STREAM_MODE cudf) + endif() add_executable(${CMAKE_TEST_NAME} ${_CUDF_TEST_UNPARSED_ARGUMENTS}) set_target_properties( @@ -62,6 +65,13 @@ function(ConfigureTest CMAKE_TEST_NAME) PERCENT ${_CUDF_TEST_PERCENT} INSTALL_COMPONENT_SET testing ) + + set_tests_properties( + ${CMAKE_TEST_NAME} + PROPERTIES + ENVIRONMENT + "GTEST_CUDF_STREAM_MODE=new_${_CUDF_TEST_STREAM_MODE}_default;LD_PRELOAD=$" + ) endfunction() # ################################################################################################## @@ -349,7 +359,25 @@ ConfigureTest( # ################################################################################################## # * span tests ------------------------------------------------------------------------------- + +# This test must be split into two executables so that one can use the preload library and one does +# not. The one that doesn't includes a thrust::device_vector copy, which is always synchronous on +# the default stream and is out of libcudf's control (but must be tested). +set(_allowlist_filter SpanTest.CanConstructFromDeviceContainers) + ConfigureTest(SPAN_TEST utilities_tests/span_tests.cu) +ConfigureTest(SPAN_TEST_DEVICE_VECTOR utilities_tests/span_tests.cu) + +# Overwrite the environments set by ConfigureTest +set_tests_properties( + SPAN_TEST + PROPERTIES + ENVIRONMENT + "GTEST_FILTER=-${_allowlist_filter};GTEST_CUDF_STREAM_MODE=new_cudf_default;LD_PRELOAD=$" +) +set_tests_properties( + SPAN_TEST_DEVICE_VECTOR PROPERTIES ENVIRONMENT "GTEST_FILTER=${_allowlist_filter}" +) # ################################################################################################## # * iterator tests -------------------------------------------------------------------------------- @@ -578,7 +606,7 @@ ConfigureTest( ConfigureTest(LABEL_BINS_TEST labeling/label_bins_tests.cpp) # ################################################################################################## -# * stream identification tests ------------------------------------------------------------------- +# * stream testing --------------------------------------------------------------------------------- ConfigureTest( STREAM_IDENTIFICATION_TEST identify_stream_usage/test_default_stream_identification.cu )