Setup CUDA within autotools
In f481f770 I tried to start on the CUDA compilation as part of autotools, but mostly I'm completely lost with what I should add.
There are 2 files that need compiling, in src/CUDA/*.cu
.
I added a few lines to configure.ac which should detect whether CUDA is present or not, but I'm not sure entirely how to then get it to compile from there. In src/Makefile.am I want to add something like:
# CUDA sources
if HAVECUDA
SOURCES_CUDA = ...
CUDA_MYFLAGS = -O3 -g -lineinfo -src-in-ptx --maxrregcount=32 -ftz=true -DWITH_CUDA
.cu: ... *.h
.cu.o:
$(NVCC) -c $(NVCCFLAGS) $(CUDA_CFLAGS) $(CUDA_MYFLAGS) $< -o $@
.cu.lo:
$(top_srcdir)/cudalt.py $@ $(NVCC) -c $(NVCCFLAGS) $(CUDA_CFLAGS) $(CUDA_MYFLAGS) $<
else
SOURCES_CUDA =
endif
(taken from mdcore as well) however I'm not sure what I should then do. I could just add them to AM_SOURCES and define the separate rules for .cu? Maybe its better to try to have an m4 macro instead? @pdraper any ideas?