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

Clarify that "sycl::free(nullptr)" does nothing #593

Merged
merged 1 commit into from
Jul 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions adoc/chapters/programming_interface.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10887,12 +10887,16 @@ a@
----
void sycl::free(void* ptr, const context& syclContext)
----
a@ Frees an allocation. The memory pointed to by [code]#ptr# must have been
allocated using one of the USM allocation routines. [code]#syclContext# must
be the same [code]#context# that was used to allocate the memory. The memory
is freed without waiting for <<command, commands>> operating on it to be
completed. If <<command, commands>> that use this memory are in-progress or
are enqueued the behavior is undefined.
a@ Frees an allocation.
The memory pointed to by [code]#ptr# must have been allocated using one of the
USM allocation routines or it must be a null pointer.
If [code]#ptr# is not null, the [code]#syclContext# must be the same
[code]#context# that was used to allocate the memory.
If [code]#ptr# is null, this function has no effect.
Otherwise, the memory is freed without waiting for <<command, commands>>
operating on it to be completed.
If <<command, commands>> that use this memory are in-progress or are enqueued,
the behavior is undefined.

a@
[source]
Expand Down