| 173 | } |
| 174 | |
| 175 | ze_result_t XCommandListAppendLaunchKernel(ze_command_list_handle_t hCommandList, ze_kernel_handle_t hKernel, const ze_group_count_t *pLaunchFuncArgs, ze_event_handle_t hSignalEvent, uint32_t numWaitEvents, ze_event_handle_t *phWaitEvents) |
| 176 | { |
| 177 | KernelArgsManager::Instance().Freeze(hKernel); |
| 178 | |
| 179 | if (ImmediateCommandListManager::Instance().Exists(hCommandList)) { |
| 180 | auto xq = HwQueueManager::GetXQueue(GetHwQueueHandle(hCommandList)); |
| 181 | if (xq == nullptr) { |
| 182 | ZE_ASSERT(KernelArgsManager::Instance().Set(hKernel)); |
| 183 | return Driver::CommandListAppendLaunchKernel(hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents); |
| 184 | } |
| 185 | auto cmd = std::make_shared<ZeKernelCommand>(hCommandList, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents); |
| 186 | g_event_to_cmd.Add(hSignalEvent, cmd); |
| 187 | xq->Submit(cmd); |
| 188 | XDEBG("XCommandListAppendLaunchKernel(cmd_list: %p, kernel: %p) immediate submitted", hCommandList, hKernel); |
| 189 | return ZE_RESULT_SUCCESS; |
| 190 | } |
| 191 | |
| 192 | ZE_ASSERT(KernelArgsManager::Instance().Set(hKernel)); |
| 193 | return CommandListManager::Instance().Append(hCommandList, [&](ze_command_list_handle_t cmd_list) { |
| 194 | if (hSignalEvent != nullptr) g_event_to_cmdlist.Add(hSignalEvent, cmd_list); |
| 195 | return Driver::CommandListAppendLaunchKernel(cmd_list, hKernel, pLaunchFuncArgs, hSignalEvent, numWaitEvents, phWaitEvents); |
| 196 | }); |
| 197 | } |
| 198 | |
| 199 | ze_result_t XFenceDestroy(ze_fence_handle_t hFence) |
| 200 | { |