Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/KernelAbstractions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,21 @@ function ones(backend, ::Type{T}, dims::Tuple) where T
end

"""
priority!(::Backend, prio::Symbol)
supports_atomics(::Backend)

Returns whether `@atomic` operations are supported by the backend.
"""
supports_atomics(backend) = true

"""
supports_float64(::Backend)

Returns whether `Float64` values are supported by the backend.
"""
supports_float64(backend) = true

"""
priority!(::Backend, prio::Symbol)

Set the priority for the backend stream/queue. This is an optional
feature that backends may or may not implement. If a backend shall
Expand Down
5 changes: 3 additions & 2 deletions test/convert.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ using KernelAbstractions, Test
end

function convert_testsuite(backend, ArrayT)
ET = KernelAbstractions.supports_float64(backend) ? Float64 : Float32

N = 32
d_A = ArrayT([rand()*3 for i = 1:N])
d_A = ArrayT([rand(ET)*3 for i = 1:N])

# 30 because we have 10 integer types and we have 3 operations
d_B = ArrayT(zeros(N, 30))
d_B = ArrayT(zeros(ET, N, 30))

@testset "convert test" begin
kernel = convert_kernel!(backend(), 4)
Expand Down
7 changes: 4 additions & 3 deletions test/copyto.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ using Random
function copyto_testsuite(Backend)
M = 1024
backend = Backend()
ET = KernelAbstractions.supports_float64(backend) ? Float64 : Float32

A = rand!(allocate(backend, Float64, M))
B = rand!(allocate(backend, Float64, M))
A = rand!(allocate(backend, ET, M))
B = rand!(allocate(backend, ET, M))

a = Array{Float64}(undef, M)
a = Array{ET}(undef, M)
copyto!(backend, a, B)
copyto!(backend, A, a)
synchronize(backend)
Expand Down