From aadcd13e6704d22c678d6d49897b04d5b3b24ff1 Mon Sep 17 00:00:00 2001 From: JamesLim-sy Date: Wed, 3 Feb 2021 05:42:57 +0000 Subject: [PATCH] Deleting the sync operation and gpu.place check function in forward kernel. --- paddle/fluid/operators/index_sample_op.cu | 5 ----- 1 file changed, 5 deletions(-) diff --git a/paddle/fluid/operators/index_sample_op.cu b/paddle/fluid/operators/index_sample_op.cu index 24ea50b22915f1..c8488eefb984f2 100644 --- a/paddle/fluid/operators/index_sample_op.cu +++ b/paddle/fluid/operators/index_sample_op.cu @@ -81,10 +81,6 @@ class IndexSampleKernel framework::proto::VarType::INT32), paddle::framework::DataTypeToString( framework::proto::VarType::INT64))); - PADDLE_ENFORCE_EQ( - platform::is_gpu_place(ctx.GetPlace()), true, - platform::errors::InvalidArgument("It must use CUDAPlace.")); - const auto* in_data = input->data(); auto* out_data = output->mutable_data(ctx.GetPlace()); auto stream = @@ -115,7 +111,6 @@ class IndexSampleKernel index_data, in_data, out_data, index_length, input_length, batch_size); } - PADDLE_ENFORCE_CUDA_SUCCESS(cudaStreamSynchronize(stream)); } };