Beispiel #1
0
/// Enqueue barrier (with wait list) into the queue
inline event enqueue_barrier(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.enqueueBarrierWithWaitList(&my_events, &e);
    return e;
}