Example #1
0
/// Enqueue marker (with wait list) into the queue
inline event enqueue_marker(command_queue &q,
        const wait_list &events = wait_list())
{
    context_id ctx = get_context_id(q);
    wait_list my_events;

    std::copy_if(events.begin(), events.end(),
            std::back_inserter(my_events),
            [=](const event &e){ return ctx == get_context_id(e); });

    event e;
    q.enqueueMarkerWithWaitList(&my_events, &e);
    return e;
}