diff --git a/sycl/plugins/level_zero/pi_level0.cpp b/sycl/plugins/level_zero/pi_level0.cpp index 0fdf4e272e1d2..47042442f1c45 100644 --- a/sycl/plugins/level_zero/pi_level0.cpp +++ b/sycl/plugins/level_zero/pi_level0.cpp @@ -2258,6 +2258,8 @@ piEnqueueKernelLaunch(pi_queue Queue, pi_kernel Kernel, pi_uint32 WorkDim, ze_event_handle_t *ZeEventWaitList = _pi_event::createZeEventList(NumEventsInWaitList, EventWaitList); + if (!ZeEventWaitList) + return PI_OUT_OF_HOST_MEMORY; // Add the command to the command list ZE_CALL(zeCommandListAppendLaunchKernel( @@ -2708,6 +2710,8 @@ enqueueMemCopyHelper(pi_command_type CommandType, pi_queue Queue, void *Dst, ze_event_handle_t *ZeEventWaitList = _pi_event::createZeEventList(NumEventsInWaitList, EventWaitList); + if (!ZeEventWaitList) + return PI_OUT_OF_HOST_MEMORY; ZE_CALL(zeCommandListAppendWaitOnEvents(ZeCommandList, NumEventsInWaitList, ZeEventWaitList)); @@ -2766,6 +2770,8 @@ static pi_result enqueueMemCopyRectHelper( ze_event_handle_t *ZeEventWaitList = _pi_event::createZeEventList(NumEventsInWaitList, EventWaitList); + if (!ZeEventWaitList) + return PI_OUT_OF_HOST_MEMORY; ZE_CALL(zeCommandListAppendWaitOnEvents(ZeCommandList, NumEventsInWaitList, ZeEventWaitList)); @@ -2926,6 +2932,8 @@ enqueueMemFillHelper(pi_command_type CommandType, pi_queue Queue, void *Ptr, ze_event_handle_t *ZeEventWaitList = _pi_event::createZeEventList(NumEventsInWaitList, EventWaitList); + if (!ZeEventWaitList) + return PI_OUT_OF_HOST_MEMORY; ZE_CALL(zeCommandListAppendWaitOnEvents(ZeCommandList, NumEventsInWaitList, ZeEventWaitList)); diff --git a/sycl/source/detail/program_impl.cpp b/sycl/source/detail/program_impl.cpp index 88f092bf2d117..89ddc4f6cfb1b 100644 --- a/sycl/source/detail/program_impl.cpp +++ b/sycl/source/detail/program_impl.cpp @@ -399,7 +399,7 @@ bool program_impl::has_cl_kernel(const string_class &KernelName) const { } RT::PiKernel program_impl::get_pi_kernel(const string_class &KernelName) const { - RT::PiKernel Kernel; + RT::PiKernel Kernel = nullptr; if (is_cacheable()) { std::tie(Kernel, std::ignore) = diff --git a/sycl/source/detail/scheduler/graph_builder.cpp b/sycl/source/detail/scheduler/graph_builder.cpp index 46bfdb212f6d4..1532ab3da8666 100644 --- a/sycl/source/detail/scheduler/graph_builder.cpp +++ b/sycl/source/detail/scheduler/graph_builder.cpp @@ -93,6 +93,7 @@ Scheduler::GraphBuilder::GraphBuilder() { } static bool markNodeAsVisited(Command *Cmd, std::vector &Visited) { + assert(Cmd && "Cmd can't be nullptr"); if (Cmd->MMarks.MVisited) return false; Cmd->MMarks.MVisited = true;