Using Val as kernel argument triggers an assertion
Created by: mwarusz
MWE
using KernelAbstractions
@kernel function kernel_val!(a, ::Val{m}) where {m}
@inbounds a[1] = m
end
let
a = zeros(1)
kernel! = kernel_val!(CPU(), 1, 1)
event = kernel!(a, Val(1))
wait(event)
end
results in
ERROR: LoadError: LoadError: AssertionError: isexpr(decl, :call)
Stacktrace:
[1] __kernel(::Expr) at /home/mwarusz/repos/KernelAbstractions.jl/src/macros.jl:10
[2] @kernel(::LineNumberNode, ::Module, ::Any) at /home/mwarusz/repos/KernelAbstractions.jl/src/KernelAbstractions.jl:41
in expression starting at /home/mwarusz/projects/kernels/val_issue.jl:3
in expression starting at /home/mwarusz/projects/kernels/val_issue.jl:3