imprsnt / cuda-waste

Automatically exported from code.google.com/p/cuda-waste
0 stars 0 forks source link

Printf in kernel using 64-bit Waste does not work #9

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Performing a printf in the kernel used to work fine, but doesn't work in 64-bit 
mode if the target GPU is 32-bit.  (There's a switch for NVCC to set the target 
word size.)  In Waste, vprintf is called directly on a stack that is created 
via PTX.  Since the emulation code is 64-bit, and the PTX is 32-bit, the 
parameters constructed for vprintf are too small, and the vprintf prints out 
garbage.

To get this to work, Waste has to either work in 32-bits on a 32-bit PTX target 
(and 64-bits for a 64-bit target), or Waste must implement a vprintf that takes 
into account the word size of the target.

Original issue reported on code.google.com by Ken.Dom...@gmail.com on 11 Jun 2013 at 1:21

GoogleCodeExporter commented 8 years ago
int and long are still 32-bits in a 64-bit host; pointers are 64-bit, but PTX 
seems to know how to compile for a 32-bit GPU target.

Original comment by Ken.Dom...@gmail.com on 11 Jun 2013 at 2:29

GoogleCodeExporter commented 8 years ago

Original comment by Ken.Dom...@gmail.com on 11 Jun 2013 at 2:29

GoogleCodeExporter commented 8 years ago
Fixed in r184.

Original comment by Ken.Dom...@gmail.com on 19 Jun 2013 at 11:11