Daniel Jeck <djeck1(a)jhmi.edu> 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
a_gpu = gpuarray.to_gpu(numpy.zeros((100,100)))
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