Skip to content

Commit

Permalink
Don't fail on bad-alloc for large memory test.
Browse files Browse the repository at this point in the history
  • Loading branch information
alliepiper committed May 2, 2024
1 parent a791829 commit 2babc98
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cub/test/catch2_test_device_select_if.cu
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ CUB_TEST("DeviceSelect::If works with a different output type", "[device][select
}

CUB_TEST("DeviceSelect::If works for very large number of items", "[device][select_if]", offset_types)
try
{
using type = std::int64_t;
using offset_t = typename c2h::get<0, TestType>;
Expand Down Expand Up @@ -434,8 +435,13 @@ CUB_TEST("DeviceSelect::If works for very large number of items", "[device][sele
bool all_results_correct = thrust::equal(out.cbegin(), out.cend(), expected_out_it);
REQUIRE(all_results_correct == true);
}
catch (std::bad_alloc&)
{
// Exceeding memory is not a failure.
}

CUB_TEST("DeviceSelect::If works for very large number of output items", "[device][select_if]", offset_types)
try
{
using type = std::uint8_t;
using offset_t = typename c2h::get<0, TestType>;
Expand Down Expand Up @@ -472,3 +478,7 @@ CUB_TEST("DeviceSelect::If works for very large number of output items", "[devic
REQUIRE(num_selected_out[0] == num_items);
REQUIRE(in == out);
}
catch (std::bad_alloc&)
{
// Exceeding memory is not a failure.
}

0 comments on commit 2babc98

Please sign in to comment.