/// 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; }
/// Wait for events in the list inline void wait_for_events(const wait_list &events) { std::map<context_id, wait_list> by_context; for(auto e = events.begin(); e != events.end(); ++e) { context_id ctx = get_context_id(*e); by_context[ctx].push_back(*e); } for(auto c = by_context.begin(); c != by_context.end(); ++c) cl::Event::waitForEvents(c->second); }
} context_array[index] = IPC_getContext(); return index; } static void robot_frontlaser_interface_handler(MSG_INSTANCE msgRef, BYTE_ARRAY callData, void *clientData __attribute ((unused))) { FORMATTER_PTR formatter; IPC_RETURN_TYPE err = IPC_OK; int context_id; context_id = get_context_id(); if (context_id < 0) { carmen_warn("Bug detected: invalid context\n"); IPC_freeByteArray(callData); return; } formatter = IPC_msgInstanceFormatter(msgRef); if (frontlaser_msg[context_id]) { if(frontlaser_msg[context_id]->range != NULL) free(frontlaser_msg[context_id]->range); if(frontlaser_msg[context_id]->tooclose != NULL)