diff --git a/paddle/framework/executor.cc b/paddle/framework/executor.cc index aa36b7438f..7c3cac359e 100644 --- a/paddle/framework/executor.cc +++ b/paddle/framework/executor.cc @@ -30,7 +30,7 @@ Executor::Executor(const std::vector& places) { device_contexts_[i] = new platform::CPUDeviceContext( boost::get(places[i])); } else if (platform::is_gpu_place(places[i])) { -#ifndef PADDLE_ONLY_CPU +#ifdef PADDLE_WITH_GPU device_contexts_[i] = new platform::CUDADeviceContext( boost::get(places[i])); #else diff --git a/paddle/framework/executor_test.cc b/paddle/framework/executor_test.cc index f746242a6b..ca7e8ca7d2 100644 --- a/paddle/framework/executor_test.cc +++ b/paddle/framework/executor_test.cc @@ -103,7 +103,7 @@ TEST_F(ExecutorTester, InitCPU) { delete executor; } -#ifndef PADDLE_ONLY_CPU +#ifdef PADDLE_WITH_GPU TEST_F(ExecutorTester, InitGPU) { std::vector places; GPUPlace gpu_place0(0);