Skip to content

[SYCL] Fix getting host objects for impl objects #967

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
Dec 25, 2019

Conversation

vladimirlaz
Copy link
Contributor

Signed-off-by: Vladimir Lazarev [email protected]

Impl fields in context_impl and program_impl are initialized with
nullptr for host opbjects. That caused segfault on accessing them.
Create host objects on access time.

Signed-off-by: Vladimir Lazarev <[email protected]>
@vladimirlaz vladimirlaz force-pushed the private/vlazarev/crash_host branch from 49bbda9 to 174787b Compare December 24, 2019 12:49
@romanovvlad romanovvlad merged commit f37a1cf into intel:sycl Dec 25, 2019
@@ -324,6 +324,8 @@ class program_impl {
}

context get_context() const {
if (is_host())
return context();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return {};

@@ -104,6 +104,8 @@ cl_uint context_impl::get_info<info::context::reference_count>() const {
this->getHandleRef());
}
template <> platform context_impl::get_info<info::context::platform>() const {
if (is_host())
return platform();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idem

@vladimirlaz vladimirlaz deleted the private/vlazarev/crash_host branch April 2, 2020 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants