Skip to content

Use stacked method tables #615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 11, 2025
Merged
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
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ SparseArraysExt = "SparseArrays"
Adapt = "0.4, 1.0, 2.0, 3.0, 4"
Atomix = "0.1, 1"
EnzymeCore = "0.7, 0.8.1"
GPUCompiler = "1.2"
GPUCompiler = "1.6"
InteractiveUtils = "1.6"
LLVM = "9"
LinearAlgebra = "1.6"
MacroTools = "0.5"
PrecompileTools = "1"
SPIRVIntrinsics = "0.3"
SPIRVIntrinsics = "0.4"
SPIRV_LLVM_Backend_jll = "20"
SPIRV_Tools_jll = "2024.4, 2025.1"
SparseArrays = "<0.0.1, 1.6"
Expand Down
2 changes: 1 addition & 1 deletion src/pocl/backend.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module POCLKernels

using ..POCL
using ..POCL: @device_override, SPIRVIntrinsics, cl
using ..POCL: @device_override, SPIRVIntrinsics, cl, method_table
using ..POCL: device

import KernelAbstractions as KA
Expand Down
4 changes: 2 additions & 2 deletions src/pocl/compiler/compilation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const OpenCLCompilerJob = CompilerJob{SPIRVCompilerTarget, OpenCLCompilerParams}

GPUCompiler.runtime_module(::CompilerJob{<:Any, OpenCLCompilerParams}) = POCL

GPUCompiler.method_table(::OpenCLCompilerJob) = method_table
GPUCompiler.method_table_view(job::OpenCLCompilerJob) = GPUCompiler.StackedMethodTable(job.world, method_table, SPIRVIntrinsics.method_table)

# filter out OpenCL built-ins
# TODO: eagerly lower these using the translator API
Expand Down Expand Up @@ -50,7 +50,7 @@ end


# create GPUCompiler objects
target = SPIRVCompilerTarget(; supports_fp16, supports_fp64, version = v"1.2", kwargs...)
target = SPIRVCompilerTarget(; supports_fp16, supports_fp64, kwargs...)
params = OpenCLCompilerParams()
return CompilerConfig(target, params; kernel, name, always_inline)
end
Expand Down
3 changes: 3 additions & 0 deletions src/pocl/pocl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,12 @@ using GPUCompiler
import LLVM
using Adapt

## device overrides
import SPIRVIntrinsics
SPIRVIntrinsics.@import_all
SPIRVIntrinsics.@reexport_public
# local method table for device functions
Base.Experimental.@MethodTable(method_table)

include("compiler/compilation.jl")
include("compiler/execution.jl")
Expand Down
Loading