@@ -22,7 +22,7 @@ limitations under the License. */
22
22
#include " paddle/phi/kernels/copy_kernel.h"
23
23
#include " paddle/phi/kernels/funcs/blas/blas.h"
24
24
#include " paddle/phi/kernels/funcs/math_function.h"
25
- #include " paddle/phi/kernels/funcs/sparse/ scatter.cu.h"
25
+ #include " paddle/phi/kernels/funcs/scatter.cu.h"
26
26
#include " paddle/phi/kernels/sparse/convolution_grad_kernel.h"
27
27
#include " paddle/phi/kernels/sparse/gpu/convolution.cu.h"
28
28
@@ -203,38 +203,19 @@ void Conv3dGradGPUKernel(const GPUContext& dev_ctx,
203
203
}
204
204
205
205
// 4. scatter
206
- // x_grad->ResizeAndAllocate(x.non_zero_elements().dims());
207
- DenseTensorMeta index_meta (DataType::INT32, {rulebook_len}, DataLayout::NCHW);
208
- DenseTensor out_index = phi::Empty (dev_ctx, std::move (index_meta));
209
- DenseTensor unique_key = phi::Empty (
210
- dev_ctx,
211
- DenseTensorMeta (paddle::experimental::CppTypeToDataType<IntT>::Type (),
212
- {rulebook_len},
213
- DataLayout::NCHW));
214
- DenseTensor unique_value = phi::Empty (dev_ctx, std::move (index_meta));
215
-
216
- SortedAndUniqueIndex<GPUContext, IntT>(dev_ctx,
217
- rulebook_ptr + rulebook_len,
218
- rulebook_len,
219
- &out_index,
220
- &unique_key,
221
- &unique_value);
222
-
223
206
config = phi::backends::gpu::GetGpuLaunchConfig1D (
224
207
dev_ctx, rulebook_len * in_channels, 1 );
225
208
226
- phi::funcs::sparse::ScatterKernel<T> <<< config.block_per_grid.x ,
227
- config.thread_per_block.x ,
228
- 0 ,
229
- dev_ctx.stream()>>> (
209
+ phi::funcs::ScatterCUDAKernel <<< config.block_per_grid,
210
+ config.thread_per_block,
211
+ 0 ,
212
+ dev_ctx.stream()>>> (
230
213
d_x_features_ptr,
231
- unique_value.data <int >(),
232
- out_index.data <int >(),
233
- x.nnz (),
214
+ rulebook_ptr + rulebook_len,
215
+ x_grad_values_ptr,
234
216
rulebook_len,
235
217
in_channels,
236
- x_grad_values_ptr,
237
- subm);
218
+ false );
238
219
}
239
220
240
221
template <typename T, typename Context>
0 commit comments