| 35 | } |
| 36 | |
| 37 | EXPORT_C_FUNC XResult AclQueueCreate(HwQueueHandle *hwq, aclrtStream stream) |
| 38 | { |
| 39 | if (hwq == nullptr) { |
| 40 | XWARN("AclQueueCreate failed: hwq is nullptr"); |
| 41 | return kXSchedErrorInvalidValue; |
| 42 | } |
| 43 | if (stream == nullptr) { |
| 44 | XWARN("AclQueueCreate failed: stream is nullptr"); |
| 45 | return kXSchedErrorInvalidValue; |
| 46 | } |
| 47 | |
| 48 | HwQueueHandle hwq_h = GetHwQueueHandle(stream); |
| 49 | auto res = HwQueueManager::Add(hwq_h, [&]() { return std::make_shared<AclQueue>(stream); }); |
| 50 | if (res == kXSchedSuccess) *hwq = hwq_h; |
| 51 | return res; |
| 52 | } |
no test coverage detected