Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

"Invalid global offset" error

Hi,

Is at actually possible to use offsets when enqueuing a kernel with Altera? I'm currently getting a "Invalid Global Offset" error when I try and specify an offset.

eg

size_t global_wi [2] = {100, 100};

size_t local_wi [2] = {100, 100};

size_t global_offset [2] = {1, 1};

err = clEnqueueNDRangeKernel(queue, kernel, 2, global_offset, global_wi, local_wi, 0, NULL, NULL);

With global_offset replaced with NULL, everything works correctly.

Many thanks

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    This is the first time I have heard of someone using that feature but according to the 1.0 spec it doesn't look like this is possible: http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clenqueuendrangekernel.html

    "Must currently be a NULL value. In a future revision of OpenCL, global_work_offset can be used to specify an array of work_dim unsigned values that describe the offset used to calculate the global ID of a work-item instead of having the global IDs always start at offset (0, 0,... 0)."
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks for the response. I'd been working from OpenCL v1.1, apologies. I'll switch back to v1.0.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Over time the supported spec version will increase. The offset you are attempting to pass in probably can become just another kernel argument that you need to add to the global ID within your kernel.