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
@@ -449,7 +449,7 @@ For optimal performance, the low-level runtime that manages the data motion acro
449
449
450
450
##### `Buffer`
451
451
`Buffer<T>` is a view of a contiguous sequence of objects of type `T` in the host memory that can be automatically moved by the runtime to/from the device memory. Here `Fn::b` is a view of the 2-element sequence pointed to by `Fn::F`; once it's constructed the content of `Fn::F` will be moved to/from the device by the runtime. The subsequent use of `Fn::b` cause the automatic transfers of data to (`device::select(f_n.b)`) and from (`ttg::device::wait(f_n.b)`) the device.
452
-
A `Buffer<T>` can be either owning or non-owning. In the example above, the memory is owned by the `unique_ptr`.
452
+
A `Buffer<T>` can be either freestanding or with lifetime tied to the lifetime of the host buffer; the latter is used in the example above, indicated by the use of `shared_ptr` to manage the lifetime of the host buffer.
453
453
If no pointer is passed to the constructor of `Buffer<T>` the buffer allocates the necessary host-side memory.
454
454
In order to guarantee relocatability of buffers, the data managed by a buffer should be located on the heap, i.e., dynamically allocated.
0 commit comments