Skip to content

[SYCL] Added assertions to prevent null pointer dereferences #14908

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

Merged
merged 1 commit into from
Aug 6, 2024
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
2 changes: 2 additions & 0 deletions sycl/source/detail/memory_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,8 @@ static void memcpyFromDeviceGlobalUSM(
size_t NumBytes, size_t Offset, void *Dest,
const std::vector<ur_event_handle_t> &DepEvents,
ur_event_handle_t *OutEvent, const detail::EventImplPtr &OutEventImpl) {
assert(Queue && "Copying from device global USM must be called with a valid "
"device queue");
// Get or allocate USM memory for the device_global. Since we are reading from
// it, we need it initialized if it has not been yet.
DeviceGlobalUSMMem &DeviceGlobalUSM =
Expand Down
1 change: 1 addition & 0 deletions sycl/source/detail/scheduler/commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3233,6 +3233,7 @@ ur_result_t ExecCGCommand::enqueueImpQueue() {
return UR_RESULT_SUCCESS;
}
case CGType::ProfilingTag: {
assert(MQueue && "Profiling tag requires a valid queue");
const auto &Plugin = MQueue->getPlugin();
// If the queue is not in-order, we need to insert a barrier. This barrier
// does not need output events as it will implicitly enforce the following
Expand Down
Loading