Fix the return values at input size zero
WIP
MODIFY
thrust/system/hip/detail/merge.h
thrust/system/hip/detail/merge.h
@@ -91,13 +91,7 @@ namespace __merge
= static_cast<size_type>(thrust::distance(keys2_first, keys2_last));
if( input1_size == 0 && input2_size == 0 )
- return keys1_first;
-
- if( input1_size == 0 )
- return keys2_last;
-
- if( input2_size == 0 )
- return keys1_last;
+ return result;
size_t storage_size = 0;
hipStream_t stream = hip_rocprim::stream(policy);
@@ -171,6 +165,9 @@ namespace __merge
size_type input2_size
= static_cast<size_type>(thrust::distance(keys2_first, keys2_last));
+ if( input1_size == 0 && input2_size == 0 )
+ return thrust::make_pair(keys_result, items_result);;
+
size_t storage_size = 0;
hipStream_t stream = hip_rocprim::stream(policy);
bool debug_sync = THRUST_HIP_DEBUG_SYNC_FLAG;

MODIFY
thrust/system/hip/detail/partition.h
thrust/system/hip/detail/partition.h
@@ -176,7 +176,7 @@ namespace __partition
bool debug_sync = THRUST_HIP_DEBUG_SYNC_FLAG;
if(num_items == 0)
- return thrust::make_pair(first, last);
+ return thrust::make_pair(selected_result, rejected_result);
// Determine temporary device storage requirements.
hip_rocprim::throw_on_error(rocprim::partition(NULL,

Fix the return values at input size zero

 WIP