Skip to content

Commit 063cd09

Browse files
Rename annotated_malloc to malloc_annotated.
1 parent 1c27d57 commit 063cd09

File tree

1 file changed

+38
-38
lines changed

1 file changed

+38
-38
lines changed

sycl/doc/extensions/proposed/sycl_ext_oneapi_usm_malloc_properties.asciidoc

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ properties P2{bar, foo{1}};
8989
properties 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
101101
static_assert(std::is_same_v<decltype(APtr1), decltype(APtr3)>);
@@ -104,10 +104,10 @@ static_assert(std::is_same_v<decltype(APtr1), decltype(APtr3)>);
104104
static_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
113113
static_assert(!std::is_same_v<decltype(APtr4), decltype(APtr5)>);
@@ -123,10 +123,10 @@ using namespace sycl::ext::oneapi::experimental;
123123
properties 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

132132
If 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;
140140
properties 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

149149
The 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

174174
This 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`.
@@ -266,15 +266,15 @@ a@
266266
----
267267
template<typename propertyListA, typename propertyListB>
268268
annotated_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
----
275275
a@ Returns an `annotated_ptr` containing a raw pointer to the newly allocated memory on `syclDevice` on
276276
success. 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`
278278
must be deallocated with `sycl::free` to avoid memory leaks.
279279
On 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>
306306
annotated_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(
313313
a@ Returns an `annotated_ptr` containing a raw pointer to the newly allocated memory on `syclDevice` on
314314
success. 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.
318318
On failure, the raw pointer of the returned `annotated_ptr` will be `nullptr`.
319319

@@ -341,7 +341,7 @@ a@
341341
----
342342
template<typename propertyListA, typename propertyListB>
343343
annotated_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>
373373
annotated_ptr<T, propertyListB>
374-
annotated_malloc_device(
374+
malloc_device_annotated(
375375
size_t count,
376376
const queue& syclQueue,
377377
const propertyListA &propList = properties{})
@@ -557,15 +557,15 @@ a@
557557
----
558558
template <typename propertyListA, typename propertyListB>
559559
annotated_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
----
565565
a@ Returns an `annotated_ptr` containing a raw pointer to the newly allocated host memory on
566566
success. This allocation is specified in bytes. The allocation is
567567
accessible 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
569569
deallocated with `sycl::free` to avoid memory leaks.
570570
On 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>
593593
annotated_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
600600
success. This allocation is specified in number of elements of type `T`.
601601
The allocation is accessible on the host and devices contained in the
602602
specified `context`.
603-
Memory allocated by `annotated_malloc_host` must be
603+
Memory allocated by `malloc_host_annotated` must be
604604
deallocated with `sycl::free` to avoid memory leaks.
605605
On failure, the raw pointer of the returned `annotated_ptr` will be `nullptr`.
606606

@@ -624,7 +624,7 @@ a@
624624
----
625625
template <typename propertyListA, typename propertyListB>
626626
annotated_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>
655655
annotated_ptr<T, propertyListB>
656-
annotated_malloc_host(
656+
malloc_host_annotated(
657657
size_t count,
658658
const queue& syclQueue,
659659
const propertyListA &propList = properties{})
@@ -823,7 +823,7 @@ a@
823823
----
824824
template <typename propertyListA, typename propertyListB>
825825
annotated_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>
863863
annotated_ptr<T, propertyListB>
864-
annotated_malloc_shared(
864+
malloc_shared_annotated(
865865
size_t count,
866866
const device& syclDevice,
867867
const context& syclContext,
@@ -898,7 +898,7 @@ a@
898898
----
899899
template <typename propertyListA, typename propertyListB>
900900
annotated_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>
930930
annotated_ptr<T, propertyListB>
931-
annotated_malloc_shared(
931+
malloc_shared_annotated(
932932
size_t count,
933933
const queue& syclQueue,
934934
const propertyListA &propList = properties{})
@@ -1113,7 +1113,7 @@ a@
11131113
----
11141114
template <typename propertyListA, typename propertyListB>
11151115
annotated_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>
11501150
annotated_ptr<T, propertyListB>
1151-
annotated_malloc(
1151+
malloc_annotated(
11521152
size_t count,
11531153
const device& syclDevice,
11541154
const context& syclContext,
@@ -1183,7 +1183,7 @@ a@
11831183
----
11841184
template <typename propertyListA, typename propertyListB>
11851185
annotated_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>
12111211
annotated_ptr<T, propertyListB>
1212-
annotated_malloc(
1212+
malloc_annotated(
12131213
size_t count,
12141214
const queue& syclQueue,
12151215
sycl::usm::alloc kind,
@@ -1387,7 +1387,7 @@ a@
13871387
----
13881388
template <typename propertyListA, typename propertyListB>
13891389
annotated_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>
14211421
annotated_ptr<T, propertyListB>
1422-
annotated_malloc(
1422+
malloc_annotated(
14231423
size_t count,
14241424
const device& syclDevice,
14251425
const context& syclContext,
@@ -1449,7 +1449,7 @@ a@
14491449
----
14501450
template <typename propertyListA, typename propertyListB>
14511451
annotated_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>
14781478
annotated_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
15761576
free(APtr, q);

0 commit comments

Comments
 (0)