Results 1 to 5 of 5

Thread: Array of image_Xt objects as parameter?

  1. #1
    Junior Member
    Join Date
    Aug 2011
    Posts
    8

    Array of image_Xt objects as parameter?

    Hi,

    I am trying to develop a kernel, that relies on an arbitrary amount of image parameters (within the CL_DEVICE_MAX_READ_IMAGE_ARGS amount). Since I only know how many images I have when providing my kernel input data, I was wondering if it is possible to do something like this:

    Code :
    __kernel void test(__global image2d_t * images,
                       __global float2 * texcoord,
                       sampler_t sampler,
                       __global float4 * output 
                       )
    {
    	int idx = get_global_id(0);
        float2 lookup = texcoord[idx];
     
        float4 texLookup = read_imagef(images[idx], sampler, lookup);
        output[idx] = texLookup;
    }
    When I try compiling this (Mac OSX 10.7, OpenCL 1.1) I get the following build errors:
    - on the CPU (Intel Xeon)
    cvmsErrorCompilerFailure: LLVM compiler has crashed or hung compiling a function.
    - on my GPU (AMD Radeon HD 5870) it first compiles forever (> 15s, compared to bigger kernels compiling instantly) and then my build log contains the following
    Error getting function data from server
    So my question here is: are these errors a result of me using an array of images, or am I just using wrong syntax.
    If it is just wrong syntax, what would be the right one? I only could find out, that samplers are not supposed to be put into an array, so I assumed textures should be possible.
    If it is not possible to have an array of images, is there a workaround I could use (I'd rather avoid passing the data as plain arrays instead of textures and code my own texture lookup)?

    Thank you
    Herbert

    PS: I use the C++ wrapper for OpenCL as defined in the cl.hpp, if that could make a difference.

  2. #2
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: Array of image_Xt objects as parameter?

    Since I only know how many images I have when providing my kernel input data, I was wondering if it is possible to do something like this
    Unfortunately, pointers to image2d_t or image3d_t are not allowed.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

  3. #3
    Junior Member
    Join Date
    Aug 2011
    Posts
    8

    Re: Array of image_Xt objects as parameter?

    So that means it is not possible in any way to have them in an array, am I right?
    Does anybody have the same problem and an idea of a workaround?

    Thank you
    Herbert

  4. #4
    Senior Member
    Join Date
    May 2010
    Location
    Toronto, Canada
    Posts
    845

    Re: Array of image_Xt objects as parameter?

    Sorry I didn't reply to you earlier. As you may have already seen, image arrays are a new feature of OpenCL 1.2. I couldn't disclose this information at the time.
    Disclaimer: Employee of Qualcomm Canada. Any opinions expressed here are personal and do not necessarily reflect the views of my employer. LinkedIn profile.

  5. #5
    Junior Member
    Join Date
    Aug 2011
    Posts
    8

    Re: Array of image_Xt objects as parameter?

    Hi, yes I have seen that. Unfortunately I am still stuck with 1.1 on Lion, but I found a workaround (by sampling an array by myself).
    Thank you!

Similar Threads

  1. Array of images as kernel parameter
    By pelotoescogorciao in forum Suggestions for next release
    Replies: 0
    Last Post: 01-05-2013, 11:15 AM
  2. Using the cl_context_properties parameter
    By riven609 in forum OpenCL
    Replies: 1
    Last Post: 07-21-2009, 11:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •