@@ -89,13 +89,13 @@ properties P2{bar, foo{1}};
8989properties P3{bar, baz}
9090
9191// APtr1 is of type annotated_ptr<int, decltype(properties{bar, baz, usm_kind<sycl::usm::alloc::device>})>
92- auto APtr1 = annotated_malloc_device <int>(N, q, P1);
92+ auto APtr1 = malloc_device_annotated <int>(N, q, P1);
9393
9494// APtr2 is of type annotated_ptr<int, decltype(properties{bar, usm_kind<sycl::usm::alloc::device>})>
95- auto APtr2 = annotated_malloc_device <int>(N, q, P2);
95+ auto APtr2 = malloc_device_annotated <int>(N, q, P2);
9696
9797// APtr3 is of type annotated_ptr<int, decltype(properties{bar, baz, usm_kind<sycl::usm::alloc::device>})>
98- auto APtr3 = annotated_malloc_device <int>(N, q, P3);
98+ auto APtr3 = malloc_device_annotated <int>(N, q, P3);
9999
100100// Runtime properties are not present on the returned annotated_ptr
101101static_assert(std::is_same_v<decltype(APtr1), decltype(APtr3)>);
@@ -104,10 +104,10 @@ static_assert(std::is_same_v<decltype(APtr1), decltype(APtr3)>);
104104static_assert(!std::is_same_v<decltype(APtr1), decltype(APtr2)>);
105105
106106// APtr4 is of type annotated_ptr<int, decltype(properties{usm_kind<sycl::usm::alloc::host>})>
107- auto APtr4 = annotated_malloc_host <int>(N, q);
107+ auto APtr4 = malloc_host_annotated <int>(N, q);
108108
109109// APtr5 is of type annotated_ptr<int, decltype(properties{usm_kind<sycl::usm::alloc::shared>})>
110- auto APtr5 = annotated_malloc_shared <int>(N, q);
110+ auto APtr5 = malloc_shared_annotated <int>(N, q);
111111
112112// The USM kinds differ
113113static_assert(!std::is_same_v<decltype(APtr4), decltype(APtr5)>);
@@ -123,10 +123,10 @@ using namespace sycl::ext::oneapi::experimental;
123123properties P4{bar, foo{1}};
124124
125125// APtr6 is of type annotated_ptr<int, decltype(properties{bar})>
126- auto APtr6 = annotated_malloc <int>(N, q, sycl::usm::alloc::device, P4);
126+ auto APtr6 = malloc_annotated <int>(N, q, sycl::usm::alloc::device, P4);
127127
128128// APtr7 is of type annotated_ptr<int, decltype(properties{})>;
129- auto APtr7 = annotated_malloc <int>(N, q, sycl::usm::alloc::device);
129+ auto APtr7 = malloc_annotated <int>(N, q, sycl::usm::alloc::device);
130130----
131131
132132If the USM memory allocation kind specified by a parameter to the allocation function is different than the USM memory allocation kind specified by the `sycl::ext::oneapi::experimental::usm_kind` property, the function throws a
@@ -140,10 +140,10 @@ using namespace sycl::ext::oneapi::experimental;
140140properties P5{usm_kind<sycl::usm::alloc::device>};
141141
142142// Throws an exception with error code errc::invalid
143- auto APtr8 = annotated_malloc <int>(N, q, sycl::usm::alloc::host, P5);
143+ auto APtr8 = malloc_annotated <int>(N, q, sycl::usm::alloc::host, P5);
144144
145145// Error: the USM kinds do not agree
146- auto APtr9 = annotated_malloc_host <int>(N, q, P5);
146+ auto APtr9 = malloc_host_annotated <int>(N, q, P5);
147147----
148148
149149The following example uses the compile-time-constant property `alignment`, defined in the link:../proposed/sycl_ext_oneapi_annotated_ptr.asciidoc[sycl_ext_oneapi_annotated_ptr] extension.
@@ -160,15 +160,15 @@ properties P9{alignment<64>};
160160
161161// APtr10 is of type annotated_ptr<int, decltype(properties{alignment<512>, usm_kind<sycl::usm::alloc::device>})>
162162// The raw pointer of APtr10 is 512-byte aligned
163- auto APtr10 = annotated_malloc_device <int>(N, q, P7);
163+ auto APtr10 = malloc_device_annotated <int>(N, q, P7);
164164
165165// APtr11 is of type annotated_ptr<int, decltype(properties{alignment<1>, usm_kind<sycl::usm::alloc::device>})>
166166// The raw pointer of APtr11 is sizeof(int)-byte aligned
167- auto APtr11 = annotated_malloc_device <int>(N, q, P8);
167+ auto APtr11 = malloc_device_annotated <int>(N, q, P8);
168168
169169// APtr12 is of type annotated_ptr<void, decltype(properties{alignment<64>, usm_kind<sycl::usm::alloc::device>})>
170170// The raw pointer of APtr12 is 512-byte aligned
171- auto APtr12 = annotated_malloc_device (512, q, P9);
171+ auto APtr12 = malloc_device_annotated (512, q, P9);
172172----
173173
174174This extension also introduces USM memory allocation functions with `properties` support that allow alignment to be specified at runtime, using a separate parameter of type `size_t`.
266266----
267267template<typename propertyListA, typename propertyListB>
268268annotated_ptr<void, propertyListB>
269- annotated_malloc_device (
269+ malloc_device_annotated (
270270 size_t numBytes,
271271 const device& syclDevice,
272272 const context& syclContext,
273273 const propertyListA &propList = properties{})
274274----
275275a@ Returns an `annotated_ptr` containing a raw pointer to the newly allocated memory on `syclDevice` on
276276success. The allocation size is specified in bytes. This memory is not
277- accessible on the host. Memory allocated by `annotated_malloc_device `
277+ accessible on the host. Memory allocated by `malloc_device_annotated `
278278must be deallocated with `sycl::free` to avoid memory leaks.
279279On failure, the raw pointer of the returned `annotated_ptr` will be `nullptr`.
280280
@@ -304,7 +304,7 @@ template <typename T,
304304 typename propertyListA,
305305 typename propertyListB>
306306annotated_ptr<T, propertyListB>
307- annotated_malloc_device (
307+ malloc_device_annotated (
308308 size_t count,
309309 const device& syclDevice,
310310 const context& syclContext,
@@ -313,7 +313,7 @@ annotated_malloc_device(
313313a@ Returns an `annotated_ptr` containing a raw pointer to the newly allocated memory on `syclDevice` on
314314success. The allocation size is specified in number of elements of type
315315`T`. This memory is not accessible on the host. Memory allocated
316- by `annotated_malloc_device ` must be deallocated with
316+ by `malloc_device_annotated ` must be deallocated with
317317`sycl::free` to avoid memory leaks.
318318On failure, the raw pointer of the returned `annotated_ptr` will be `nullptr`.
319319
341341----
342342template<typename propertyListA, typename propertyListB>
343343annotated_ptr<void, propertyListB>
344- annotated_malloc_device (
344+ malloc_device_annotated (
345345 size_t numBytes,
346346 const queue& syclQueue,
347347 const propertyListA &propList = properties{})
@@ -371,7 +371,7 @@ template <typename T,
371371 typename propertyListA,
372372 typename propertyListB>
373373annotated_ptr<T, propertyListB>
374- annotated_malloc_device (
374+ malloc_device_annotated (
375375 size_t count,
376376 const queue& syclQueue,
377377 const propertyListA &propList = properties{})
557557----
558558template <typename propertyListA, typename propertyListB>
559559annotated_ptr<void, propertyListB>
560- annotated_malloc_host (
560+ malloc_host_annotated (
561561 size_t numBytes,
562562 const context& syclContext,
563563 const propertyListA &propList = properties{})
564564----
565565a@ Returns an `annotated_ptr` containing a raw pointer to the newly allocated host memory on
566566success. This allocation is specified in bytes. The allocation is
567567accessible on the host and devices contained in the specified `context`.
568- Memory allocated by `annotated_malloc_host ` must be
568+ Memory allocated by `malloc_host_annotated ` must be
569569deallocated with `sycl::free` to avoid memory leaks.
570570On failure, the raw pointer of the returned `annotated_ptr` will be `nullptr`.
571571
@@ -591,7 +591,7 @@ template <typename T,
591591 typename propertyListA,
592592 typename propertyListB>
593593annotated_ptr<T, propertyListB>
594- annotated_malloc_host (
594+ malloc_host_annotated (
595595 size_t count,
596596 const context& syclContext,
597597 const propertyListA &propList = properties{})
@@ -600,7 +600,7 @@ a@ Returns an `annotated_ptr` containing a raw pointer to the newly allocated ho
600600success. This allocation is specified in number of elements of type `T`.
601601The allocation is accessible on the host and devices contained in the
602602specified `context`.
603- Memory allocated by `annotated_malloc_host ` must be
603+ Memory allocated by `malloc_host_annotated ` must be
604604deallocated with `sycl::free` to avoid memory leaks.
605605On failure, the raw pointer of the returned `annotated_ptr` will be `nullptr`.
606606
624624----
625625template <typename propertyListA, typename propertyListB>
626626annotated_ptr<void, propertyListB>
627- annotated_malloc_host (
627+ malloc_host_annotated (
628628 size_t numBytes,
629629 const queue& syclQueue,
630630 const propertyListA &propList = properties{})
@@ -653,7 +653,7 @@ template <typename T,
653653 typename propertyListA,
654654 typename propertyListB>
655655annotated_ptr<T, propertyListB>
656- annotated_malloc_host (
656+ malloc_host_annotated (
657657 size_t count,
658658 const queue& syclQueue,
659659 const propertyListA &propList = properties{})
823823----
824824template <typename propertyListA, typename propertyListB>
825825annotated_ptr<void, propertyListB>
826- annotated_malloc_shared (
826+ malloc_shared_annotated (
827827 size_t numBytes,
828828 const device& syclDevice,
829829 const context& syclContext,
@@ -861,7 +861,7 @@ template <typename T,
861861 typename propertyListA,
862862 typename propertyListB>
863863annotated_ptr<T, propertyListB>
864- annotated_malloc_shared (
864+ malloc_shared_annotated (
865865 size_t count,
866866 const device& syclDevice,
867867 const context& syclContext,
898898----
899899template <typename propertyListA, typename propertyListB>
900900annotated_ptr<void, propertyListB>
901- annotated_malloc_shared (
901+ malloc_shared_annotated (
902902 size_t numBytes,
903903 const queue& syclQueue,
904904 const propertyListA &propList = properties{})
@@ -928,7 +928,7 @@ template <typename T,
928928 typename propertyListA,
929929 typename propertyListB>
930930annotated_ptr<T, propertyListB>
931- annotated_malloc_shared (
931+ malloc_shared_annotated (
932932 size_t count,
933933 const queue& syclQueue,
934934 const propertyListA &propList = properties{})
11131113----
11141114template <typename propertyListA, typename propertyListB>
11151115annotated_ptr<void, propertyListB>
1116- annotated_malloc (
1116+ malloc_annotated (
11171117 size_t numBytes,
11181118 const device& syclDevice,
11191119 const context& syclContext,
@@ -1148,7 +1148,7 @@ template <typename T,
11481148 typename propertyListA,
11491149 typename propertyListB>
11501150annotated_ptr<T, propertyListB>
1151- annotated_malloc (
1151+ malloc_annotated (
11521152 size_t count,
11531153 const device& syclDevice,
11541154 const context& syclContext,
11831183----
11841184template <typename propertyListA, typename propertyListB>
11851185annotated_ptr<void, propertyListB>
1186- annotated_malloc (
1186+ malloc_annotated (
11871187 size_t numBytes,
11881188 const queue& syclQueue,
11891189 sycl::usm::alloc kind,
@@ -1209,7 +1209,7 @@ template <typename T,
12091209 typename propertyListA,
12101210 typename propertyListB>
12111211annotated_ptr<T, propertyListB>
1212- annotated_malloc (
1212+ malloc_annotated (
12131213 size_t count,
12141214 const queue& syclQueue,
12151215 sycl::usm::alloc kind,
13871387----
13881388template <typename propertyListA, typename propertyListB>
13891389annotated_ptr<void, propertyListB>
1390- annotated_malloc (
1390+ malloc_annotated (
13911391 size_t numBytes,
13921392 const device& syclDevice,
13931393 const context& syclContext,
@@ -1419,7 +1419,7 @@ template <typename T,
14191419 typename propertyListA,
14201420 typename propertyListB>
14211421annotated_ptr<T, propertyListB>
1422- annotated_malloc (
1422+ malloc_annotated (
14231423 size_t count,
14241424 const device& syclDevice,
14251425 const context& syclContext,
14491449----
14501450template <typename propertyListA, typename propertyListB>
14511451annotated_ptr<void, propertyListB>
1452- annotated_malloc (
1452+ malloc_annotated (
14531453 size_t numBytes,
14541454 const queue& syclQueue,
14551455 const propertyListA &propList)
@@ -1476,7 +1476,7 @@ template <typename T,
14761476 typename propertyListA,
14771477 typename propertyListB>
14781478annotated_ptr<T, propertyListB>
1479- annotated_malloc (
1479+ malloc_annotated (
14801480 size_t count,
14811481 const queue& syclQueue,
14821482 const propertyListA &propList)
@@ -1569,8 +1569,8 @@ using namespace sycl::ext::oneapi::experimental;
15691569
15701570// APtr and BPtr are of type
15711571// annotated_ptr<int*, decltype(properties{usm_kind<sycl::usm::alloc::device>})>
1572- auto APtr = annotated_malloc_device <int>(N, q);
1573- auto BPtr = annotated_malloc_device <int>(N, q);
1572+ auto APtr = malloc_device_annotated <int>(N, q);
1573+ auto BPtr = malloc_device_annotated <int>(N, q);
15741574
15751575// Deallocate the memory pointed to by the raw pointer of APtr
15761576free(APtr, q);
0 commit comments