From 980cb2276392a5d7b53f0f523aa734ae24f71f0e Mon Sep 17 00:00:00 2001 From: Greg Lueck Date: Thu, 9 Nov 2023 12:35:21 -0500 Subject: [PATCH] Merge pull request #485 from mkinsner/mkinsner_usm_fixes_oct2023 Fix bugs in SYCL2020 USM section --- adoc/chapters/programming_interface.adoc | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/adoc/chapters/programming_interface.adoc b/adoc/chapters/programming_interface.adoc index a0dceaf5..5792aa17 100644 --- a/adoc/chapters/programming_interface.adoc +++ b/adoc/chapters/programming_interface.adoc @@ -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. @@ -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%"] @@ -10570,7 +10576,7 @@ a@ [source] ---- template -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 = {}) ---- @@ -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%"] @@ -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%"]