Skip to content

Commit

Permalink
Merge pull request #485 from mkinsner/mkinsner_usm_fixes_oct2023
Browse files Browse the repository at this point in the history
Fix bugs in SYCL2020 USM section
  • Loading branch information
gmlueck authored Nov 9, 2023
1 parent a65fbef commit 980cb22
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions adoc/chapters/programming_interface.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10354,7 +10354,7 @@ leak. If there are not enough resources to allocate the requested memory,
these functions return [code]#nullptr#.

When the allocation size is zero bytes ([code]#numBytes# or [code]#count# is
zero), these functions behave in a manor consistent with {cpp}
zero), these functions behave in a manner consistent with {cpp}
[code]#std::malloc#. The value returned is unspecified in this case, and the
returned pointer may not be used to access storage. If this pointer is not
null, it must be passed to [code]#sycl::free# to avoid a memory leak.
Expand Down Expand Up @@ -10485,6 +10485,12 @@ eventually be deallocated with [code]#sycl::free# in order to avoid a memory
leak. If there are not enough resources to allocate the requested memory,
these functions return [code]#nullptr#.

When the allocation size is zero bytes ([code]#numBytes# or [code]#count# is
zero), these functions behave in a manner consistent with {cpp}
[code]#std::malloc#. The value returned is unspecified in this case, and the
returned pointer may not be used to access storage. If this pointer is not
null, it must be passed to [code]#sycl::free# to avoid a memory leak.

[[table.usm.host.allocs]]
.Host USM Allocation Functions
[width="100%",options="header",separator="@",cols="65%,35%"]
Expand Down Expand Up @@ -10570,7 +10576,7 @@ a@
[source]
----
template <typename T>
void* sycl::aligned_alloc_host(size_t alignment, size_t count,
T* sycl::aligned_alloc_host(size_t alignment, size_t count,
const queue& syclQueue,
const property_list& propList = {})
----
Expand All @@ -10586,6 +10592,12 @@ eventually be deallocated with [code]#sycl::free# in order to avoid a memory
leak. If there are not enough resources to allocate the requested memory,
these functions return [code]#nullptr#.

When the allocation size is zero bytes ([code]#numBytes# or [code]#count# is
zero), these functions behave in a manner consistent with {cpp}
[code]#std::malloc#. The value returned is unspecified in this case, and the
returned pointer may not be used to access storage. If this pointer is not
null, it must be passed to [code]#sycl::free# to avoid a memory leak.

[[table.usm.shared.allocs]]
.Shared USM Allocation Functions
[width="100%",options="header",separator="@",cols="65%,35%"]
Expand Down Expand Up @@ -10722,6 +10734,12 @@ which must eventually be deallocated with [code]#sycl::free# in order to avoid
a memory leak. If there are not enough resources to allocate the requested
memory, these functions return [code]#nullptr#.

When the allocation size is zero bytes ([code]#numBytes# or [code]#count# is
zero), these functions behave in a manner consistent with {cpp}
[code]#std::malloc#. The value returned is unspecified in this case, and the
returned pointer may not be used to access storage. If this pointer is not
null, it must be passed to [code]#sycl::free# to avoid a memory leak.

[[table.usm.param.allocs]]
.Parameterized USM Allocation Functions
[width="100%",options="header",separator="@",cols="65%,35%"]
Expand Down

0 comments on commit 980cb22

Please sign in to comment.