allendaicool / thrust

Automatically exported from code.google.com/p/thrust
Apache License 2.0
0 stars 0 forks source link

Test Thrust with --device-emulation #41

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
We should build a separate testing pass for --device-emulation.  The data
sizes need not be so large.

Original issue reported on code.google.com by jaredhoberock on 17 Sep 2009 at 11:12

GoogleCodeExporter commented 9 years ago
Hi, while trying to build my Thrust-enabled CUDA project on my non-cuda capable
laptop I encountered the following compile error. In order to get to its root I
checked out the latest Thrust version from svn, which is also affected by it.

Using nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2009 NVIDIA Corporation
Built on Thu_Jul__2_10:56:25_PDT_2009
Cuda compilation tools, release 2.3, V0.2.1221

Thrust 1.1 as well as HEAD run into the following compile error:
========================================================
Thrust/testing$ scons
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
nvcc -o binary_search.o -c -DTHRUST_DEVICE_BACKEND=THRUST_CUDA
-optf=../build/nvcc_options_file.txt -Xcompiler -O2 -Xcompiler
-DTHRUST_DEVICE_BACKEND=THRUST_CUDA -I /usr/local/cuda/include -I
/home/data/Studium/10_Semester/Masterarbeit/src/Thrust -I
/home/data/Studium/10_Semester/Masterarbeit/src/Thrust/testing binary_search.cu
nvcc -o constant_iterator.o -c -DTHRUST_DEVICE_BACKEND=THRUST_CUDA
-optf=../build/nvcc_options_file.txt -Xcompiler -O2 -Xcompiler
-DTHRUST_DEVICE_BACKEND=THRUST_CUDA -I /usr/local/cuda/include -I
/home/data/Studium/10_Semester/Masterarbeit/src/Thrust -I
/home/data/Studium/10_Semester/Masterarbeit/src/Thrust/testing 
constant_iterator.cu
nvcc -o copy.o -c -DTHRUST_DEVICE_BACKEND=THRUST_CUDA
-optf=../build/nvcc_options_file.txt -Xcompiler -O2 -Xcompiler
-DTHRUST_DEVICE_BACKEND=THRUST_CUDA -I /usr/local/cuda/include -I
/home/data/Studium/10_Semester/Masterarbeit/src/Thrust -I
/home/data/Studium/10_Semester/Masterarbeit/src/Thrust/testing copy.cu
In file included from /tmp/tmpxft_00004be7_00000000-1_copy.cudafe1.stub.c:5,
                 from copy.cu:340:
/usr/local/cuda/bin/../include/thrust/detail/vector_base.inl: In function 'void
__cuda_emu::__cuda_host_device__ZN6thrust6detail11vector_baseIiNS_23device_mallo
c_allocatorIiEEEixEj(__cuda_emu::_ZN6thrust6detail11vector_baseIiNS_23device_mal
loc_allocatorIiEEE9referenceE*,
__cuda_emu::_ZN6thrust6detail11vector_baseIiNS_23device_malloc_allocatorIiEEEE*,
__cuda_emu::_ZN6thrust6detail11vector_baseIiNS_23device_malloc_allocatorIiEEE9si
ze_typeE)':
/usr/local/cuda/bin/../include/thrust/detail/vector_base.inl:294: error:
'_ZN6thrust16device_referenceIiEC1ERKNS_10device_ptrIiEE' was not declared in 
this scope
/usr/local/cuda/bin/../include/thrust/detail/vector_base.inl: In function 'void
__cuda_emu::__cuda_host_device__ZN6thrust6detail11vector_baseIbNS_23device_mallo
c_allocatorIbEEEixEj(__cuda_emu::_ZN6thrust6detail11vector_baseIbNS_23device_mal
loc_allocatorIbEEE9referenceE*,
__cuda_emu::_ZN6thrust6detail11vector_baseIbNS_23device_malloc_allocatorIbEEEE*,
__cuda_emu::_ZN6thrust6detail11vector_baseIbNS_23device_malloc_allocatorIbEEE9si
ze_typeE)':
/usr/local/cuda/bin/../include/thrust/detail/vector_base.inl:294: error:
'_ZN6thrust16device_referenceIbEC1ERKNS_10device_ptrIbEE' was not declared in 
this scope
scons: *** [copy.o] Error 255
========================================================

Note in order to get this far, I added the '-deviceemu' option to the
nvcc_option_file.txt and removed the arch.cu test.

Unfortunately I am not an expert on C++ as well as CUDA and hence wasn't able 
to get
some sensible meaning out of the error message. But it seems to me that this 
error is
Thrust-related.

Any help is appreciated ;-)
 Marius

Original comment by MariusHe...@googlemail.com on 29 Nov 2009 at 11:30

GoogleCodeExporter commented 9 years ago
Hi Marius,

We are aware of the problems with --device_emulation.  Unfortunately,
these are nvcc issues that cannot be worked around [1].  You may be
interested to know that we are working on an OpenMP backend for Thrust
that would provide some (but not all) of the functionality provided by
--device_emulation

Anyway, thanks for the report.  We'll make a post to thrust-users when the 
OpenMP
backend is ready.

[1]
http://groups.google.com/group/thrust-users/browse_thread/thread/46c9531180856e4
3/a44141e439d841ba?#a44141e439d841ba

Original comment by wnbell on 29 Nov 2009 at 8:01

GoogleCodeExporter commented 9 years ago
We should check for __DEVICE_EMULATION__ in thrust/detail/config.h and generate 
a
compile time #error if necessary.

Original comment by wnbell on 8 Dec 2009 at 12:09

GoogleCodeExporter commented 9 years ago
Instead of an error, we should probably just generate a warning because there 
are 
known WARs for this problem.

Original comment by jaredhoberock on 25 Jan 2010 at 11:12

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r790.

Original comment by wnbell on 7 Feb 2010 at 2:09