···6363}
64646565// @todo: add support for semaphore or other synchronization.
6666-void amdgpu_submit(KesQueue pq, KesCommandList pcl) {
6666+void amdgpu_submit(KesQueue pq, KesCommandList pcl, KesSemaphore ps, uint64_t value) {
6767 auto *queue = reinterpret_cast<QueueImpl *>(pq);
6868 auto *cl = reinterpret_cast<CommandListImpl *>(pcl);
6969+ auto *sem = reinterpret_cast<SemaphoreImpl *>(ps);
6970 assert(cl->queue == queue, "submit: commandlist from foreign queue");
70717171- queue->cmd_ring->submit(cl->cs); //, semaphore, value);
7272+ queue->cmd_ring->submit(cl->cs, sem, value);
72737374 // @todo: to free commandlist, we want to be sure that it is no longer mapped and stuff.
7475 // then, we can freely-free it. But i think this needs some deferred-cleanup, as
···3131typedef void *KesCommandList;
32323333/**
3434+ * Opaque handle to a Semaphore.
3535+ */
3636+typedef void *KesSemaphore;
3737+3838+/**
3439 * Structure describing a memory allocation.
3540 * @sa kes_malloc
3641 */
···235240 * @param queue The queue to submit the command list to. Must be the queue that the command list was created for.
236241 * @param command_list The command list to submit.
237242 */
238238-void kes_submit(KesQueue queue, KesCommandList command_list);
243243+void kes_submit(KesQueue queue, KesCommandList command_list, KesSemaphore semaphore, uint64_t value);
239244240245/**
241246 * Record a memory set command in the command list.
···312317 */
313318void kes_cmd_dispatch_indirect(KesCommandList command_list, kes_gpuptr_t data, kes_gpuptr_t command_addr);
314319320320+KesSemaphore kes_create_semaphore(KesDevice device, uint64_t value);
321321+322322+int kes_wait_semaphore(KesSemaphore semaphore, uint64_t value);
315323316324#ifdef __cplusplus
317325}