Skip to content

Commit

Permalink
modifying test kernel for the flag to call
Browse files Browse the repository at this point in the history
  • Loading branch information
leios authored and vchuravy committed Nov 6, 2023
1 parent 32bf2bc commit 6a30441
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@ end

if Base.JLOptions().check_bounds == 0 || Base.JLOptions().check_bounds == 1
# testing bounds errors
@kernel inbounds=false my_bounded_kernel(a) = a[1]
@kernel inbounds=false function my_bounded_kernel()
idx = @index(Global, Linear)
end
@test_throws BoundsError(Int64[],(1,)) my_bounded_kernel(CPU())(Int[], ndrange=1)

Check failure on line 34 in test/runtests.jl

View workflow job for this annotation

GitHub Actions / CI (1.8, ubuntu-latest, x64)

Test Failed Expression: (my_bounded_kernel(CPU()))(Int[], ndrange = 1) Expected: BoundsError(Int64[], (1,)) Thrown: MethodError(cpu_my_bounded_kernel, (KernelAbstractions.CompilerMetadata{KernelAbstractions.NDIteration.DynamicSize, KernelAbstractions.NDIteration.DynamicCheck, CartesianIndex{1}, CartesianIndices{1, Tuple{Base.OneTo{Int64}}}, KernelAbstractions.NDIteration.NDRange{1, KernelAbstractions.NDIteration.DynamicSize, KernelAbstractions.NDIteration.DynamicSize, CartesianIndices{1, Tuple{Base.OneTo{Int64}}}, CartesianIndices{1, Tuple{Base.OneTo{Int64}}}}}(CartesianIndex(1,), CartesianIndices((1,)), KernelAbstractions.NDIteration.NDRange{1, KernelAbstractions.NDIteration.DynamicSize, KernelAbstractions.NDIteration.DynamicSize, CartesianIndices{1, Tuple{Base.OneTo{Int64}}}, CartesianIndices{1, Tuple{Base.OneTo{Int64}}}}(CartesianIndices((1,)), CartesianIndices((1024,)))), Int64[]), 0x0000000000008037)

Check failure on line 34 in test/runtests.jl

View workflow job for this annotation

GitHub Actions / CI (1.8, macOS-latest, x64)

Test Failed Expression: (my_bounded_kernel(CPU()))(Int[], ndrange = 1) Expected: BoundsError(Int64[], (1,)) Thrown: MethodError(cpu_my_bounded_kernel, (KernelAbstractions.CompilerMetadata{KernelAbstractions.NDIteration.DynamicSize, KernelAbstractions.NDIteration.DynamicCheck, CartesianIndex{1}, CartesianIndices{1, Tuple{Base.OneTo{Int64}}}, KernelAbstractions.NDIteration.NDRange{1, KernelAbstractions.NDIteration.DynamicSize, KernelAbstractions.NDIteration.DynamicSize, CartesianIndices{1, Tuple{Base.OneTo{Int64}}}, CartesianIndices{1, Tuple{Base.OneTo{Int64}}}}}(CartesianIndex(1,), CartesianIndices((1,)), KernelAbstractions.NDIteration.NDRange{1, KernelAbstractions.NDIteration.DynamicSize, KernelAbstractions.NDIteration.DynamicSize, CartesianIndices{1, Tuple{Base.OneTo{Int64}}}, CartesianIndices{1, Tuple{Base.OneTo{Int64}}}}(CartesianIndices((1,)), CartesianIndices((1024,)))), Int64[]), 0x0000000000008033)
end

if Base.JLOptions().check_bounds == 0 || Base.JLOptions().check_bounds == 2
@kernel inbounds=true my_inbounds_kernel(a) = a[1]
@kernel inbounds=true function my_bounded_kernel()
idx = @index(Global, Linear)
end
@test nothing == my_inbounds_kernel(CPU())(Int[], ndrange=1)
end

Expand Down

0 comments on commit 6a30441

Please sign in to comment.