diff --git a/paddle/fluid/framework/init.cc b/paddle/fluid/framework/init.cc index d077318b75f7749e97834b0ffd9846e50552230e..3c0d93642ac41e8d90f9a248e81cea7a4fe12293 100644 --- a/paddle/fluid/framework/init.cc +++ b/paddle/fluid/framework/init.cc @@ -44,6 +44,7 @@ void InitGflags(std::vector &argv) { } void InitP2P(int count) { +#ifdef PADDLE_WITH_CUDA std::call_once(p2p_init_flag, [&]() { for (int i = 0; i < count; ++i) { for (int j = 0; j < count; ++j) { @@ -60,6 +61,7 @@ void InitP2P(int count) { } } }); +#endif } void InitDevices() {