thrust/thrust — pull request #381 by slayoo (2013-07-11 10:17:01+00:00)
Title: make CUDA the default backend only if using nvcc

This fixes the issue described here:
http://code.google.com/p/thrust/issues/detail?id=312

The two suggested solutions are:
1) compile the .cpp files with nvcc
2) supply the path to the CUDA headers to the host compiler (e.g. g++ -I /usr/local/cuda/include)

Both require CUDA to be installed on the system.

Defining THRUST_DEVICE_BACKEND fixes the problem for users with no CUDA files on the system, but it conflicts with using multiple backends in one translation unit as mentioned here:
https://groups.google.com/forum/#!msg/thrust-users/r_aorLOXnpI/wLjQmFKMOFcJ

HTH,
Sylwester