Skip to content

Commit

Permalink
Revert "fix the unqiue op that generate the wrong the inreverse result (
Browse files Browse the repository at this point in the history
PaddlePaddle#62104)"

This reverts commit b89066a.
  • Loading branch information
hanhaowen-mt committed May 13, 2024
1 parent 878bb23 commit b077291
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions paddle/phi/kernels/gpu/unique_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,8 @@ UniqueFlattendCUDATensor(const Context& context,
#ifdef PADDLE_WITH_HIP
hipMemset(inv_loc_data_ptr, 0, sizeof(IndexT));
#else
thrust::device_ptr<IndexT> inv_loc_data_dev(inv_loc_data_ptr);
inv_loc_data_dev[0] = 0; // without device_ptr, segmentation fault
cudaMemsetAsync(inv_loc_data_ptr, 0, sizeof(IndexT), context.stream());
#endif

#ifdef PADDLE_WITH_HIP
size_t temp_storage_bytes = 0;
cub::DeviceScan::InclusiveSum(NULL,
temp_storage_bytes,
Expand All @@ -188,12 +185,6 @@ UniqueFlattendCUDATensor(const Context& context,
inv_loc_data_ptr,
num_input,
context.stream());
#else
thrust::inclusive_scan(exec_policy,
inv_loc_data_ptr,
inv_loc_data_ptr + num_input,
inv_loc_data_ptr);
#endif
thrust::scatter(exec_policy,
inv_loc_data_ptr,
inv_loc_data_ptr + num_input,
Expand Down

0 comments on commit b077291

Please sign in to comment.