Results 1 to 4 of 4

Thread: Strange Bug

  1. #1

    Strange Bug

    Hey,

    the following small example shows a bug that shows up in a kernel:

    Code :
    kernel void example_kernel (global read_only float* some_input_data, global read_only unsigned int* index_to_data, global write_only float* some_output_data) {
     
            unsigned int lid = get_local_id (0);
            some_output_data [lid] = source_data [index_to_data [lid]];//error
            //some_output_data [lid] = source_data ["place literal of index_to_data [lid] here"];//ok
            //some_output_data [lid] = index_to_data [lid]; //ok, shows correct index
    }

    What could be the reason for this error? I'm pretty clueless here.

  2. #2
    Member
    Join Date
    Oct 2010
    Location
    Vancouver, Canada
    Posts
    65

    Re: Strange Bug

    It would help if you told us what the error was.

  3. #3

    Re: Strange Bug

    I get a CL_INVALID_COMMAND_QUEUE error on call to clFinish (my_command_queue) right after launching the above kernel.

  4. #4

    Re: Strange Bug

    Eventually I found the bug: I was writing to out-of-range indices in the some_output_data buffer. It's still a bit strange why it didn't crash in the other two cases.

Similar Threads

  1. Really strange gl texture write bug
    By cpugh in forum OpenCL
    Replies: 1
    Last Post: 02-16-2011, 04:41 PM

Posting Permissions

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