Skip to content

Commit 4539312

Browse files
committed
Format & fix
1 parent 0361db4 commit 4539312

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/KernelAbstractions.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ allocates an array using unified memory if the backend supports it. Use
543543
"""
544544
allocate(backend::Backend, T::Type, dims...; kwargs...) = allocate(backend, T, dims; kwargs...)
545545
function allocate(backend::Backend, T::Type, dims::Tuple; unified::Union{Nothing, Bool} = nothing)
546-
if isnothing(unified)
546+
return if isnothing(unified)
547547
throw(MethodError(allocate, (backend, T, dims)))
548548
elseif unified
549549
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)`"))

test/test.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function unittest_testsuite(Backend, backend_str, backend_mod, BackendArrayT; sk
8484
if unified
8585
@test U[3] isa Float32
8686
else
87-
@test_throws U[3]
87+
@test_throws ErrorException U[3]
8888
end
8989

9090
x = allocate(backend, Float32, 5)

0 commit comments

Comments
 (0)