From 812ae8b51b26dab829edc8aa035074ce6041b4af Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Thu, 18 Jun 2026 10:37:07 -0300 Subject: [PATCH 1/4] versioninfo --- src/KernelAbstractions.jl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/KernelAbstractions.jl b/src/KernelAbstractions.jl index b0a909d1a..724f7df41 100644 --- a/src/KernelAbstractions.jl +++ b/src/KernelAbstractions.jl @@ -664,6 +664,19 @@ function priority!(::Backend, prio::Symbol) return nothing end +""" + versioninfo(io::IO=stdout, backend::Backend)::Nothing + +Print information about `backend` to `io`. It is up to the backends to +determine what is relevant. + +!!! note + Backend implementations **may** implement this function. If they do + so, they should implement `versioninfo(io::IO, ::Backend)::Nothing` +""" +versioninfo(io::IO, b::Backend) = println(io, "`versioninfo` is not implemented for $b") +versioninfo(b::Backend) = versioninfo(stdout, b) + """ device(::Backend)::Int From aa9265d43c53c26a1d3bc6601b41c602b021350c Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Thu, 18 Jun 2026 10:52:08 -0300 Subject: [PATCH 2/4] Implement for CPU backend --- src/pocl/backend.jl | 52 +++++++++++++++++++++++++++++++++++++++++++++ test/runtests.jl | 1 + 2 files changed, 53 insertions(+) diff --git a/src/pocl/backend.jl b/src/pocl/backend.jl index 1edcaceb4..de0b9baad 100644 --- a/src/pocl/backend.jl +++ b/src/pocl/backend.jl @@ -4,6 +4,8 @@ using ..POCL using ..POCL: @device_override, cl, method_table using ..POCL: device, clconvert, clfunction +using SPIRV_LLVM_Backend_jll, SPIRV_Tools_jll + import KernelAbstractions as KA import KernelAbstractions.KernelInterface as KI @@ -19,6 +21,56 @@ export POCLBackend struct POCLBackend <: KA.GPU end +function KA.versioninfo(io::IO, ::POCLBackend) + println(io, "KernelAbstractions.jl version $(pkgversion(@__MODULE__))") + println(io) + + println(io, "Toolchain:") + println(io, " - Julia v$(VERSION)") + for jll in [SPIRV_LLVM_Backend_jll, SPIRV_Tools_jll, cl.pocl_standalone_jll] + name = string(jll) + println(io, " - $(name[1:end-4]): $(pkgversion(jll))") + end + println(io) + + println(io, "Julia packages:") + for name in [:GPUCompiler, :LLVM, :SPIRVIntrinsics] + mod = getfield(POCL, name) + println(io, "- $(name): $(Base.pkgversion(mod))") + end + println(io) + + println(io, "POCL Version: ") + for platform in cl.platforms() + print(io, " OpenCL $(platform.opencl_version.major).$(platform.opencl_version.minor)") + if !isempty(platform.version) + print(io, ", $(platform.version)") + end + println(io) + + for device in cl.devices(platform) + print(io, " ยท $(device.name)") + + # show a list of tags + tags = [] + ## relevant extensions + if in("cl_khr_fp16", device.extensions) + push!(tags, "fp16") + end + if in("cl_khr_fp64", device.extensions) + push!(tags, "fp64") + end + if in("cl_khr_il_program", device.extensions) + push!(tags, "il") + end + ## render + if !isempty(tags) + print(io, " (", join(tags, ", "), ")") + end + println(io) + end + end +end ## Memory Operations diff --git a/test/runtests.jl b/test/runtests.jl index c1ab3a845..872b4e3d8 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3,6 +3,7 @@ using Test include("testsuite.jl") +KernelAbstractions.versioninfo(POCLBackend()) @info "Configuration" pocl = KernelAbstractions.POCL.nanoOpenCL.pocl_standalone_jll.libpocl @testset "CPU back-end" begin From 68b27213d9f67fc9d24ee6e939d9e2fdea4263e6 Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Thu, 18 Jun 2026 10:58:56 -0300 Subject: [PATCH 3/4] Format --- src/pocl/backend.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocl/backend.jl b/src/pocl/backend.jl index de0b9baad..0220c4758 100644 --- a/src/pocl/backend.jl +++ b/src/pocl/backend.jl @@ -29,7 +29,7 @@ function KA.versioninfo(io::IO, ::POCLBackend) println(io, " - Julia v$(VERSION)") for jll in [SPIRV_LLVM_Backend_jll, SPIRV_Tools_jll, cl.pocl_standalone_jll] name = string(jll) - println(io, " - $(name[1:end-4]): $(pkgversion(jll))") + println(io, " - $(name[1:(end - 4)]): $(pkgversion(jll))") end println(io) From c1a320c6d59a88ee4227774605a3e5c3514af327 Mon Sep 17 00:00:00 2001 From: Christian Guinard <28689358+christiangnrd@users.noreply.github.com> Date: Thu, 18 Jun 2026 11:01:24 -0300 Subject: [PATCH 4/4] Format --- src/pocl/backend.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pocl/backend.jl b/src/pocl/backend.jl index 0220c4758..3b0fdb3fa 100644 --- a/src/pocl/backend.jl +++ b/src/pocl/backend.jl @@ -70,6 +70,7 @@ function KA.versioninfo(io::IO, ::POCLBackend) println(io) end end + return end ## Memory Operations