diff --git a/paddle/operators/clip_op.cu b/paddle/operators/clip_op.cu index 883f25c9271558556430c3424df7feb8a25c24e1..ac6a062f6d9fc84b43d1fe74c0d4e922f16be494 100644 --- a/paddle/operators/clip_op.cu +++ b/paddle/operators/clip_op.cu @@ -54,12 +54,11 @@ class ClipGradientOpCUDAKernel : public framework::OpKernel { int D = d_x->dims()[1]; int block = 512; int grid = (N * D + block - 1) / block; - auto* device_context = - const_cast(context.device_context_); - ClipGradientKernel< - T><<(device_context) - ->stream()>>>(count, min, max, x_data, d_out_data, d_x_data); + ClipGradientKernel<<< + grid, block, 0, reinterpret_cast( + context.device_context()) + .stream()>>>(count, min, max, x_data, d_out_data, + d_x_data); } };