← Back to team overview

dolfin team mailing list archive

[Question #117816]: Adding support for compiling NVIDIA CUDA .cu files with nvcc to DOLFIN build system

 

New question #117816 on DOLFIN:
https://answers.launchpad.net/dolfin/+question/117816

Hi,

I want to add some CUDA code to my custom DOLFIN branch and hope to get some help on how to integrate that into the DOLFIN build process. Currently I compile all my .cu files separately and link them to a shared library which I then link against my application next to libdolfin. However I would like to integrate this code more tightly and not have to work with two separate libraries. Especially when it comes to la backends, I need to couple this code to DOLFIN in order to use it with the same syntax and semantics.

More concise, my question is: which part the DOLFIN build system would I need to touch to integrate support for compiling .cu files with nvcc?

For using nvcc and the CUDA runtime with SCons I use a custom tool. Since it seems not possible to attach files to questions I'll send it to the mailing list later if that's useful.

I made one attempt to build DOLFIN entirely with nvcc, but that failed due to some shortcomings in nvcc and bugs with gcc integration (nvcc is a compiler driver, it basically splits the code into CUDA code handled by the NVIDIA compiler cudafe and C++ code passed to gcc, but this still doesn't work reliably). So I assume the best way to go is to keep using mpicxx for all the cpp files and only use nvcc for cu files.

Florian

-- 
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.