| 81 | } |
| 82 | |
| 83 | EXPORT_C_FUNC XResult CudaQueueCreate(HwQueueHandle *hwq, CUstream stream) |
| 84 | { |
| 85 | if (hwq == nullptr) { |
| 86 | XWARN("CudaQueueCreate failed: hwq is nullptr"); |
| 87 | return kXSchedErrorInvalidValue; |
| 88 | } |
| 89 | if (stream == nullptr) { |
| 90 | XWARN("CudaQueueCreate failed: does not support default stream"); |
| 91 | return kXSchedErrorNotSupported; |
| 92 | } |
| 93 | |
| 94 | HwQueueHandle hwq_h = GetHwQueueHandle(stream); |
| 95 | auto res = HwQueueManager::Add(hwq_h, [&]() { return xsched::cuda::CudaQueueCreate(stream); }); |
| 96 | if (res == kXSchedSuccess) *hwq = hwq_h; |
| 97 | return res; |
| 98 | } |
no test coverage detected