Results 1 to 2 of 2

Thread: get_global_id returns too high numbers

  1. #1
    Newbie
    Join Date
    Oct 2017
    Posts
    1

    get_global_id returns too high numbers

    Hello,
    I wrote a simple kernel where I'm calling get_global_id(0) and print this number on the screen. The host application runs this kernel in the loop only just to look what happens and I get strange result on the screen - I have set only 256 work-items in clEnqueueNDRangeKernel(..) where global_work_size = 256 and local_work_size = 256 , but sometimes it prints also the numbers from 256 to 511. I don't understand why, it looks like there is running more than 256 threads...any idea why?
    Thank you.
    Last edited by skeletounek; 10-07-2017 at 04:54 AM.

  2. #2
    Junior Member
    Join Date
    Sep 2012
    Posts
    22
    You must have given 256 as offset parameter too. That adds that number to all workitems' global id values. If there is no multiple gpus, you may not need that value to be other than zero.

    cl_int clEnqueueNDRangeKernel ( cl_command_queue command_queue,
    cl_kernel kernel,
    cl_uint work_dim,
    const size_t *global_work_offset, <------ this pointed value should be zero
    const size_t *global_work_size,
    const size_t *local_work_size,
    cl_uint num_events_in_wait_list,
    const cl_event *event_wait_list,
    cl_event *event)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean