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

Fix gtests/ERROR_TEST errors when run in Debug #15317

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions cpp/tests/error/error_handling_test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ TEST(DebugAssertDeathTest, cudf_assert_false)
testing::FLAGS_gtest_death_test_style = "threadsafe";

auto call_kernel = []() {
assert_false_kernel<<<1, 1>>>();
auto const stream = cudf::get_default_stream().value();
assert_false_kernel<<<1, 1, 0, stream>>>();

// Kernel should fail with `cudaErrorAssert`
// This error invalidates the current device context, so we need to kill
Expand All @@ -114,7 +115,8 @@ TEST(DebugAssertDeathTest, cudf_assert_false)

TEST(DebugAssert, cudf_assert_true)
{
assert_true_kernel<<<1, 1>>>();
auto const stream = cudf::get_default_stream().value();
assert_true_kernel<<<1, 1, 0, stream>>>();
ASSERT_EQ(cudaSuccess, cudaDeviceSynchronize());
}

Expand All @@ -136,6 +138,7 @@ int main(int argc, char** argv)
auto adaptor = make_stream_checking_resource_adaptor(
resource, error_on_invalid_stream, check_default_stream);
rmm::mr::set_current_device_resource(&adaptor);
return RUN_ALL_TESTS();
}
return RUN_ALL_TESTS();
}