WIP: Finish removing compile_cpp_as_cuda
authorMark Abraham <mark.j.abraham@gmail.com>
Tue, 23 Jun 2020 15:36:20 +0000 (15:36 +0000)
committerMark Abraham <mark.j.abraham@gmail.com>
Tue, 23 Jun 2020 15:36:20 +0000 (15:36 +0000)
The definition can now be removed, and a comment updated.

Test code can use the same approach where needed.

src/gromacs/CMakeLists.txt
src/gromacs/ewald/tests/CMakeLists.txt
src/gromacs/gpu_utils/tests/CMakeLists.txt
src/gromacs/nbnxm/gpu_common.h
src/testutils/TestMacros.cmake

index 6ea6f87224c93190e445091fffb0a2e775fea6f4..46ebb376e132bd517b8afda778b0d08276413c77 100644 (file)
@@ -60,12 +60,6 @@ function (gmx_add_libgromacs_sources)
     _gmx_add_files_to_property(GMX_LIBGROMACS_SOURCES ${ARGN})
 endfunction ()
 
-# TODO Reconsider this, as the CUDA driver API is probably a simpler
-# approach, at least for the build system. See Issue #2530
-function (gmx_compile_cpp_as_cuda)
-    _gmx_add_files_to_property(GMX_LIBGROMACS_GPU_IMPL_SOURCES ${ARGN})
-endfunction ()
-
 # Permit the configuration to disable compiling the many nbnxm kernels
 # and others involved in force calculations. Currently only
 # short-ranged and bonded kernels are disabled this way, but in future
index 0df6bee833c933892c800a88a9f308a2c5ca923e..4ce31f5767905ea1b3b7860af6665e16d692422a 100644 (file)
@@ -38,9 +38,8 @@ gmx_add_unit_test(EwaldUnitTests ewald-test HARDWARE_DETECTION
         pmegathertest.cpp
         pmesolvetest.cpp
         pmesplinespreadtest.cpp
-        testhardwarecontexts.cpp
-    GPU_CPP_SOURCE_FILES
         pmetestcommon.cpp
+        testhardwarecontexts.cpp
 )
 
 gmx_add_libgromacs_sources(
index 792b481f8a329438e932eb8859f4e0bf3e92e47b..e54ac254d1fccaae3bf05f0830dcbe23ec7d7994 100644 (file)
@@ -50,12 +50,6 @@ gmx_add_unit_test(GpuUtilsUnitTests gpu_utils-test
         devicetransfers.cu
         typecasts_runner.cu
 
-    CUDA_CPP_SOURCE_FILES
-        device_stream_manager.cpp
-        pinnedmemorychecker.cpp
-        typecasts.cpp
-        typecasts_runner.cpp
-
     OPENCL_CPP_SOURCE_FILES
         devicetransfers_ocl.cpp
 
index 01f257e54f08fd787bdba775ceeeced859ef5ba1..1185ebae110ebbd47a0cebf96c8fea450c984ec1 100644 (file)
@@ -357,7 +357,9 @@ static inline void gpu_accumulate_timings(gmx_wallclock_gpu_nbnxn_t* timings,
  *
  * See documentation in nbnxm_gpu.h for details.
  *
- * \todo Move into shared source file with gmx_compile_cpp_as_cuda
+ * \todo Move into shared source file, perhaps including
+ * cuda_runtime.h if needed for any remaining CUDA-specific
+ * objects.
  */
 //NOLINTNEXTLINE(misc-definitions-in-headers)
 bool gpu_try_finish_task(NbnxmGpu*                nb,
index 36c9631a68301d9fe4c410fdfc76637f8bfd85b5..8d5cf3b733863c5e4d248a3d60fce86fb8e4833e 100644 (file)
@@ -71,8 +71,6 @@ endfunction ()
 #     compiled in the way that suits GMX_GPU.
 #   CUDA_CU_SOURCE_FILES      file1.cu  file2.cu  ...
 #     All the normal CUDA .cu source files
-#   CUDA_CPP_SOURCE_FILES     file1.cpp file2.cpp ...
-#     All the other .cpp source files to be compiled as CUDA
 #   OPENCL_CPP_SOURCE_FILES   file1.cpp file2.cpp ...
 #     All the other C++ .cpp source files needed only with OpenCL
 #   NON_GPU_CPP_SOURCE_FILES  file1.cpp file2.cpp ...
@@ -84,7 +82,6 @@ function (gmx_add_gtest_executable EXENAME)
             CPP_SOURCE_FILES
             CUDA_CU_SOURCE_FILES
             GPU_CPP_SOURCE_FILES
-            CUDA_CPP_SOURCE_FILES
             OPENCL_CPP_SOURCE_FILES
             NON_GPU_CPP_SOURCE_FILES
             )
@@ -119,7 +116,6 @@ function (gmx_add_gtest_executable EXENAME)
             cuda_add_executable(${EXENAME} ${UNITTEST_TARGET_OPTIONS}
                 ${ARG_CPP_SOURCE_FILES}
                 ${ARG_CUDA_CU_SOURCE_FILES}
-                ${ARG_CUDA_CPP_SOURCE_FILES}
                 ${ARG_GPU_CPP_SOURCE_FILES}
                 ${TESTUTILS_DIR}/unittest_main.cpp)
         else()
@@ -132,11 +128,10 @@ function (gmx_add_gtest_executable EXENAME)
             if (GMX_CLANG_CUDA)
                 target_sources(${EXENAME} PRIVATE
                     ${ARG_CUDA_CU_SOURCE_FILES}
-                    ${ARG_CUDA_CPP_SOURCE_FILES}
                     ${ARG_GPU_CPP_SOURCE_FILES})
-                set_source_files_properties(${ARG_CUDA_CPP_SOURCE_FILES} ${ARG_GPU_CPP_SOURCE_FILES} PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ)
+                set_source_files_properties(${ARG_GPU_CPP_SOURCE_FILES} PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ)
                 gmx_compile_cuda_file_with_clang(${ARG_CUDA_CU_SOURCE_FILES})
-                if(ARG_CUDA_CPP_SOURCE_FILES OR ARG_CUDA_CU_SOURCE_FILES OR ARG_GPU_CPP_SOURCE_FILES)
+                if(ARG_CUDA_CU_SOURCE_FILES OR ARG_GPU_CPP_SOURCE_FILES)
                     target_link_libraries(${EXENAME} PRIVATE ${GMX_EXTRA_LIBRARIES})
                 endif()
             endif()