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] Reduce heap allocations from sycl::local_accessor #17147

Open
wants to merge 1 commit into
base: sycl
Choose a base branch
from

Conversation

aelovikov-intel
Copy link
Contributor

Ideally, there should be zero but we can't fix that without ABI break (both present, and potential future one for unanticipated future changes).

Reduce what we can now:

  • don't allocate memory on host (no host device, APIs accessing memory must be called from inside "command")
  • Use std::make_shared to fold two allocation into one for pImpl idiom

Ideally, there should be zero but we can't fix that without ABI break (both
present, and potential future one for unanticipated future changes).

Reduce what we can now:
- don't allocate memory on host (no host device, APIs accessing memory
  must be called from inside "command")
- Use `std::make_shared` to fold two allocation into one for pImpl idiom
@@ -119,19 +119,12 @@ const sycl::range<3> &LocalAccessorBaseHost::getSize() const {
return impl->MSize;
}
void *LocalAccessorBaseHost::getPtr() {
// Const cast this in order to call the const getPtr.
return const_cast<const LocalAccessorBaseHost *>(this)->getPtr();
// Must not be called.
Copy link
Contributor

Choose a reason for hiding this comment

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

For the sake of debugging, in case this doesn't hold, could we have an assert here that always fails?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have error handling in the base classes before/instead "delegating" to here.

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.

2 participants