Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/KernelAbstractions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
53 changes: 53 additions & 0 deletions src/pocl/backend.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -19,6 +21,57 @@ 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
return
end

## Memory Operations

Expand Down
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading