Skip to content

Commit 167ba8b

Browse files
authored
improves env usage in tests (#6680)
1 parent b778c95 commit 167ba8b

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

cub/cub/device/device_topk.cuh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,13 @@ CUB_RUNTIME_FUNCTION static cudaError_t dispatch_topk_hub(
118118
//! DeviceTopK can process all of the built-in C++ numeric primitive types (`unsigned char`, `int`, `double`, etc.) as
119119
//! well as CUDA's `__half` and `__nv_bfloat16` 16-bit floating-point types.
120120
//!
121-
//! Stability
121+
//! Determinism
122122
//! ++++++++++++++++++++++++++
123123
//!
124-
//! DeviceTopK currently only provides an unstable version.
124+
//! DeviceTopK currently only supports unordered output, which may be non-deterministic for certain inputs.
125+
//! That is, if there are multiple items across the k-th position that compare equal, the subset of tied elements that
126+
//! ends up in the returned top‑k is not uniquely defined and may vary between runs. This behavior has to be explicitly
127+
//! acknowledged by the user by passing `cuda::execution::determinism::not_guaranteed`.
125128
//!
126129
//! Usage Considerations
127130
//! ++++++++++++++++++++++++++

cub/test/catch2_test_device_topk_keys.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ CUB_RUNTIME_FUNCTION static cudaError_t dispatch_topk_keys(
3636
NumOutItemsT k,
3737
cudaStream_t stream = 0)
3838
{
39-
auto stream_env = cuda::std::execution::prop{cuda::get_stream_t{}, cuda::stream_ref{stream}};
39+
auto stream_env = cuda::stream_ref{stream};
4040
auto requirements =
4141
cuda::execution::require(cuda::execution::determinism::not_guaranteed, cuda::execution::output_ordering::unsorted);
4242

cub/test/catch2_test_device_topk_pairs.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ CUB_RUNTIME_FUNCTION static cudaError_t dispatch_topk_pairs(
3737
NumOutItemsT k,
3838
cudaStream_t stream = 0)
3939
{
40-
auto stream_env = cuda::std::execution::prop{cuda::get_stream_t{}, cuda::stream_ref{stream}};
40+
auto stream_env = cuda::stream_ref{stream};
4141
auto requirements =
4242
cuda::execution::require(cuda::execution::determinism::not_guaranteed, cuda::execution::output_ordering::unsorted);
4343

0 commit comments

Comments
 (0)