Skip to content

Commit 607b5f2

Browse files
committed
Fix
1 parent 7bcbccf commit 607b5f2

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

paddle/phi/kernels/funcs/elementwise/elementwise_op_broadcast.cu.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace funcs {
2121

2222
template <typename OutT, typename Functor, int NumOuts = 1>
2323
void LaunchElementwiseCudaKernel(
24-
const KPDevice &ctx,
24+
const KPDevice &dev_ctx,
2525
const std::vector<const phi::DenseTensor *> &ins,
2626
std::vector<phi::DenseTensor *> *outs,
2727
Functor func,
@@ -50,7 +50,7 @@ void LaunchElementwiseCudaKernel(
5050
pt_outputs.push_back(pt_outputs_tmp[i].get());
5151
}
5252
phi::funcs::BroadcastKernel<OutT, Functor, NumOuts>(
53-
ctx, pt_inputs, &pt_outputs, func, axis);
53+
dev_ctx, pt_inputs, &pt_outputs, func, axis);
5454
}
5555

5656
} // namespace funcs

paddle/phi/kernels/funcs/elementwise/elementwise_op_impl.cu.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace funcs {
2424

2525
template <typename OutT, typename Functor, int NumOuts = 1>
2626
void LaunchSameDimsElementwiseCudaKernel(
27-
const KPDevice &ctx,
27+
const KPDevice &dev_ctx,
2828
const std::vector<const phi::DenseTensor *> &ins,
2929
std::vector<phi::DenseTensor *> *outs,
3030
Functor func) {
@@ -52,7 +52,7 @@ void LaunchSameDimsElementwiseCudaKernel(
5252
pt_outputs.push_back(pt_outputs_tmp[i].get());
5353
}
5454
phi::funcs::ElementwiseKernel<OutT, Functor, NumOuts>(
55-
ctx, pt_inputs, &pt_outputs, func);
55+
dev_ctx, pt_inputs, &pt_outputs, func);
5656
}
5757

5858
} // namespace funcs

paddle/phi/kernels/funcs/repeat_tensor2index_tensor.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ namespace funcs {
2424

2525
template <typename Context, typename RepeatsT>
2626
void RepeatsTensor2IndexTensorFunctor<Context, RepeatsT>::operator()(
27-
const Context &ctx, const DenseTensor &repeats, DenseTensor *index) {
27+
const Context &dev_ctx, const DenseTensor &repeats, DenseTensor *index) {
2828
DenseTensor repeats_cpu_copy;
2929
if (repeats.place().GetType() != phi::AllocationType::CPU) {
30-
phi::Copy(ctx, repeats, phi::CPUPlace(), true, &repeats_cpu_copy);
30+
phi::Copy(dev_ctx, repeats, phi::CPUPlace(), true, &repeats_cpu_copy);
3131
}
3232
const RepeatsT *repeats_data =
3333
repeats.place().GetType() == phi::AllocationType::CPU
@@ -51,7 +51,7 @@ void RepeatsTensor2IndexTensorFunctor<Context, RepeatsT>::operator()(
5151
}
5252
index->Resize(common::make_ddim({index_size}));
5353

54-
phi::TensorFromVector<RepeatsT>(index_vec, ctx, index);
54+
phi::TensorFromVector<RepeatsT>(index_vec, dev_ctx, index);
5555
}
5656

5757
template <typename RepeatsT>

0 commit comments

Comments
 (0)