I've created this simple test

#!/usr/bin/env python
#-*- coding: utf-8 -*-

import pyopencl as cl
import numpy as np

ELEMENTS = 257

KERNEL = """
__kernel void test(__global const int *a,
                   const int asize
                  )
{
    int agid = get_global_id(0);
    if (agid==0)
        for(int i=0; i < asize; i++)
            printf("agid:%u, i:%i, asize:%u\\n", agid, i, asize);
}
"""

a = np.random.randint(-1595081346, 1595081346, ELEMENTS).astype(np.int32)

for platform in cl.get_platforms():
    for device in platform.get_devices():
        if cl.device_type.to_string(device.type) == 'GPU':
            ctx = cl.Context([device])
            queue = cl.CommandQueue(ctx)
            mf = cl.mem_flags
            a_buf = cl.Buffer(ctx, mf.READ_ONLY | mf.COPY_HOST_PTR,
hostbuf=a)
            prg = cl.Program(ctx, KERNEL).build()
            exec_evt = prg.test(queue, (ELEMENTS,), None, a_buf,
np.int32(a.size))
            exec_evt.wait()

The tail output is:

agid:0, i:252, asize:257
agid:0, i:253, asize:257
agid:0, i:254, asize:257
agid:0, i:0, asize:4294374642

I'm running pyopencl 2014.1, with an R7 260x.
Why cannot process the 255 value? (with the CPU works fine) Is a problem
with the work group size?

Thanks
_______________________________________________
PyOpenCL mailing list
[email protected]
http://lists.tiker.net/listinfo/pyopencl

Reply via email to