aa916c2daf60da1f2dfd98aa553a0f5c6a10bbba
[alexxy/gromacs.git] / src / gromacs / ewald / CMakeLists.txt
1 #
2 # This file is part of the GROMACS molecular simulation package.
3 #
4 # Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
5 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 # and including many others, as listed in the AUTHORS file in the
7 # top-level source directory and at http://www.gromacs.org.
8 #
9 # GROMACS is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU Lesser General Public License
11 # as published by the Free Software Foundation; either version 2.1
12 # of the License, or (at your option) any later version.
13 #
14 # GROMACS is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 # Lesser General Public License for more details.
18 #
19 # You should have received a copy of the GNU Lesser General Public
20 # License along with GROMACS; if not, see
21 # http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
23 #
24 # If you want to redistribute modifications to GROMACS, please
25 # consider that scientific software is very special. Version
26 # control is crucial - bugs must be traceable. We will be happy to
27 # consider code for inclusion in the official distribution, but
28 # derived work must not be called official GROMACS. Details are found
29 # in the README & COPYING files - if they are missing, get the
30 # official version at http://www.gromacs.org.
31 #
32 # To help us fund GROMACS development, we humbly ask that you cite
33 # the research papers on the package. Check out http://www.gromacs.org.
34
35 gmx_add_libgromacs_sources(
36     calculate-spline-moduli.cpp
37     ewald.cpp
38     ewald-utils.cpp
39     long-range-correction.cpp
40     pme.cpp
41     pme-gather.cpp
42     pme-grid.cpp
43     pme-load-balancing.cpp
44     pme-only.cpp
45     pme-pp.cpp
46     pme-redistribute.cpp
47     pme-solve.cpp
48     pme-spline-work.cpp
49     pme-spread.cpp
50     # Files that implement stubs
51     pme-gpu-program.cpp
52     )
53 if (GMX_USE_CUDA)
54     gmx_add_libgromacs_sources(
55         # CUDA-specific sources
56         pme-gather.cu
57         pme-gpu-3dfft.cu
58         pme-solve.cu
59         pme-spread.cu
60         pme-gpu-program-impl.cu
61         # GPU-specific sources
62         pme-gpu.cpp
63         pme-gpu-internal.cpp
64         pme-gpu-timings.cpp
65         )
66     gmx_compile_cpp_as_cuda(
67         pme-gpu-internal.cpp
68         pme-gpu-program.cpp
69         pme-gpu-timings.cpp
70         )
71 elseif (GMX_USE_OPENCL)
72     gmx_add_libgromacs_sources(
73         # OpenCL-specific sources
74         pme-gpu-3dfft-ocl.cpp
75         pme-gpu-program-impl-ocl.cpp
76         # GPU-specific sources
77         pme-gpu.cpp
78         pme-gpu-internal.cpp
79         pme-gpu-timings.cpp
80         )
81     file(GLOB EWALD_OPENCL_RUNTIME_SOURCES pme-spread.clh pme-solve.clh pme-gather.clh pme-gpu-utils.clh pme-program.cl pme-gpu-types.h)
82     set(MDLIB_OPENCL_KERNELS ${MDLIB_OPENCL_KERNELS} ${EWALD_OPENCL_RUNTIME_SOURCES} PARENT_SCOPE)
83 else()
84     gmx_add_libgromacs_sources(
85         # Files that implement stubs
86         pme-gpu-program-impl.cpp
87         )
88 endif()
89
90 if (BUILD_TESTING)
91     add_subdirectory(tests)
92 endif()