diff --git a/test/kernelabstractions.jl b/test/kernelabstractions.jl index a78dfa6a..72640048 100644 --- a/test/kernelabstractions.jl +++ b/test/kernelabstractions.jl @@ -34,17 +34,8 @@ end @testset "launch configuration" begin backend = oneAPIBackend() - function select(kernel, ndrange, workgroupsize=nothing) - ndrange, workgroupsize, iterspace, _ = KA.launch_config(kernel, ndrange, workgroupsize) - KA.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)) === KA.NDLaunch{Int32}() - @test select(kernel, (4, 4, 4, 4)) === KA.LinearLaunch{Int32}() - - # which doesn't need divisions to compute the index of a dynamic N-d range A = oneAPI.zeros(Int, 64, 32, 16) ir = sprint(io -> oneAPI.@device_code_llvm io=io kernel(A; ndrange=size(A))) @test !occursin(r"\b[us](div|rem) ", ir) @@ -53,12 +44,10 @@ end # tuning for more work-groups (the testsuite above uses the default) Testsuite.launch_testsuite(()->oneAPIBackend(; prefer_blocks=true), oneArray) - # 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 = oneAPI.zeros(Int, 2) - for (dims, launch) in (((2^16 + 1, 2^15), KA.NDLaunch{Int}()), - ((2^11 + 1, 2^10, 2^10, 1), KA.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