You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* `const sycl::device& dev` - the SYCL `device` to allocate on
232
-
* `const sycl::context& dev` - the SYCL `context` to which `device` belongs
233
+
* `const sycl::context& ctxt` - the SYCL `context` to which `device` belongs
233
234
234
235
Return value:: Returns a pointer to the newly allocated memory on the specified `device` on success. Memory allocated by `sycl::malloc_device` must be deallocated with `sycl::free` to avoid memory leaks. On failure, returns `nullptr`.
235
236
237
+
[source,cpp]
238
+
----
239
+
void* sycl::malloc_device(size_t size,
240
+
const sycl::queue& q);
241
+
----
242
+
243
+
Parameters::
244
+
* `size_t size` - number of bytes to allocate
245
+
* `const sycl::queue& q` - the SYCL `q` that provides the `device` and `context` to allocate against
246
+
247
+
Return value:: Returns a pointer to the newly allocated memory on the `device` associated with `q` on success. Memory allocated by `sycl::malloc_device` must be deallocated with `sycl::free` to avoid memory leaks. On failure, returns `nullptr`.
* `size_t alignment` - specifies the byte alignment. Must be a valid alignment supported by the implementation.
247
260
* `size_t size` - number of bytes to allocate
248
261
* `const sycl::device& dev` - the `device` to allocate on
249
-
* `const sycl::context& dev` - the SYCL `context` to which `device` belongs
262
+
* `const sycl::context& ctxt` - the SYCL `context` to which `device` belongs
250
263
Return value:: Returns a pointer to the newly allocated memory on the specified `device` on success. Memory allocated by `sycl::aligned_alloc_device` must be deallocated with `sycl::free` to avoid memory leaks. On failure, returns `nullptr`.
* `size_t alignment` - specifies the byte alignment. Must be a valid alignment supported by the implementation.
274
+
* `size_t size` - number of bytes to allocate
275
+
* `const sycl::queue& q` - the SYCL `q` that provides the `device` and `context` to allocate against
276
+
277
+
Return value:: Returns a pointer to the newly allocated memory on the `device` associated with `q` on success. Memory allocated by `sycl::aligned_alloc_device` must be deallocated with `sycl::free` to avoid memory leaks. On failure, returns `nullptr`.
278
+
252
279
===== memcpy
253
280
[source,cpp]
254
281
----
@@ -310,6 +337,16 @@ Parameters::
310
337
* `const sycl::context& ctxt` - the SYCL `context` that contains the devices that will access the `host` allocation
311
338
Return value:: Returns a pointer to the newly allocated `host` memory on success. Memory allocated by `sycl::malloc_host` must be deallocated with `sycl::free` to avoid memory leaks. On failure, returns `nullptr`.
* `const sycl::queue& q` - the SYCL `queue` whose `context` contains the devices that will access the `host` allocation
348
+
Return value:: Returns a pointer to the newly allocated `host` memory on success. Memory allocated by `sycl::malloc_host` must be deallocated with `sycl::free` to avoid memory leaks. On failure, returns `nullptr`.
* `const sycl::device& dev` - the SYCL device to allocate on
323
-
* `const sycl::context& dev` - the SYCL `context` to which `device` belongs
360
+
* `const sycl::context& ctxt` - the SYCL `context` to which `device` belongs
324
361
Return value:: Returns a pointer to the newly allocated `shared` memory on the specified `device` on success. Memory allocated by `sycl::malloc_shared` must be deallocated with `sycl::free` to avoid memory leaks. On failure, returns `nullptr`.
325
362
363
+
[source,cpp]
364
+
----
365
+
void* sycl::malloc_shared(size_t size,
366
+
const sycl::queue& q);
367
+
----
368
+
369
+
Parameters::
370
+
* `size_t size` - number of bytes to allocate
371
+
* `const sycl::queue& q` - the SYCL `q` that provides the `device` and `context` to allocate against
372
+
373
+
Return value:: Returns a pointer to the newly allocated `shared` memory on the `device` associated with `q` on success. Memory allocated by `sycl::malloc_shared` must be deallocated with `sycl::free` to avoid memory leaks. On failure, returns `nullptr`.
* `size_t alignment` - specifies the byte alignment. Must be a valid alignment supported by the implementation.
383
+
* `size_t size` - number of bytes to allocate
384
+
* `const sycl::context& ctxt` - the SYCL `context` that contains the devices that will access the `host` allocation
385
+
Return value:: Returns a pointer to the newly allocated `host` memory on success. Memory allocated by `sycl::aligned_alloc_host` must be deallocated with `sycl::free` to avoid memory leaks. On failure, returns `nullptr`.
* `size_t alignment` - specifies the byte alignment. Must be a valid alignment supported by the implementation.
334
394
* `size_t size` - number of bytes to allocate
395
+
* `const sycl::queue& q` - the SYCL `q` whose `context` contains the devices that will access the `host` allocation
335
396
Return value:: Returns a pointer to the newly allocated `host` memory on success. Memory allocated by `sycl::aligned_alloc_host` must be deallocated with `sycl::free` to avoid memory leaks. On failure, returns `nullptr`.
336
397
337
398
[source,cpp]
@@ -346,9 +407,22 @@ Parameters::
346
407
* `size_t alignment` - specifies the byte alignment. Must be a valid alignment supported by the implementation.
347
408
* `size_t size` - number of bytes to allocate
348
409
* `const sycl::device& dev` - the SYCL `device` to allocate on
349
-
* `const sycl::context& dev` - the SYCL `context` to which `device` belongs
410
+
* `const sycl::context& ctxt` - the SYCL `context` to which `device` belongs
350
411
Return value:: Returns a pointer to the newly allocated `shared` memory on the specified `device` on success. Memory allocated by `sycl::aligned_alloc_shared` must be deallocated with `sycl::free` to avoid memory leaks. On failure, returns `nullptr`.
* `size_t alignment` - specifies the byte alignment. Must be a valid alignment supported by the implementation.
422
+
* `size_t size` - number of bytes to allocate
423
+
* `const sycl::queue& q` - the SYCL `q` that provides the `device` and `context` to allocate against
424
+
Return value:: Returns a pointer to the newly allocated `shared` memory on the `device` associated with `q` on success. Memory allocated by `sycl::aligned_alloc_shared` must be deallocated with `sycl::free` to avoid memory leaks. On failure, returns `nullptr`.
425
+
352
426
===== Performance Hints
353
427
Programmers may provide hints to the runtime that data should be made available on a device earlier than Unified Shared Memory would normally require it to be available. This can be accomplished through enqueueing prefetch commands. Prefetch commands may not be overlapped with kernel execution in Restricted USM.
354
428
@@ -405,44 +479,81 @@ Return Value:: Returns an event representing the operation.
405
479
[source,cpp]
406
480
----
407
481
void *sycl::malloc(size_t size,
408
-
const device& dev,
409
-
const context& ctxt,
482
+
const sycl::device& dev,
483
+
const sycl::context& ctxt,
410
484
usm::alloc kind);
411
485
----
412
486
413
487
Parameters::
414
488
* `size_t size` - number of bytes to allocate
415
-
* `const sycl::device& dev` - the SYCL device to allocate on
416
-
* `const sycl::context& dev` - the SYCL `context` to which `device` belongs
489
+
* `const sycl::device& dev` - the SYCL device to allocate on (if applicable)
490
+
* `const sycl::context& ctxt` - the SYCL `context` to which `device` belongs
417
491
* `usm::alloc kind` - the type of allocation to perform
418
492
Return value:: Returns a pointer to the newly allocated `kind` memory on the specified `device` on success. If `kind` is `alloc::host`, `dev` is ignored. Memory allocated by `sycl::malloc` must be deallocated with `sycl::free` to avoid memory leaks. On failure, returns `nullptr`.
419
493
494
+
[source,cpp]
495
+
----
496
+
void *sycl::malloc(size_t size,
497
+
const sycl::queue& q,
498
+
usm::alloc kind);
499
+
----
500
+
501
+
Parameters::
502
+
* `size_t size` - number of bytes to allocate
503
+
* `const sycl::queue& q` - the SYCL `q` that provides the `device` (if applicable) and `context` to allocate against
504
+
* `usm::alloc kind` - the type of allocation to perform
505
+
Return value:: Returns a pointer to the newly allocated `kind` memory on success. Memory allocated by `sycl::malloc` must be deallocated with `sycl::free` to avoid memory leaks. On failure, returns `nullptr`.
506
+
420
507
===== aligned_alloc
421
508
[source,cpp]
422
509
----
423
510
void *sycl::aligned_alloc(size_t alignment,
424
511
size_t size,
425
-
const device& dev,
426
-
const context& ctxt,
512
+
const sycl::device& dev,
513
+
const sycl::context& ctxt,
427
514
usm::alloc kind);
428
515
----
429
516
430
517
Parameters::
431
518
* `size_t alignment` - specifies the byte alignment. Must be a valid alignment supported by the implementation.
432
519
* `size_t size` - number of bytes to allocate
433
-
* `const sycl::device& dev` - the SYCL device to allocate on
434
-
* `const sycl::context& dev` - the SYCL `context` to which `device` belongs
520
+
* `const sycl::device& dev` - the SYCL device to allocate on (if applicable)
521
+
* `const sycl::context& ctxt` - the SYCL `context` to which `device` belongs
435
522
* `usm::alloc kind` - the type of allocation to perform
436
523
Return value:: Returns a pointer to the newly allocated `kind` memory on the specified `device` on success. If `kind` is `alloc::host`, `dev` is ignored. Memory allocated by `sycl::aligned_alloc` must be deallocated with `sycl::free` to avoid memory leaks. On failure, returns `nullptr`.
437
524
525
+
[source,cpp]
526
+
----
527
+
void *sycl::aligned_alloc(size_t alignment,
528
+
size_t size,
529
+
const sycl::queue& q,
530
+
usm::alloc kind);
531
+
----
532
+
533
+
Parameters::
534
+
* `size_t alignment` - specifies the byte alignment. Must be a valid alignment supported by the implementation.
535
+
* `size_t size` - number of bytes to allocate
536
+
* `const sycl::queue& q` - the SYCL `q` that provides the `device` (if applicable) and `context` to allocate against.
537
+
* `usm::alloc kind` - the type of allocation to perform
538
+
Return value:: Returns a pointer to the newly allocated `kind` memory on success. Memory allocated by `sycl::aligned_alloc` must be deallocated with `sycl::free` to avoid memory leaks. On failure, returns `nullptr`.
0 commit comments