Add definition of when a USM allocation is 'accessible'. - #1057
Open
VerenaBeckham wants to merge 2 commits into
Open
VerenaBeckham wants to merge 2 commits into
VerenaBeckham wants to merge 2 commits into
Conversation
|
|
||
| Each USM allocation has an associated SYCL <<context>>, and any access to that | ||
| memory must use the same context. | ||
| Each USM allocation has an associated SYCL <<context>> and must be accessible in |
Contributor
There was a problem hiding this comment.
Should we replace this with something like
A USM allocation in only accessible in devices associated with his <<context>>. More restriction apply:
And then remove the context part of both shared and host? If not we need to add a "context" for device alloc:
A USM device allocation is accessible only from the device and the context specified in the USM allocation.
Because, AFAIK, the code bellow is UB
sycl::context C1{D} C2{D}
sycl::queue Q1(C1,D); Q2(C2,D);
auto p = mallloc_device(Q1);
Q2.submit( *p); // UB. Not the same context, even if it's the same "physical" device
Contributor
Author
There was a problem hiding this comment.
Ah, you are correct. I prefer folding the Context requirement into the bullet points, because it does not apply to the host allocations.
I made that change. I hope it is clear enough to say "device and context".
I also added that device and shared allocations have an associated device, which I think is good info. I've had to look up the different malloc APIs to understand the difference.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 2 of addressing #186.