Andrea Cesari wrote:
> Hi, i done this and corrected to *int to simplify the problem:
> now the script is:

> from pycuda.compiler import SourceModule
> mod = SourceModule("""
> __global__ void thread_index(int *dest)
                               ^^^ This is the GPU's int type (32 bit)
> {
>   int i = threadIdx.x;
>     dest[i]=i;

> """)
> lung_vett=10
> thread_index = mod.get_function("thread_index")
> dest=numpy.zeros(lung_vett,dtype=numpy.int16);
                                   ^^^^^^^ This is an int type
                                   with 16 bits (AKA a short).

did you want

dest=numpy.zeros(lung_vett, dtype=numpy.int32)


Cheers,
Lawrence


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

Reply via email to