diff --git a/paddle/pybind/pybind.cc b/paddle/pybind/pybind.cc index 35fbf4d04a6a199d01ee6c52e901d1721c33c482..bc87fabf3fd6d2a1d4af857be5693f6c257ca35c 100644 --- a/paddle/pybind/pybind.cc +++ b/paddle/pybind/pybind.cc @@ -483,7 +483,9 @@ All parameter, weight, gradient are variables in Paddle. BindOpDesc(m); m.def("op_support_gpu", OpSupportGPU); +#ifdef PADDLE_WITH_CUDA m.def("get_cuda_device_count", platform::GetCUDADeviceCount); +#endif return m.ptr(); }