-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL][Bindless][UR][L0][E2E] Fix linear interop memory and L0 V1 adapter leaks. #18353
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
Changes from 2 commits
9ee064e
c67d38b
0b0e9ad
5151982
ff997d0
f26ef83
cde614d
eb8bb39
b4583ed
7cd0172
366c783
b9e9be7
532932c
a85fdc2
c5be140
3486511
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2166,14 +2166,26 @@ and `mipmap`. Attempting to import other image types will result in undefined | |
behaviour. | ||
|
||
Once a user has finished operating on imported memory, they must ensure that | ||
they destroy the imported memory handle through `release_external_memory`. | ||
they free the mapped memory and release the external memory handle. | ||
|
||
`release_external_memory` can only accept `external_mem` objects that were | ||
created through `import_external_memory`. | ||
Memory mapped using `map_external_image_memory` should be freed using | ||
`free_image_mem`. | ||
|
||
Memory mapped using `map_external_linear_memory` should be freed using | ||
`free_mapped_linear_memory`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the intention is that the user is supposed to call If we want to go that way, I think these deserve a separate section, instead of being bundled together with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've amended the naming to follow your suggestion. The |
||
|
||
Imported external memory handle should be released using | ||
`release_external_memory`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From these, it is unclear to me whether a user needs to call both external_mem EM = import_external_memory(...);
void *MEIM = map_external_image_memory(EM, ...);
...
free_image_mem(MEIM, ...);
release_external_memory(EM, ...); There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've clarified the wording in the spec. It should hopefully be clear now that the user should first I've also added a paragraph stating that an |
||
|
||
```cpp | ||
namespace sycl::ext::oneapi::experimental { | ||
|
||
void free_mapped_linear_memory(void *mappedLinearRegion, | ||
const sycl::device &syclDevice, | ||
const sycl::context &syclContext); | ||
void free_mapped_linear_memory(void *mappedLinearRegion, | ||
const sycl::queue &syclQueue); | ||
|
||
void release_external_memory(external_mem externalMem, | ||
const sycl::device &syclDevice, | ||
const sycl::context &syclContext); | ||
|
@@ -2182,9 +2194,6 @@ void release_external_memory(external_mem externalMem, | |
} | ||
``` | ||
|
||
Destroying or freeing any imported memory through `image_mem_free` or | ||
`sycl::free` will result in undefined behavior. | ||
|
||
=== Importing external semaphores [[importing_external_semaphores]] | ||
|
||
In addition to proposing importation of external memory resources, we also | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It irks me that
free_image_mem
usesmem
while all these other APIs usememory
. I suppose it's a little late to address that though.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it is unfortunate.
alloc_image_mem
is in the same boat. We should address this in the future, perhaps by deprecating and phasing out the_mem
function naming first. Not something for this PR though.