Closed GoogleCodeExporter closed 8 years ago
I think I've tracked down the issue to this line:
thrust/detail/device/cuda/fill.inl(196):
if(std::strncmp(reinterpret_cast<const char*>(&value), reinterpret_cast<const char*>(&zero), sizeof(T)) == 0)
I think the strncmp statement stops at the first zero-char encountered and does
not check all the bytes in a float. Perhaps using memcmp() would be the correct
thing to do here.
Original comment by george.v...@organicvectory.com
on 19 Apr 2011 at 9:02
Hi George, thanks for reporting and tracking down the bug. I think it's been
fixed [1] since version 1.3.
Could you confirm that your code works correctly with version 1.4? You can get
it with Mercurial:
$ hg clone http://thrust.googlecode.com/hg -r 1.4.0 thrust-1.4
[1]
http://code.google.com/p/thrust/source/detail?r=a2e913c7ed831c9cf155c4cac43397eb
dd131ce6&path=/thrust/detail/backend/cuda/fill.inl
Original comment by jaredhoberock
on 19 Apr 2011 at 11:40
I have tested the code with Cuda 4.0 and thrust 1.4.0. The only change I had to
make was to compile with nvcc as the assign now leads to a kernel launch,
whereas the original version could run without requiring a kernel launch.
So the fix is confirmed, thanks for your quick response.
Original comment by george.v...@organicvectory.com
on 21 Apr 2011 at 9:40
Original comment by jaredhoberock
on 21 Apr 2011 at 6:24
Original issue reported on code.google.com by
george.v...@organicvectory.com
on 19 Apr 2011 at 8:42Attachments: