Dear Danny,

Daniel Jeck <[email protected]> writes:
> My name is Danny Jeck. I don't really want to subscribe to the mailing list 
> for pycuda, but I thought I should point out to you that the following code 
> creates an error
>
>
> import pycuda.gpuarray as gpuarray
>
> import pycuda.driver as cuda
>
> import pycuda.autoinit
>
> import numpy
>
>
> a_gpu = gpuarray.to_gpu(numpy.zeros((100,100)))
>
>
> print a_gpu>0
>
>
> The error is because 0 (or a float or whatever) doesn't have a shape, and if 
> it does it isn't the same shape as the array. If this were a numpy array, the 
> 0 would be "broadcast" to the rest of the larger array for comparison. You 
> may want to include this in future versions.

Your code works for me using current git (and I'm quite sure it should
also work with the latest release). What version do you have?

>>> import pycuda
>>> print pycuda.VERSION

Andreas

Attachment: pgpSXEOFtrXz2.pgp
Description: PGP signature

_______________________________________________
PyCUDA mailing list
[email protected]
http://lists.tiker.net/listinfo/pycuda

Reply via email to