Enable compiling CUDA device code with clang
clang can be used as a device compiler by setting GMX_CLANG_CUDA=ON. A
CUDA toolkit (>=7.0) is also needed. Workarounds required:
- texture operations are not supported, use the LDG/direct load-based
fallback in such cases;
- CMake does not support natively clang for CUDA, but it's easy to
convince it by setting CXX as compiler and few extra flags for *.cu.
Note that clang support is experimental and it is aimed at improving
portability and to allow using clang sanitizers without hassle in
CUDA builds.
TODO/investigate:
- CMake seems to not track some files properly with clang, changes
to nbnxn_cuda_kernel{,_fermi}.cuh do not trigger a recompile (likely
due to the indirect include through a macro in nbnxn_cuda_kernels.cuh).
- Full rebuild is triggered even if only CUDA compile flags are changed.
Change-Id: I3543469d9f0fda37c186ba8bb474980018bd5c54
15 files changed: