-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathruntests.jl
44 lines (31 loc) · 1.48 KB
/
runtests.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using KernelAbstractions
using Test
include("testsuite.jl")
@info "Configuration" pocl = KernelAbstractions.POCL.nanoOpenCL.pocl_jll.libpocl
@testset "CPU back-end" begin
struct CPUBackendArray{T, N, A} end # Fake and unused
Testsuite.testsuite(CPU, "CPU", Base, Array, CPUBackendArray)
end
struct NewBackend <: KernelAbstractions.GPU end
@testset "Default host implementation" begin
backend = NewBackend()
@test_throws MethodError KernelAbstractions.synchronize(backend)
@test_throws MethodError KernelAbstractions.allocate(backend, Float32, 1)
@test_throws MethodError KernelAbstractions.allocate(backend, Float32, (1,))
@test_throws MethodError KernelAbstractions.allocate(backend, Float32, 1, 2)
@test_throws MethodError KernelAbstractions.zeros(backend, Float32, 1)
@test_throws MethodError KernelAbstractions.ones(backend, Float32, 1)
@test KernelAbstractions.supports_atomics(backend) == true
@test KernelAbstractions.supports_float64(backend) == true
@test KernelAbstractions.priority!(backend, :high) === nothing
@test KernelAbstractions.priority!(backend, :normal) === nothing
@test KernelAbstractions.priority!(backend, :low) === nothing
@test_throws ErrorException KernelAbstractions.priority!(backend, :middle)
@test KernelAbstractions.functional(backend) === missing
end
# include("extensions/enzyme.jl")
# @static if VERSION >= v"1.7.0"
# @testset "Enzyme" begin
# enzyme_testsuite(CPU, Array)
# end
# end