Skip to content

Commit

Permalink
Deleting the sync operation and gpu.place check function in forward k…
Browse files Browse the repository at this point in the history
…ernel.
  • Loading branch information
JamesLim-sy committed Feb 3, 2021
1 parent ce289f4 commit aadcd13
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions paddle/fluid/operators/index_sample_op.cu
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ class IndexSampleKernel<platform::CUDADeviceContext, T>
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<T>();
auto* out_data = output->mutable_data<T>(ctx.GetPlace());
auto stream =
Expand Down Expand Up @@ -115,7 +111,6 @@ class IndexSampleKernel<platform::CUDADeviceContext, T>
index_data, in_data, out_data, index_length, input_length,
batch_size);
}
PADDLE_ENFORCE_CUDA_SUCCESS(cudaStreamSynchronize(stream));
}
};

Expand Down

1 comment on commit aadcd13

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.