Skip to content

Commit 8d2b8e2

Browse files
[SYCL] Update doxygen comments for memcpy/copy (#8026)
There is no requirement for any pointer to be strictly inside a USM allocation, host allocation is also allowed. Fixes #4159
1 parent eb09e73 commit 8d2b8e2

File tree

2 files changed

+24
-16
lines changed

2 files changed

+24
-16
lines changed

sycl/include/sycl/handler.hpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2386,8 +2386,9 @@ class __SYCL_EXPORT handler {
23862386
__SYCL2020_DEPRECATED("use 'ext_oneapi_barrier' instead")
23872387
void barrier(const std::vector<event> &WaitList);
23882388

2389-
/// Copies data from one memory region to another, both pointed by
2390-
/// USM pointers.
2389+
/// Copies data from one memory region to another, each is either a host
2390+
/// pointer or a pointer within USM allocation accessible on this handler's
2391+
/// device.
23912392
/// No operations is done if \param Count is zero. An exception is thrown
23922393
/// if either \param Dest or \param Src is nullptr. The behavior is undefined
23932394
/// if any of the pointer parameters is invalid.
@@ -2397,8 +2398,9 @@ class __SYCL_EXPORT handler {
23972398
/// \param Count is a number of bytes to copy.
23982399
void memcpy(void *Dest, const void *Src, size_t Count);
23992400

2400-
/// Copies data from one memory region to another, both pointed by
2401-
/// USM pointers.
2401+
/// Copies data from one memory region to another, each is either a host
2402+
/// pointer or a pointer within USM allocation accessible on this handler's
2403+
/// device.
24022404
/// No operations is done if \param Count is zero. An exception is thrown
24032405
/// if either \param Dest or \param Src is nullptr. The behavior is undefined
24042406
/// if any of the pointer parameters is invalid.

sycl/include/sycl/queue.hpp

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,9 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
554554
event memset(void *Ptr, int Value, size_t Count,
555555
const std::vector<event> &DepEvents);
556556

557-
/// Copies data from one memory region to another, both pointed by
558-
/// USM pointers.
557+
/// Copies data from one memory region to another, each is either a host
558+
/// pointer or a pointer within USM allocation accessible on the device
559+
/// associated with this queue.
559560
/// No operations is done if \param Count is zero. An exception is thrown
560561
/// if either \param Dest or \param Src is nullptr. The behavior is undefined
561562
/// if any of the pointer parameters is invalid.
@@ -566,8 +567,9 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
566567
/// \return an event representing copy operation.
567568
event memcpy(void *Dest, const void *Src, size_t Count);
568569

569-
/// Copies data from one memory region to another, both pointed by
570-
/// USM pointers.
570+
/// Copies data from one memory region to another, each is either a host
571+
/// pointer or a pointer within USM allocation accessible on the device
572+
/// associated with this queue.
571573
/// No operations is done if \param Count is zero. An exception is thrown
572574
/// if either \param Dest or \param Src is nullptr. The behavior is undefined
573575
/// if any of the pointer parameters is invalid.
@@ -579,8 +581,9 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
579581
/// \return an event representing copy operation.
580582
event memcpy(void *Dest, const void *Src, size_t Count, event DepEvent);
581583

582-
/// Copies data from one memory region to another, both pointed by
583-
/// USM pointers.
584+
/// Copies data from one memory region to another, each is either a host
585+
/// pointer or a pointer within USM allocation accessible on the device
586+
/// associated with this queue.
584587
/// No operations is done if \param Count is zero. An exception is thrown
585588
/// if either \param Dest or \param Src is nullptr. The behavior is undefined
586589
/// if any of the pointer parameters is invalid.
@@ -594,8 +597,9 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
594597
event memcpy(void *Dest, const void *Src, size_t Count,
595598
const std::vector<event> &DepEvents);
596599

597-
/// Copies data from one memory region to another, both pointed by
598-
/// USM pointers.
600+
/// Copies data from one memory region to another, each is either a host
601+
/// pointer or a pointer within USM allocation accessible on the device
602+
/// associated with this queue.
599603
/// No operations is done if \param Count is zero. An exception is thrown
600604
/// if either \param Dest or \param Src is nullptr. The behavior is undefined
601605
/// if any of the pointer parameters is invalid.
@@ -612,8 +616,9 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
612616
return this->memcpy(Dest, Src, Count * sizeof(T));
613617
}
614618

615-
/// Copies data from one memory region to another, both pointed by
616-
/// USM pointers.
619+
/// Copies data from one memory region to another, each is either a host
620+
/// pointer or a pointer within USM allocation accessible on the device
621+
/// associated with this queue.
617622
/// No operations is done if \param Count is zero. An exception is thrown
618623
/// if either \param Dest or \param Src is nullptr. The behavior is undefined
619624
/// if any of the pointer parameters is invalid.
@@ -632,8 +637,9 @@ class __SYCL_EXPORT queue : public detail::OwnerLessBase<queue> {
632637
return this->memcpy(Dest, Src, Count * sizeof(T), DepEvent);
633638
}
634639

635-
/// Copies data from one memory region to another, both pointed by
636-
/// USM pointers.
640+
/// Copies data from one memory region to another, each is either a host
641+
/// pointer or a pointer within USM allocation accessible on the device
642+
/// associated with this queue.
637643
/// No operations is done if \param Count is zero. An exception is thrown
638644
/// if either \param Dest or \param Src is nullptr. The behavior is undefined
639645
/// if any of the pointer parameters is invalid.

0 commit comments

Comments
 (0)