MCPcopy Create free account
hub / github.com/XpuOS/xsched / ZeQueueCreate

Function ZeQueueCreate

platforms/levelzero/hal/src/ze_queue.cpp:85–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85EXPORT_C_FUNC XResult ZeQueueCreate(HwQueueHandle *hwq, ze_device_handle_t dev, ze_command_queue_handle_t cmdq)
86{
87 if (hwq == nullptr) {
88 XWARN("ZeQueueCreate failed: hwq is nullptr");
89 return kXSchedErrorInvalidValue;
90 }
91 if (dev == nullptr || cmdq == nullptr) {
92 XWARN("ZeQueueCreate failed: dev or cmdq is nullptr");
93 return kXSchedErrorInvalidValue;
94 }
95
96 ze_device_properties_t dev_props;
97 dev_props.stype = ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES;
98 dev_props.pNext = nullptr;
99 ZE_ASSERT(Driver::DeviceGetProperties(dev, &dev_props));
100
101 HwQueueHandle hwq_h = GetHwQueueHandle(cmdq);
102 auto res = HwQueueManager::Add(hwq_h, [&]() -> std::shared_ptr<ZeQueue> {
103 if (dev_props.type == ZE_DEVICE_TYPE_VPU) {
104 return std::make_shared<ZeIntelNpuQueue>(dev, cmdq);
105 }
106 return std::make_shared<ZeQueue>(dev, cmdq);
107 });
108 if (res == kXSchedSuccess) *hwq = hwq_h;
109 return res;
110}
111
112EXPORT_C_FUNC XResult ZeListreate(HwQueueHandle *hwq, ze_device_handle_t dev, ze_command_list_handle_t cmdl)
113{

Callers 3

mainFunction · 0.85
mainFunction · 0.85
XCommandQueueCreateFunction · 0.85

Calls 1

GetHwQueueHandleFunction · 0.50

Tested by

no test coverage detected