Skip to content

[SYCL] Initialize uninitialized handler_impl fields #15323

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 5 commits into from
Sep 10, 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
6 changes: 6 additions & 0 deletions sycl/source/detail/cg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,8 @@ class CGSemaphoreWait : public CG {
MExternalSemaphore(ExternalSemaphore), MWaitValue(WaitValue) {}

ur_exp_external_semaphore_handle_t getExternalSemaphore() const {
assert(MExternalSemaphore != nullptr &&
"MExternalSemaphore has not been defined yet.");
return MExternalSemaphore;
}
std::optional<uint64_t> getWaitValue() const { return MWaitValue; }
Expand All @@ -643,6 +645,10 @@ class CGSemaphoreSignal : public CG {
MExternalSemaphore(ExternalSemaphore), MSignalValue(SignalValue) {}

ur_exp_external_semaphore_handle_t getExternalSemaphore() const {
if (MExternalSemaphore == nullptr)
throw exception(make_error_code(errc::runtime),
"getExternalSemaphore(): MExternalSemaphore has not been "
"defined yet.");
return MExternalSemaphore;
}
std::optional<uint64_t> getSignalValue() const { return MSignalValue; }
Expand Down
12 changes: 6 additions & 6 deletions sycl/source/detail/handler_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ class handler_impl {

std::shared_ptr<detail::kernel_bundle_impl> MKernelBundle;

ur_usm_advice_flags_t MAdvice;
ur_usm_advice_flags_t MAdvice = 0;

// 2D memory operation information.
size_t MSrcPitch;
size_t MDstPitch;
size_t MWidth;
size_t MHeight;
size_t MSrcPitch = 0;
size_t MDstPitch = 0;
size_t MWidth = 0;
size_t MHeight = 0;

/// Offset into a device_global for copy operations.
size_t MOffset = 0;
Expand Down Expand Up @@ -134,7 +134,7 @@ class handler_impl {
ur_rect_region_t MCopyExtent = {};

// Extra information for semaphore interoperability
ur_exp_external_semaphore_handle_t MExternalSemaphore;
ur_exp_external_semaphore_handle_t MExternalSemaphore = nullptr;
std::optional<uint64_t> MWaitValue;
std::optional<uint64_t> MSignalValue;

Expand Down
Loading