diff --git a/paddle/framework/executor.cc b/paddle/framework/executor.cc index aa36b7438ff8e34fdd5435f8b330046a407eed26..7c3cac359e61938ca2ff011a09afc73a99226124 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 f746242a6b35dbfa0938608f214a04bd9cc49799..ca7e8ca7d2302e9f0e22ab02ab4d05753293d4c9 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);