diff --git a/src/pool.jl b/src/pool.jl index 8f493d31..4940bfe9 100644 --- a/src/pool.jl +++ b/src/pool.jl @@ -276,7 +276,7 @@ end # Free slabs none of whose chunks are in use. Also run when the driver runs out of memory. function trim_pools!() - empty = with_pool_lock() do + slabs = with_pool_lock() do empty = Slab[] for pool in values(pools) for (base, slab) in collect(pool.slabs) @@ -291,7 +291,7 @@ function trim_pools!() empty end # on the LTS stack, this waits for outstanding work on the memory (see `release`) - foreach(slab -> release(slab.buf), empty) + foreach(slab -> release(slab.buf), slabs) return end oneL0.register_reclaim_callback!(trim_pools!) diff --git a/src/profiling.jl b/src/profiling.jl index a267bd82..4e2361af 100644 --- a/src/profiling.jl +++ b/src/profiling.jl @@ -83,7 +83,7 @@ function profile_internally(@nospecialize(f); trace::Bool=false, raw::Bool=false @warn "The profiler could not allocate memory for its records; some activity is missing from the results" end - seconds(t) = relative_seconds(t, t_start) + seconds = Base.Fix2(relative_seconds, t_start) device = (; records.device.kind, records.device.name, records.device.id, records.device.bytes, start=seconds.(records.device.start), stop=seconds.(records.device.stop)) diff --git a/test/Project.toml b/test/Project.toml index af23a69b..22fcd3e3 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -27,5 +27,8 @@ libigc_jll = "94295238-5935-5bd7-bb0f-b00942e9bdd5" oneAPI = "8f75cd03-7ff8-4ecb-9b8f-daf728133b1b" oneAPI_Support_jll = "b049733a-a71d-5ed3-8eba-7d323ac00b36" +[sources] +oneAPI = {path = ".."} + [compat] ParallelTestRunner = "2.8" diff --git a/test/runtests.jl b/test/runtests.jl index 89fb7dc0..9d7841f6 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -201,6 +201,15 @@ init_code = quote ..@grab_output, ..@on_device, ..sink end +# captured variables that get boxed (`Core.Box`) lose their type +using Test +if isdefined(Test, :detect_closure_boxes) + testsuite["closure boxes"] = quote + import KernelAbstractions + @test Test.detect_closure_boxes(oneAPI, Base.get_extension(oneAPI, :KernelAbstractionsExt)) == [] + end +end + # Retry test failures once to give a chance to memory-pressure related failures to pass runtests(oneAPI, args; testsuite, init_code, init_worker_code, env = worker_env, recycle_on_failure = true, retries = 1