Skip to content

Commit aa5ca4f

Browse files
authored
move default pagelock implementation
1 parent 45c12af commit aa5ca4f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/KernelAbstractions.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,13 @@ function copyto! end
149149
Pagelock (pin) a host memory buffer for a backend device. This may be necessary for [`copyto!`](@ref)
150150
to perform asynchronously w.r.t to the host/
151151
152+
This function should return `nothing`; or `missing` if not implemented.
153+
154+
152155
!!! note
153156
Backends **may** implement this function.
154157
"""
155-
function pagelock!(::Backend, x)
156-
return nothing
157-
end
158+
function pagelock! end
158159

159160
"""
160161
synchronize(::Backend)
@@ -601,6 +602,10 @@ function functional(::Backend)
601602
return missing
602603
end
603604

605+
function pagelock!(::Backend, x)
606+
return missing
607+
end
608+
604609
include("nditeration.jl")
605610
using .NDIteration
606611
import .NDIteration: get

src/cpu.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ function copyto!(backend::CPU, A, B)
3333
end
3434

3535
functional(::CPU) = true
36+
pagelock!(::CPU, x) = nothing
3637

3738
function (obj::Kernel{CPU})(args...; ndrange = nothing, workgroupsize = nothing)
3839
ndrange, workgroupsize, iterspace, dynamic = launch_config(obj, ndrange, workgroupsize)

0 commit comments

Comments
 (0)