[PyOpenCL] Loading binary does not work

Matthias Vogelgesang matthias.vogelgesang at gmail.com
Mon Nov 21 12:09:20 PST 2011


Hi folks,

according to the reference, it should be possible to re-load the
output from a built program. However, the following short code is not
working

ctx = cl.create_some_context(False)
platform = cl.get_platforms()
device = platform[0].get_devices()[0]

program = cl.Program(ctx, """
__kernel void simple(__global float *in, __global float *out)
{
    out[get_global_id(0)] = in[get_global_id(0)];
}""")
program.build()
binary = program.get_info(cl.program_info.BINARIES)[0]

foo = cl.Program(ctx, [device], [binary])
# I cannot build ...
foo.build()
# ... nor call the kernel
foo.simple()

Is there something wrong with this code or PyOpenCL?

Regards,
Matthias

-- 
Matthias Vogelgesang
Public-Key: http://tinyurl.com/2qcydl



More information about the PyOpenCL mailing list