Skip to content
Merged
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
18 changes: 18 additions & 0 deletions test/kernelabstractions.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
# KernelAbstractions has a testsuite that isn't part of the main package.
# Include it directly.

using KernelAbstractions, StaticArrays

@testset "#422: SMatrix return" begin
@kernel function smatrix_return_kernel(out)
i = @index(Global)
A = SMatrix{1,1,Float32}(3.0f0)
B = SMatrix{1,1,Float32}(2.0f0)
out[i] = (A * B)[1]
end

backend = OpenCL.OpenCLBackend()
out = KernelAbstractions.zeros(backend, Float32, 4)
kernel = smatrix_return_kernel(backend, 4)
kernel(out, ndrange=4)
KernelAbstractions.synchronize(backend)
@test Array(out) == fill(6.0f0, 4)
end

const KATestSuite = let
mod = @eval module $(gensym())
using ..Test
Expand Down
Loading