Skip to content

Commit 2650cc8

Browse files
authored
fix shape kernel instantiated twice error in CUDA custom device backend (#74397)
1 parent 97a9e5f commit 2650cc8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

paddle/phi/kernels/selected_rows/shape_kernel.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ PD_REGISTER_KERNEL(shape_sr,
9595
}
9696
#endif
9797

98-
#ifdef PADDLE_WITH_CUSTOM_DEVICE
98+
#if defined(PADDLE_WITH_CUSTOM_DEVICE) && !defined(PADDLE_WITH_CUDA)
9999
PD_REGISTER_KERNEL(shape_sr,
100100
Custom,
101101
ALL_LAYOUT,
@@ -171,7 +171,7 @@ PD_REGISTER_KERNEL(shape64_sr,
171171
}
172172
#endif
173173

174-
#ifdef PADDLE_WITH_CUSTOM_DEVICE
174+
#if defined(PADDLE_WITH_CUSTOM_DEVICE) && !defined(PADDLE_WITH_CUDA)
175175
PD_REGISTER_KERNEL(shape64_sr,
176176
Custom,
177177
ALL_LAYOUT,

0 commit comments

Comments
 (0)