diff --git a/Project.toml b/Project.toml index 51859d2e..7b97ad34 100644 --- a/Project.toml +++ b/Project.toml @@ -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" diff --git a/src/pocl/backend.jl b/src/pocl/backend.jl index 70b16671..663e904b 100644 --- a/src/pocl/backend.jl +++ b/src/pocl/backend.jl @@ -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 diff --git a/src/pocl/compiler/compilation.jl b/src/pocl/compiler/compilation.jl index 5f88fba3..1a561b79 100644 --- a/src/pocl/compiler/compilation.jl +++ b/src/pocl/compiler/compilation.jl @@ -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 @@ -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 diff --git a/src/pocl/pocl.jl b/src/pocl/pocl.jl index b16114d5..1cc693c8 100644 --- a/src/pocl/pocl.jl +++ b/src/pocl/pocl.jl @@ -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")