Skip to content

Commit d5c67f6

Browse files
committed
fixup! Document the semantics of copyto! and add pagelock!
1 parent c37d0fa commit d5c67f6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/KernelAbstractions.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,14 @@ macro Const end
111111
copyto!(::Backend, dest::AbstractArray, src::AbstractArray)
112112
113113
Perform a `copyto!` operation that is execution ordered with respect to the backend.
114+
For most uses `Base.copyto!` provides a fully synchronous interface.
114115
115116
!!! note
116117
On some backends it may be necessary to first call [`pagelock!`](@ref) on host memory,
117118
to enable fully asynchronous behaviour w.r.t to the host.
118119
119120
!!! warning
120-
While this function is always asynchronous w.r.t. to the device, it may be synchronous w.r.t to the host.
121-
Additionally if the function is asynchronous w.r.t to the host, the user is required to gurantuee, the lifetime
121+
If the function is asynchronous w.r.t to the host, the user is required to gurantuee, the lifetime
122122
of the host buffer. Otherwise the user may cause a use-after-free, because the GC was able to prove that the host
123123
buffer can be freed.
124124

0 commit comments

Comments
 (0)