Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCL] Fix warnings from static analysis tool #2193

Merged
merged 2 commits into from
Jul 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions sycl/plugins/level_zero/pi_level0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion sycl/source/detail/program_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) =
Expand Down
1 change: 1 addition & 0 deletions sycl/source/detail/scheduler/graph_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ Scheduler::GraphBuilder::GraphBuilder() {
}

static bool markNodeAsVisited(Command *Cmd, std::vector<Command *> &Visited) {
assert(Cmd && "Cmd can't be nullptr");
if (Cmd->MMarks.MVisited)
return false;
Cmd->MMarks.MVisited = true;
Expand Down