Skip to content

Commit

Permalink
fix MSVC using usage
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurelius84 committed Aug 18, 2021
1 parent d697687 commit 4808305
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
16 changes: 8 additions & 8 deletions paddle/fluid/platform/device_event_gpu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ void DeviceEventCPUWaitCUDA(const DeviceEvent* event, DeviceContext* context) {
} // namespace platform
} // namespace paddle

using ::paddle::platform::DeviceType::CUDA;
using ::paddle::platform::DeviceType::CPU;
REGISTER_EVENT_CREATE_FUNCTION(CUDA, paddle::platform::DeviceEventCreateCUDA)
REGISTER_EVENT_RECORD_FUNCTION(CUDA, paddle::platform::DeviceEventRecordCUDA)
REGISTER_EVENT_QUERY_FUNCTION(CUDA, paddle::platform::DeviceEventQueryCUDA)
REGISTER_EVENT_FINISH_FUNCTION(CUDA, paddle::platform::DeviceEventFinishCUDA)
REGISTER_EVENT_WAIT_FUNCTION(CUDA, CUDA,
using ::paddle::platform::kCUDA;
using ::paddle::platform::kCPU;
REGISTER_EVENT_CREATE_FUNCTION(kCUDA, paddle::platform::DeviceEventCreateCUDA)
REGISTER_EVENT_RECORD_FUNCTION(kCUDA, paddle::platform::DeviceEventRecordCUDA)
REGISTER_EVENT_QUERY_FUNCTION(kCUDA, paddle::platform::DeviceEventQueryCUDA)
REGISTER_EVENT_FINISH_FUNCTION(kCUDA, paddle::platform::DeviceEventFinishCUDA)
REGISTER_EVENT_WAIT_FUNCTION(kCUDA, kCUDA,
paddle::platform::DeviceEventCUDAWaitCUDA)
REGISTER_EVENT_WAIT_FUNCTION(CPU, CUDA,
REGISTER_EVENT_WAIT_FUNCTION(kCPU, kCUDA,
paddle::platform::DeviceEventCPUWaitCUDA)
#endif
14 changes: 7 additions & 7 deletions paddle/fluid/platform/device_event_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

#ifdef PADDLE_WITH_CUDA
#include <cuda_runtime.h>
using ::paddle::platform::DeviceType::CUDA;
using ::paddle::platform::DeviceType::CPU;
USE_EVENT(CUDA);
USE_EVENT_WAIT(CUDA, CUDA)
USE_EVENT_WAIT(CPU, CUDA)
using ::paddle::platform::kCUDA;
using ::paddle::platform::kCPU;
USE_EVENT(kCUDA);
USE_EVENT_WAIT(kCUDA, kCUDA)
USE_EVENT_WAIT(kCPU, kCUDA)

TEST(DeviceEvent, CUDA) {
VLOG(1) << "In Test";
Expand Down Expand Up @@ -63,11 +63,11 @@ TEST(DeviceEvent, CUDA) {
status = event.Query();
ASSERT_EQ(status, false);

event.Wait(CUDA, context); // step 2. add streamWaitEvent
event.Wait(kCUDA, context); // step 2. add streamWaitEvent
status = event.Query();
ASSERT_EQ(status, false); // async

event.Wait(CPU, context); // step 3. EventSynchornize
event.Wait(kCPU, context); // step 3. EventSynchornize
status = event.Query();
ASSERT_EQ(status, true); // sync

Expand Down

1 comment on commit 4808305

@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.