-
Notifications
You must be signed in to change notification settings - Fork 4
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
Specify add_free behaviour on invalid usage #27
Changes from all commits
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 |
---|---|---|
|
@@ -534,7 +534,7 @@ Table 7. Member functions of the `command_graph` class (memory operations). | |
using namespace ext::oneapi::experimental; | ||
node add_malloc_device(void *&data, size_t numBytes, const std::vector<node>& dep = {}); | ||
---- | ||
|Adding a node that encapsulates a memory allocation operation. | ||
|Adds a node that encapsulates a USM device memory allocation operation. | ||
|
||
Preconditions: | ||
|
||
|
@@ -562,7 +562,10 @@ Exceptions: | |
using namespace ext::oneapi::experimental; | ||
node add_free(void *data, const std::vector<node>& dep = {}); | ||
---- | ||
|Adding a node that encapsulates a memory free operation. | ||
|Adds a node that encapsulates a memory free operation. The memory pointed to | ||
by `data` must be a valid address that has been allocated using one of the USM | ||
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. The phrase
means that a user could call 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 think letting the graph free an allocation it didn't create is very error prone. IMO we should either mandate that it must have been allocated as part of the graph and error if not, or remove allocation/freeing altogether from graphs. |
||
allocation routines. If any commands that use this memory are in-progress or | ||
are enqueued, then the behavior is undefined. | ||
|
||
Preconditions: | ||
|
||
|
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.
My understanding is that this is equivalent to a USM device allocation, saying this explicitly means that a reading can just consult that section of the SYCL spec for valid usage of the pointer returned by
data
. However ifadd_malloc_device
should be used differently, we should specify that expectation here instead.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.
I think the usage of the pointers returned should be the same as a regular USM allocation, we could note that specifically here I suppose just to be extra clear.