Skip to content

Commit 31dc584

Browse files
authored
Use stacked method tables (#615)
1 parent a264730 commit 31dc584

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ SparseArraysExt = "SparseArrays"
3434
Adapt = "0.4, 1.0, 2.0, 3.0, 4"
3535
Atomix = "0.1, 1"
3636
EnzymeCore = "0.7, 0.8.1"
37-
GPUCompiler = "1.2"
37+
GPUCompiler = "1.6"
3838
InteractiveUtils = "1.6"
3939
LLVM = "9.4.1"
4040
LinearAlgebra = "1.6"
4141
MacroTools = "0.5"
4242
PrecompileTools = "1"
43-
SPIRVIntrinsics = "0.3"
43+
SPIRVIntrinsics = "0.4"
4444
SPIRV_LLVM_Backend_jll = "20"
4545
SPIRV_Tools_jll = "2024.4, 2025.1"
4646
SparseArrays = "<0.0.1, 1.6"

src/pocl/backend.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module POCLKernels
22

33
using ..POCL
4-
using ..POCL: @device_override, SPIRVIntrinsics, cl
4+
using ..POCL: @device_override, SPIRVIntrinsics, cl, method_table
55
using ..POCL: device
66

77
import KernelAbstractions as KA

src/pocl/compiler/compilation.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const OpenCLCompilerJob = CompilerJob{SPIRVCompilerTarget, OpenCLCompilerParams}
66

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

9-
GPUCompiler.method_table(::OpenCLCompilerJob) = method_table
9+
GPUCompiler.method_table_view(job::OpenCLCompilerJob) = GPUCompiler.StackedMethodTable(job.world, method_table, SPIRVIntrinsics.method_table)
1010

1111
# filter out OpenCL built-ins
1212
# TODO: eagerly lower these using the translator API
@@ -50,7 +50,7 @@ end
5050

5151

5252
# create GPUCompiler objects
53-
target = SPIRVCompilerTarget(; supports_fp16, supports_fp64, version = v"1.2", kwargs...)
53+
target = SPIRVCompilerTarget(; supports_fp16, supports_fp64, kwargs...)
5454
params = OpenCLCompilerParams()
5555
return CompilerConfig(target, params; kernel, name, always_inline)
5656
end

src/pocl/pocl.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,12 @@ using GPUCompiler
4444
import LLVM
4545
using Adapt
4646

47+
## device overrides
4748
import SPIRVIntrinsics
4849
SPIRVIntrinsics.@import_all
4950
SPIRVIntrinsics.@reexport_public
51+
# local method table for device functions
52+
Base.Experimental.@MethodTable(method_table)
5053

5154
include("compiler/compilation.jl")
5255
include("compiler/execution.jl")

0 commit comments

Comments
 (0)