Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use Float64 in tests, as some back-ends do not support it. #402

Merged
merged 1 commit into from
Jun 21, 2023
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
8 changes: 4 additions & 4 deletions test/compiler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,20 @@ function compiler_testsuite(backend, ArrayT)
@test !any(check_for_overdub, CI.code)
end

A = ArrayT{Float64}(undef, 1)
A = ArrayT{Float32}(undef, 1)
let (CI, rt) = @ka_code_typed square(backend())(A, A, ndrange=1)
# test that there is no invoke of overdub
@test !any(check_for_overdub, CI.code)
end

A = ArrayT{Float64}(undef, 1)
B = ArrayT{Float64}(undef, 1)
A = ArrayT{Float32}(undef, 1)
B = ArrayT{Float32}(undef, 1)
let (CI, rt) = @ka_code_typed pow(backend())(A, B, ndrange=1)
# test that there is no invoke of overdub
@test !any(check_for_overdub, CI.code)
end

A = ArrayT{Float64}(undef, 1)
A = ArrayT{Float32}(undef, 1)
B = ArrayT{Int32}(undef, 1)
let (CI, rt) = @ka_code_typed pow(backend())(A, B, ndrange=1)
# test that there is no invoke of overdub
Expand Down
10 changes: 5 additions & 5 deletions test/reflection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ end
end

function test_typed_kernel_dynamic(backend, backend_str, ArrayT)
A = ArrayT(ones(1024, 1024))
A = ArrayT(ones(Float32, 1024, 1024))
kernel = mul2(backend())
res = if backend == CPU
@ka_code_typed kernel(A, ndrange=size(A), workgroupsize=16)
Expand All @@ -32,7 +32,7 @@ function test_typed_kernel_dynamic(backend, backend_str, ArrayT)
end

function test_typed_kernel_dynamic_no_info(backend, backend_str, ArrayT)
A = ArrayT(ones(1024, 1024))
A = ArrayT(ones(Float32, 1024, 1024))
B = similar(A)
C = similar(A)
kernel = add3(backend())
Expand All @@ -46,7 +46,7 @@ function test_typed_kernel_dynamic_no_info(backend, backend_str, ArrayT)
end

function test_typed_kernel_static(backend, backend_str, ArrayT)
A = ArrayT(ones(1024, 1024))
A = ArrayT(ones(Float32, 1024, 1024))
kernel = if backend == CPU
mul2(backend(), 16)
else
Expand All @@ -62,7 +62,7 @@ function test_typed_kernel_static(backend, backend_str, ArrayT)
end

function test_typed_kernel_no_optimize(backend, backend_str, ArrayT)
A = ArrayT(ones(1024, 1024))
A = ArrayT(ones(Float32, 1024, 1024))
kernel = if backend == CPU
mul2(backend(), 16)
else
Expand All @@ -75,7 +75,7 @@ function test_typed_kernel_no_optimize(backend, backend_str, ArrayT)
end

function test_expr_kernel(backend, backend_str, ArrayT)
A = ArrayT(ones(1024, 1024))
A = ArrayT(ones(Float32, 1024, 1024))
C = similar(A)
kernel = if backend == CPU
addi(backend())
Expand Down