Add input size zero guard to async algorithms
Fix
Remove from reduce
MODIFY
thrust/system/hip/detail/async/for_each.h
thrust/system/hip/detail/async/for_each.h
@@ -111,6 +111,12 @@ auto async_for_each_n(
);
}
+ if( n == 0)
+ {
+ e.ready();
+ return e;
+ }
+
// Run for_each.
async_for_each_fn<ForwardIt, UnaryFunction> wrapped(

MODIFY
thrust/system/hip/detail/async/sort.h
thrust/system/hip/detail/async/sort.h
@@ -264,6 +264,12 @@ auto async_stable_sort_n(
);
}
+ if( n == 0)
+ {
+ e.ready();
+ return e;
+ }
+
// Run merge sort.
thrust::hip_rocprim::throw_on_error(
@@ -441,6 +447,12 @@ auto async_stable_sort_n(
);
}
+ if( n == 0)
+ {
+ e.ready();
+ return e;
+ }
+
// Run radix sort.
thrust::hip_rocprim::throw_on_error(
invoke_radix_sort(

MODIFY
thrust/system/hip/detail/async/transform.h
thrust/system/hip/detail/async/transform.h
@@ -113,6 +113,12 @@ auto async_transform_n(
);
}
+ if( n == 0)
+ {
+ e.ready();
+ return e;
+ }
+
// Run transform.
async_transform_fn<ForwardIt, OutputIt, UnaryOperation> wrapped(

Add input size zero guard to async algorithms

Fix


Remove from reduce