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 ctest memcheck using cuda-sanitizer #9414

Merged
merged 4 commits into from
Oct 19, 2021
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
5 changes: 5 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ rapids_find_package(CUDAToolkit REQUIRED
INSTALL_EXPORT_SET cudf-exports)
include(cmake/Modules/ConfigureCUDA.cmake) # set other CUDA compilation flags

# ctest cuda memcheck
find_program(CUDA_SANITIZER compute-sanitizer)
set(MEMORYCHECK_COMMAND ${CUDA_SANITIZER})
set(MEMORYCHECK_TYPE CudaSanitizer)
set(CUDA_SANITIZER_COMMAND_OPTIONS "--tool memcheck")

###################################################################################################
# - dependencies ----------------------------------------------------------------------------------
Expand Down
10 changes: 8 additions & 2 deletions cpp/include/cudf_test/base_fixture.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,16 +266,22 @@ inline std::shared_ptr<rmm::mr::device_memory_resource> create_memory_resource(
*
* Currently only supports 'rmm_mode' string parameter, which set the rmm
* allocation mode. The default value of the parameter is 'pool'.
* Environment variable 'CUDF_TEST_RMM_MODE' can also be used to set the rmm
* allocation mode. If both are set, the value of 'rmm_mode' string parameter
* takes precedence.
*
* @return Parsing results in the form of unordered map
*/
inline auto parse_cudf_test_opts(int argc, char** argv)
{
try {
cxxopts::Options options(argv[0], " - cuDF tests command line options");
const char* env_rmm_mode = std::getenv("GTEST_CUDF_RMM_MODE"); // Overridden by CLI options
auto default_rmm_mode = env_rmm_mode ? env_rmm_mode : "pool";
options.allow_unrecognised_options().add_options()(
"rmm_mode", "RMM allocation mode", cxxopts::value<std::string>()->default_value("pool"));

"rmm_mode",
"RMM allocation mode",
cxxopts::value<std::string>()->default_value(default_rmm_mode));
return options.parse(argc, argv);
} catch (const cxxopts::OptionException& e) {
CUDF_FAIL("Error parsing command line options");
Expand Down
2 changes: 1 addition & 1 deletion cpp/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ ConfigureTest(STRINGS_TEST

###################################################################################################
# - structs test ----------------------------------------------------------------------------------
ConfigureTest(STRUCTS_TEST
ConfigureTest(STRUCTS_TEST
structs/structs_column_tests.cpp
structs/utilities_tests.cpp
)
Expand Down