From 857cdb9369aeeeb6cae1e0479f45343fe5c7a4cc 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 3881da55c..50469bfad 100644 --- a/src/KernelAbstractions.jl +++ b/src/KernelAbstractions.jl @@ -662,6 +662,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 3717983b8b509438b9c356f091ce8632c7f02b95 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 f23e20b0f..78bd6e514 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.KernelIntrinsics 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 1640bde00ac47de8c83d1c88ccc4676a341ffda7 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 78bd6e514..8dc3ee23e 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 87dd6fcce0645c960eb954e88e2f355e894e1469 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 8dc3ee23e..0e62fc0be 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