From 543f8a6487087dc3b9012118cb469efdcafe2a7d Mon Sep 17 00:00:00 2001 From: fis Date: Wed, 7 Oct 2020 15:30:36 +0800 Subject: [PATCH] Conditional compilation. --- tests/cpp/common/test_threading_utils.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/cpp/common/test_threading_utils.cc b/tests/cpp/common/test_threading_utils.cc index 76a6a3876edd..8588d467d07a 100644 --- a/tests/cpp/common/test_threading_utils.cc +++ b/tests/cpp/common/test_threading_utils.cc @@ -88,7 +88,7 @@ TEST(ParallelFor2dNonUniform, Test) { omp_set_num_threads(old); } - +#if defined(_OPENMP) TEST(OmpSetNumThreads, Basic) { auto nthreads = 2; auto orgi = OmpSetNumThreads(&nthreads); @@ -104,5 +104,6 @@ TEST(OmpSetNumThreads, Basic) { omp_set_num_threads(orgi); } +#endif // defined(_OPENMP) } // namespace common } // namespace xgboost