diff --git a/paddle/platform/profiler_test.cc b/paddle/platform/profiler_test.cc index ed64ff40c97bb36bf2241bcbf76cc4409bc90ef7..5bd0a9d8599306e7437fecefa9fcaa6a00574ad6 100644 --- a/paddle/platform/profiler_test.cc +++ b/paddle/platform/profiler_test.cc @@ -51,8 +51,6 @@ TEST(Event, CudaElapsedTime) { TEST(RecordEvent, RecordEvent) { using paddle::platform::DeviceContext; - using paddle::platform::CUDADeviceContext; - using paddle::platform::GPUPlace; using paddle::platform::Event; using paddle::platform::EventKind; using paddle::platform::RecordEvent; @@ -61,6 +59,8 @@ TEST(RecordEvent, RecordEvent) { ProfilerState state = ProfilerState::kCPU; DeviceContext* dev_ctx = nullptr; #ifdef PADDLE_WITH_CUDA + using paddle::platform::CUDADeviceContext; + using paddle::platform::GPUPlace; state = ProfilerState::kCUDA; dev_ctx = new paddle::platform::CUDADeviceContext(paddle::platform::GPUPlace(0));