Skip to content

Commit 9566220

Browse files
committed
Update docstring and shorten error
1 parent be66b71 commit 9566220

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/KernelAbstractions.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,13 +532,14 @@ allocates an array using unified memory if the backend supports it. Use
532532
533533
!!! note
534534
Backend implementations **must** implement `allocate(::NewBackend, T, dims::Tuple)`
535+
Backend implementations **should** implement `allocate(::NewBackend, T, dims::Tuple; unified::Bool=false)`
535536
"""
536537
allocate(backend::Backend, T::Type, dims...; kwargs...) = allocate(backend, T, dims; kwargs...)
537538
function allocate(backend::Backend, T::Type, dims::Tuple; unified::Union{Nothing, Bool} = nothing)
538539
if isnothing(unified)
539540
throw(MethodError(allocate, (backend, T, dims)))
540541
elseif unified
541-
throw(ArgumentError("`$(typeof(backend))` either does not support unified memory or it has not yet defined `allocate(backend::$backend, T::Type, dims::Tuple; unified::Bool)`"))
542+
throw(ArgumentError("`$(typeof(backend))` does not support unified memory. If you believe it does, please open a github issue."))
542543
else
543544
return allocate(backend, T, dims)
544545
end

0 commit comments

Comments
 (0)