Skip to content

Commit 8cb73ab

Browse files
committed
use HostAlloc to alloc memory
1 parent 8562242 commit 8cb73ab

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

paddle/phi/kernels/gpu/bincount_kernel.cu

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ void BincountCUDAInner(const Context& dev_ctx,
107107

108108
DenseTensor input_min_max_cpu;
109109
input_min_max_cpu.Resize({2});
110-
input_min_max_cpu.mutable_data<InputT>(phi::CPUPlace());
110+
auto* input_min_max_cpu_data =
111+
dev_ctx.template HostAlloc<InputT>(&input_min_max_cpu);
111112
input_min_max_cpu.data<InputT>()[0] = std::numeric_limits<InputT>::max();
112113
input_min_max_cpu.data<InputT>()[1] = std::numeric_limits<InputT>::lowest();
113114

0 commit comments

Comments
 (0)