[PyOpenCL] Problem with transfer with cast to float32 using ATI Stream SDK

Andreas Kloeckner lists at informa.tiker.net
Mon Nov 22 07:22:11 PST 2010


Hi Jan,

On Mon, 22 Nov 2010 09:04:03 +0100, "Meinke, Jan" <j.meinke at fz-juelich.de> wrote:
> I have a problem with PyOpenCL using the ATI Stream SDK 2.2. I have a
> double precision ndarray a. I'm casting it to single precision using
> 
> a.astype(np.float32) before I transfer it to the device. If I allocate
> the buffer a_dev using the COPY_HOST_PTR flag and
> hostbuf=a.astype(np.float32) everything works fine, but if I first
> allocate memory and then use enqueue_write_buffer to transfer the
> data, the first couple of entries on the device contain junk. Starting
> with a_dev[4] (32 bit) or a_dev[8] (64 bit) everything is correct
> again. The problem occurs no matter if the device is a CPU or GPU. It
> does not show up with the NVIDIA SDK.

Are both the computation and the transfer in the same command queue? Are
you passing 'True' for is_blocking? (Alternatively--do you wait for the
write to complete?) Can you post sample code to reproduce?

HTH,
Andreas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.tiker.net/pipermail/pyopencl/attachments/20101122/22fde060/attachment.pgp>


More information about the PyOpenCL mailing list