Choose GCC or NVCC compiler depending on the environment

Adapted from https://github.com/dubzzz/cuda-compile-4-cuda-and-noncuda

The idea was to be able, to use the "same" code for both CUDA and pure-C/C++ versions.

* When compiling on a computer without nvcc on it, the code depending on CUDA will be removed and the remaining part is given to gcc.
* Some people can have CUDA installed on their machine without having any compatible GPU.
  For that reason, CUDA code has a CPU version (for people having libcudart.so but not the required GPU) and a CUDA version (for CUDA users)