From d623b3fef5a997a9c3781db2d8454f720c6741d0 Mon Sep 17 00:00:00 2001 From: Bernhard Manfred Gruber Date: Wed, 8 Jul 2026 12:03:19 +0200 Subject: [PATCH 1/2] Randomly perturb temporary storage alignment --- cub/test/catch2_test_launch_helper.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cub/test/catch2_test_launch_helper.h b/cub/test/catch2_test_launch_helper.h index c111b4f9700..882dc2aeff5 100644 --- a/cub/test/catch2_test_launch_helper.h +++ b/cub/test/catch2_test_launch_helper.h @@ -188,9 +188,11 @@ void launch(ActionT action, Args... args) REQUIRE(temp_storage_bytes > 0); // required by API contract - c2h::device_vector temp_storage(temp_storage_bytes, thrust::no_init); + // randomly offset the temporary storage address by one byte + const int offset = GENERATE(random(0, 1)); + c2h::device_vector temp_storage(temp_storage_bytes + offset, thrust::no_init); - error = action(thrust::raw_pointer_cast(temp_storage.data()), temp_storage_bytes, args...); + error = action(thrust::raw_pointer_cast(temp_storage.data()) + offset, temp_storage_bytes, args...); REQUIRE(cudaSuccess == cudaPeekAtLastError()); REQUIRE(cudaSuccess == cudaDeviceSynchronize()); REQUIRE(cudaSuccess == error); From 1a33c68a7334d6a5c63e62f9b35b3b28d1f46730 Mon Sep 17 00:00:00 2001 From: Bernhard Manfred Gruber Date: Wed, 8 Jul 2026 21:00:12 +0200 Subject: [PATCH 2/2] take 1 --- cub/test/catch2_test_launch_helper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cub/test/catch2_test_launch_helper.h b/cub/test/catch2_test_launch_helper.h index 882dc2aeff5..46708da774f 100644 --- a/cub/test/catch2_test_launch_helper.h +++ b/cub/test/catch2_test_launch_helper.h @@ -189,7 +189,7 @@ void launch(ActionT action, Args... args) REQUIRE(temp_storage_bytes > 0); // required by API contract // randomly offset the temporary storage address by one byte - const int offset = GENERATE(random(0, 1)); + const int offset = GENERATE(take(1, random(0, 1))); c2h::device_vector temp_storage(temp_storage_bytes + offset, thrust::no_init); error = action(thrust::raw_pointer_cast(temp_storage.data()) + offset, temp_storage_bytes, args...);