| 454 | } |
| 455 | |
| 456 | CGPUQueueId cgpu_get_queue(CGPUDeviceId device, ECGPUQueueType type, uint32_t index) |
| 457 | { |
| 458 | cgpu_assert(device != CGPU_NULLPTR && "fatal: call on NULL device!"); |
| 459 | cgpu_assert(device->proc_table_cache->free_device && "free_device Proc Missing!"); |
| 460 | |
| 461 | CGPUQueueId created = cgpu_runtime_table_try_get_queue(device, type, index); |
| 462 | if (created != NULL) |
| 463 | { |
| 464 | cgpu_warn("You should not call cgpu_get_queue " |
| 465 | "with a specific index & type for multiple times!\n" |
| 466 | " Please get for only once and reuse the handle!\n"); |
| 467 | return created; |
| 468 | } |
| 469 | CGPUQueue* queue = (CGPUQueue*)device->proc_table_cache->get_queue(device, type, index); |
| 470 | queue->index = index; |
| 471 | queue->type = type; |
| 472 | queue->device = device; |
| 473 | cgpu_runtime_table_add_queue(queue, type, index); |
| 474 | return queue; |
| 475 | } |
| 476 | |
| 477 | void cgpu_submit_queue(CGPUQueueId queue, const struct CGPUQueueSubmitDescriptor* desc) |
| 478 | { |