Fix DeviceStreamManager tests
authorArtem Zhmurov <zhmurov@gmail.com>
Fri, 14 Aug 2020 14:16:01 +0000 (14:16 +0000)
committerPaul Bauer <paul.bauer.q@gmail.com>
Fri, 14 Aug 2020 14:16:01 +0000 (14:16 +0000)
Wrong CMake macros was used which lead to DeviceStreamManager not
running for GPU builds.

src/gromacs/gpu_utils/tests/CMakeLists.txt
src/gromacs/gpu_utils/tests/pinnedmemorychecker.cpp
src/gromacs/gpu_utils/tests/typecasts.cpp

index e54ac254d1fccaae3bf05f0830dcbe23ec7d7994..93e385806b7e538072b570dbef48117dcecb3567 100644 (file)
@@ -44,7 +44,10 @@ gmx_add_unit_test(GpuUtilsUnitTests gpu_utils-test
         gputest.cpp
         # Tests of code
         clfftinitializer.cpp
+        device_stream_manager.cpp
         hostallocator.cpp
+        pinnedmemorychecker.cpp
+        typecasts.cpp
 
     CUDA_CU_SOURCE_FILES
         devicetransfers.cu
@@ -54,6 +57,5 @@ gmx_add_unit_test(GpuUtilsUnitTests gpu_utils-test
         devicetransfers_ocl.cpp
 
     NON_GPU_CPP_SOURCE_FILES
-        device_stream_manager.cpp
         devicetransfers.cpp
     )
index 3d518cb74b49e18ec5bac9875a50d053c72b8496..2becac65340b516bdb7d1fe71c97e1ec6f9b0381 100644 (file)
  */
 #include "gmxpre.h"
 
-#include <vector>
+#include "config.h"
 
-#include <gtest/gtest.h>
+#if GMX_GPU_CUDA
 
-#include "gromacs/gpu_utils/gpu_utils.h"
-#include "gromacs/gpu_utils/hostallocator.h"
-#include "gromacs/gpu_utils/pmalloc_cuda.h"
-#include "gromacs/utility/real.h"
-#include "gromacs/utility/smalloc.h"
+#    include <vector>
 
-#include "gputest.h"
+#    include <gtest/gtest.h>
+
+#    include "gromacs/gpu_utils/gpu_utils.h"
+#    include "gromacs/gpu_utils/hostallocator.h"
+#    include "gromacs/gpu_utils/pmalloc_cuda.h"
+#    include "gromacs/utility/real.h"
+#    include "gromacs/utility/smalloc.h"
+
+#    include "gputest.h"
 
 namespace gmx
 {
@@ -128,3 +132,5 @@ TEST_F(PinnedMemoryCheckerTest, PinnedCBufferIsRecognized)
 } // namespace
 } // namespace test
 } // namespace gmx
+
+#endif // GMX_GPU_CUDA
index 7c5301c9f8c008bc8c45e42a4ddc3c367dd491df..319813828bfc735cb7236568606b7522546df099 100644 (file)
  */
 #include "gmxpre.h"
 
-#include <vector>
+#include "config.h"
 
-#include <gtest/gtest.h>
+#if GMX_GPU_CUDA
 
-#include "gromacs/gpu_utils/gpu_testutils.h"
-#include "gromacs/utility/exceptions.h"
+#    include <vector>
 
-#include "testutils/testasserts.h"
-#include "testutils/testmatchers.h"
+#    include <gtest/gtest.h>
 
-#include "typecasts_runner.h"
+#    include "gromacs/gpu_utils/gpu_testutils.h"
+#    include "gromacs/utility/exceptions.h"
+
+#    include "testutils/testasserts.h"
+#    include "testutils/testmatchers.h"
+
+#    include "typecasts_runner.h"
 
 namespace gmx
 {
@@ -80,3 +84,5 @@ TEST(GpuDataTypesCompatibilityTest, RVecAndFloat3OnDevice)
 
 } // namespace test
 } // namespace gmx
+
+#endif // GMX_GPU_CUDA