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
Copy file name to clipboardExpand all lines: sycl/doc/LinkedAllocations.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ data pointer provided by the user:
38
38
auto acc = buf.get_access<cl::sycl::access::mode::read_write>();
39
39
```
40
40
41
-
Or because a mapped host pointer obtained from a non-host native memory object
41
+
Or because a mapped host pointer obtained from a native device memory object
42
42
is used in its place (as is the case for linked commands, covered below).
43
43
44
44
## Linked allocation commands
@@ -49,8 +49,8 @@ as "linked" to another one if they satisfy these requirements:
49
49
- Exactly one of the two commands is associated with a host context.
50
50
- Neither of the commands is already linked.
51
51
52
-
The idea behind linked commands is that the non-host allocation of the pair is
53
-
supposed to reuse the host allocation, i.e. the host memory is requested to be
52
+
The idea behind linked commands is that the device allocation of the pair is
53
+
supposed to reuse the host allocation, i.e. the host memory is requested to be
54
54
shared between the two (the underlying backend is still free to ignore that
55
55
request and allocate additional memory if needed). The difference in handling
56
56
linked and unlinked allocations is summarized in the table below.
@@ -59,7 +59,7 @@ linked and unlinked allocations is summarized in the table below.
59
59
| - | -------- | ------ |
60
60
| Native memory object creation | Created with COPY_HOST_PTR if a host pointer is available and the first access mode does not discard the data. | Created with USE_HOST_PTR if a suitable host pointer is available, regardless of the first access mode. |
61
61
| Host allocation command behaviour | Skipped if a suitable user host pointer is available. | In addition to skipping the allocation if a suitable user pointer is provided, the allocation is also skipped if the host command is created after its linked counterpart (it's retrieved via map operation instead). |
62
-
| Memory transfer | Performed with read/write operations, non-host to non-host transfer is done with a host allocation as an intermediary (direct transfer is not supported by PI). | Only one allocation from the pair can be active at a time, the switch is done with map/unmap operations. |
62
+
| Memory transfer | Performed with read/write operations, device-to-device transfer is done with a host allocation as an intermediary (direct transfer is not supported by PI). | Only one allocation from the pair can be active at a time, the switch is done with map/unmap operations. Device-to-device transfer where one of the device allocations is linked is done with the host allocation from the pair as an intermediary (e.g. for transfer from unlinked device allocation A to linked device allocation B: map B -> read A to the host allocation -> unmap B). |
63
63
64
64
## Command linking approach
65
65
@@ -71,6 +71,6 @@ and host share the same physical memory). The motivation for this is two-fold:
71
71
should not result in any additional device memory allocation or copying between
72
72
the two during map/unmap operations.
73
73
- Even if the point above makes no difference for a particular pair of
74
-
allocations (e.g. no host pointer is available for the non-host allocation),
74
+
allocations (e.g. no host pointer is available for the device allocation),
75
75
it might be possible to exploit that later in the application for another device
0 commit comments