allendaicool / thrust

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

optimize handling of device_vector in .cpp source files #143

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently allocating a device_vector in a .cpp file will always initialize
a temporary host_vector and perform a costly host->device copy.  For
primitive types using the default initializer T() it is probably
sufficient, and considerably faster, to initialize the bytes of the array
to 0 with cudaMemset().

This presumes that T() is byte-wise 0, which may not be universally true
(check the standard).  If it is not true, then we can at least check at
runtime and dispatch the optimized path.

Related thread on thrust-users:
http://groups.google.com/group/thrust-users/browse_thread/thread/d292b1146895ee2
a

Original issue reported on code.google.com by wnbell on 15 May 2010 at 4:06

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

Original comment by jaredhoberock on 6 Aug 2010 at 11:30

GoogleCodeExporter commented 9 years ago
Issue 56 has been merged into this issue.

Original comment by wnbell on 7 Aug 2010 at 12:23