endif()
set_property(GLOBAL PROPERTY GMX_LIBGROMACS_SOURCES)
-set_property(GLOBAL PROPERTY GMX_LIBGROMACS_GPU_IMPL_SOURCES)
+set_property(GLOBAL PROPERTY CUDA_SOURCES)
set_property(GLOBAL PROPERTY GMX_INSTALLED_HEADERS)
set_property(GLOBAL PROPERTY GMX_AVX_512_SOURCE)
# Mark some shared GPU implementation files to compile with CUDA if needed
if (GMX_GPU_CUDA)
- get_property(LIBGROMACS_GPU_IMPL_SOURCES GLOBAL PROPERTY GMX_LIBGROMACS_GPU_IMPL_SOURCES)
- set_source_files_properties(${LIBGROMACS_GPU_IMPL_SOURCES} PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ)
-endif()
-
-# set up CUDA compilation with clang
-if (GMX_CLANG_CUDA)
- foreach (_file ${LIBGROMACS_SOURCES})
- get_filename_component(_ext ${_file} EXT)
- get_source_file_property(_cuda_source_format ${_file} CUDA_SOURCE_PROPERTY_FORMAT)
- if ("${_ext}" STREQUAL ".cu" OR _cuda_source_format)
- gmx_compile_cuda_file_with_clang(${_file})
- endif()
- endforeach()
+ get_property(CUDA_SOURCES GLOBAL PROPERTY CUDA_SOURCES)
+ set_source_files_properties(${CUDA_SOURCES} PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ)
endif()
if (GMX_GPU_CUDA)
# must suppress them.
GMX_TEST_CXXFLAG(CXXFLAGS_NO_ZERO_AS_NULL_POINTER_CONSTANT "-Wno-zero-as-null-pointer-constant" NVCC_CLANG_SUPPRESSIONS_CXXFLAGS)
- get_property(CUDA_SOURCES GLOBAL PROPERTY CUDA_SOURCES)
foreach(_compile_flag ${NVCC_CLANG_SUPPRESSIONS_CXXFLAGS})
- set_source_files_properties(${CUDA_SOURCES} PROPERTIES COMPILE_FLAGS ${_compile_flag})
+ set(GMX_CUDA_CLANG_FLAGS "${GMX_CUDA_CLANG_FLAGS} ${_compile_flag}")
endforeach()
+ if (GMX_CLANG_CUDA)
+ foreach (_file ${LIBGROMACS_SOURCES})
+ get_filename_component(_ext ${_file} EXT)
+ get_source_file_property(_cuda_source_format ${_file} CUDA_SOURCE_PROPERTY_FORMAT)
+ if ("${_ext}" STREQUAL ".cu" OR _cuda_source_format)
+ gmx_compile_cuda_file_with_clang(${_file})
+ endif()
+ endforeach()
+ else()
+ get_property(CUDA_SOURCES GLOBAL PROPERTY CUDA_SOURCES)
+ set_source_files_properties(${CUDA_SOURCES} PROPERTIES COMPILE_FLAGS ${GMX_CUDA_CLANG_FLAGS})
+ endif()
endif()
# Only add the -fsycl flag to sources that really need it