Closed GoogleCodeExporter closed 8 years ago
Issue 313 has been merged into this issue.
Original comment by jaredhoberock
on 28 Feb 2011 at 3:56
Original comment by jaredhoberock
on 28 Feb 2011 at 3:56
[deleted comment]
[deleted comment]
@filipe: It is possible, and I do just that myself all the time. The problem
here is that host_defines.h is part of CUDA. By default Thrust chooses a CUDA
backend . You need to select the OpenMP backend by adding #define
THRUST_DEVICE_BACKEND 2 at the top, in which case Thrust will not attempt to
include host_defines.h
Original comment by andrew.c...@gmail.com
on 28 Feb 2011 at 12:05
[deleted comment]
I see. So If want to use the CUDA and cpp files I can include the CUDA include
directory? It seems to work in this case.
Original comment by filipe.c...@gmail.com
on 28 Feb 2011 at 5:20
I too am making use of thrust in an environment where we're falling back to
OpenMP when CUDA isn't available.
The host_defines.h header isn't particularly nvcc specific and can be used with
GCC/OpenMP directly.
We've taken to shipping host_defines.h in our source tree as a workaround for
the moment until this issue is fixed.
Original comment by richware...@gmail.com
on 31 Mar 2011 at 11:57
I'm not convinced this is a bug. host_defines.h is only #included when CUDA is
being targeted [1]. It seems like any user targeting CUDA would necessarily
have this header on his system.
[1]
http://code.google.com/p/thrust/source/browse/thrust/detail/config/host_device.h
#25
Original comment by jaredhoberock
on 31 Mar 2011 at 6:06
Unfortunately, whenever the user is targeting the CUDA backend we can't safely
#define __host__ and __device__ ourselves since doing so can result in the
following error
/usr/local/cuda/include/host_defines.h:165:1: warning: "__device__" redefined
Here are two solutions:
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)
If you are not targeting the CUDA backend then you should define
THRUST_DEVICE_BACKEND as explained here [1].
[1] http://code.google.com/p/thrust/wiki/DeviceBackends
Original comment by wnbell
on 23 Aug 2011 at 4:20
Original issue reported on code.google.com by
filipe.c...@gmail.com
on 27 Feb 2011 at 6:40