diff --git a/test/kernelabstractions.jl b/test/kernelabstractions.jl index 821a191d..485aa88c 100644 --- a/test/kernelabstractions.jl +++ b/test/kernelabstractions.jl @@ -96,28 +96,17 @@ end @testset "launch configuration" begin backend = OpenCLBackend() - function select(kernel, ndrange, workgroupsize=nothing) - ndrange, workgroupsize, iterspace, _ = KernelAbstractions.launch_config(kernel, ndrange, workgroupsize) - KernelAbstractions.select_launch(kernel, workgroupsize, iterspace) - end - - # kernels are launched on an N-d grid, computing indices in 32 bits + # a dynamic N-d range is indexed without divisions kernel = store_global_linear!(backend) - @test select(kernel, (64, 32, 16)) === KernelAbstractions.NDLaunch{Int32}() - @test select(kernel, (4, 4, 4, 4)) === KernelAbstractions.LinearLaunch{Int32}() - - # which doesn't need divisions to compute the index of a dynamic N-d range A = OpenCL.zeros(Int, 64, 32, 16) ir = sprint(io -> @device_code_llvm io=io kernel(A; ndrange=size(A))) @test !occursin(r"\b[su](div|rem) ", ir) @test Array(A) == LinearIndices(A) - # iteration spaces that don't fit 32 bits use 64-bit indices + # iteration spaces that don't fit 32-bit indices kernel = store_last_index!(backend) A = OpenCL.zeros(Int, 2) - for (dims, launch) in (((2^16 + 1, 2^15), KernelAbstractions.NDLaunch{Int}()), - ((2^11 + 1, 2^10, 2^10, 1), KernelAbstractions.LinearLaunch{Int}())) - @test select(kernel, dims) === launch + for dims in ((2^16 + 1, 2^15), (2^11 + 1, 2^10, 2^9, 2), (1, 1, 1, 2^31 + 1)) kernel(A; ndrange=dims) @test Array(A) == [prod(dims), dims[2]] end