From 5e0e455dc8288ce08771865e930c2cadb957a05a Mon Sep 17 00:00:00 2001 From: wanghaoshuang Date: Mon, 18 Sep 2017 16:47:52 +0800 Subject: [PATCH] Add CUDA stream when launching kernel. --- paddle/operators/crop_op.cu | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/paddle/operators/crop_op.cu b/paddle/operators/crop_op.cu index 561dbe48039..a40eb7af385 100644 --- a/paddle/operators/crop_op.cu +++ b/paddle/operators/crop_op.cu @@ -88,7 +88,13 @@ void CropCUDAFunctoin(const framework::ExecutionContext& context) { int d = out_dims[1]; int block = 512; int grid = (n * d + block - 1) / block; - CropKernel<<>>(out_count, out_shape_gpu, x_shape_gpu, + + auto* device_context = + const_cast(context.device_context_); + CropKernel<<(device_context) + ->stream()>>>(out_count, out_shape_gpu, x_shape_gpu, crop_rules_gpu, x_data, out_data); cudaFree(crop_rules_gpu); cudaFree(x_shape_gpu); -- GitLab