From a41447f0b833e5f1584e4921c0c6b63188fba645 Mon Sep 17 00:00:00 2001 From: zmx Date: Thu, 11 Nov 2021 20:34:16 +0800 Subject: [PATCH] Fix unit test for send_and_recv_cpu & send_and_recv_gpu (#37129) --- paddle/fluid/operators/pscore/send_and_recv_op_cpu_test.cc | 2 ++ paddle/fluid/operators/pscore/send_and_recv_op_gpu_test.cc | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/paddle/fluid/operators/pscore/send_and_recv_op_cpu_test.cc b/paddle/fluid/operators/pscore/send_and_recv_op_cpu_test.cc index 19bfb09237..0d99356f46 100644 --- a/paddle/fluid/operators/pscore/send_and_recv_op_cpu_test.cc +++ b/paddle/fluid/operators/pscore/send_and_recv_op_cpu_test.cc @@ -12,6 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ +#if defined PADDLE_WITH_PSCORE #include #include #include @@ -272,3 +273,4 @@ TEST(SENDANDRECV, CPU) { server_thread.join(); LOG(INFO) << "end server thread join"; } +#endif diff --git a/paddle/fluid/operators/pscore/send_and_recv_op_gpu_test.cc b/paddle/fluid/operators/pscore/send_and_recv_op_gpu_test.cc index a3b9d4bb01..236723c278 100644 --- a/paddle/fluid/operators/pscore/send_and_recv_op_gpu_test.cc +++ b/paddle/fluid/operators/pscore/send_and_recv_op_gpu_test.cc @@ -12,6 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ +#if (defined PADDLE_WITH_CUDA || defined PADDLE_WITH_HIP) && \ + (defined PADDLE_WITH_PSCORE) + #include #include #include @@ -295,3 +298,4 @@ TEST(SENDANDRECV, GPU) { server_thread.join(); LOG(INFO) << "end server thread join"; } +#endif -- GitLab