> Am 04.04.2016 um 21:50 schrieb Martin Weigert <[email protected]>:
> 
> Hi all,
> 
> Since updating to version 2015.2.4. some of the image creation/reading 
> function that use to work are throwing errors on my machine.
> 
> Specifically, running the following minimal code that creates an OpenCL Image 
> from an array and reads it back:
> 
> 
>    #--------------code
>    from __future__ import print_function
>    import numpy as np
>    import pyopencl as cl
> 
>    ctx = cl.create_some_context(interactive=False)
>    queue = cl.CommandQueue(ctx)
> 
>    data = np.random.randn(100,100).astype(np.float32)
> 
>    im = cl.image_from_array(ctx, np.asarray(data))
> 
>    out = np.empty_like(data)
> 
>    cl.enqueue_copy(queue,out,im, origin  = (0,0), region = (100,100))
> 
>    print(np.allclose(data,out))
>    #--------------/code
> 
> 
> results in the following error*
> 
>    pyopencl.cffi_cl.RuntimeError: clcreateimage failed: 
> IMAGE_FORMAT_NOT_SUPPORTED
> 
> 
> The same code runs just fine with version 2015.1.
> 
> Can anybody else confirm that issue and are there any thoughts where that 
> error might originate from?

Can (partly) confirm this on os x 10.11.4, if I choose the CPU as device. This 
device does not support the ImageFormat(R, FLOAT), which gets selected to match 
the array type. Call

cl.get_supported_image_formats(ctx, cl.mem_flags.READ_ONLY, 
cl.mem_object_type.IMAGE2D)

to see the supported image formats. 

On my laptop suitable formats would be for the different devices:

<pyopencl.Device 'Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz' on 'Apple' at 
0xffffffff>
ImageFormat(INTENSITY, FLOAT),
ImageFormat(Rx, FLOAT),

<pyopencl.Context at 0x104f35a50 on <pyopencl.Device 'Iris Pro' on 'Apple' at 
0x1024500>>
ImageFormat(R, FLOAT),
ImageFormat(A, FLOAT),
ImageFormat(INTENSITY, FLOAT),

<pyopencl.Device 'GeForce GT 750M' on 'Apple' at 0x1022700>
ImageFormat(R, FLOAT),
 ImageFormat(LUMINANCE, FLOAT),
 ImageFormat(INTENSITY, FLOAT),

Note, only images with 4 channels are guaranteed to be supported on all 
systems, so it was just by luck that you had success with your code snippet in 
previous versions.

Gregor



> 
> Thanks very much for any help!
> 
> Martin
> 
> 
> *both on
> Mac OS 10.10, Intel Iris, OpenCL 1.2., pyopencl 2015.2.4
> Ubuntu 14.04, Titan X, OpenCL 1.2, pyopencl 2015.2.4
> 
> 
> 
> 
> _______________________________________________
> PyOpenCL mailing list
> [email protected]
> https://lists.tiker.net/listinfo/pyopencl


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

Reply via email to