Results 1 to 2 of 2

Thread: Re-using cl_event objects for event_wait_list pointers

  1. #1
    Junior Member
    Join Date
    Jan 2010
    Posts
    1

    Re-using cl_event objects for event_wait_list pointers

    Once an event_wait_list pointer is passed to a clEnqueue* function (and the function returns CL_SUCCESS) can the cl_event objects pointed to by event_wait_list be re-assigned to new events, or should none of them be touched until all commands enqueued with that wait list have finished?

    For example, say I wanted to enqueue pairs of kernels in a loop (kernel B depends kernel A):

    Code :
    cl_command_queue queue;
    size_t gws, lws;
    cl_kernel kernel_A, kernel_B;
    ...
    cl_event e;
    for(int i = 0; i < N; ++i) {
        clEnqueueNDRangeKernel(queue, kernel_A, 1, NULL, &gws, &lws, 0, NULL, &e);
        clEnqueueNDRangeKernel(queue, kernel_B, 1, NULL, &gws, &lws, 1, &e, NULL);
        clReleaseEvent(e);
    }

    Is this code safe? Or will re-using the cl_event handle corrupt the existing wait lists?

  2. #2
    Senior Member
    Join Date
    Jul 2009
    Location
    Northern Europe
    Posts
    311

    Re: Re-using cl_event objects for event_wait_list pointers

    That should be fine as far as I know. I've done things like that without problems on Mac OS X, at least.

Similar Threads

  1. Releasing cl_event s
    By giridhart in forum OpenCL
    Replies: 1
    Last Post: 07-20-2012, 08:31 AM
  2. Pointers to Pointers
    By IRWolfie- in forum OpenCL
    Replies: 2
    Last Post: 04-05-2011, 05:00 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
  •