Skip to content

Commit b597ae3

Browse files
committed
SPIRVIntrinsics 0.5 support
1 parent 1ac546f commit b597ae3

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ LLVM = "9.4.1"
4040
LinearAlgebra = "1.6"
4141
MacroTools = "0.5"
4242
PrecompileTools = "1"
43-
SPIRVIntrinsics = "0.4"
43+
SPIRVIntrinsics = "0.5"
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: 4 additions & 4 deletions
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, method_table
4+
using ..POCL: @device_override, cl, method_table
55
using ..POCL: device
66

77
import KernelAbstractions as KA
@@ -177,7 +177,7 @@ end
177177
## Shared and Scratch Memory
178178

179179
@device_override @inline function KA.SharedMemory(::Type{T}, ::Val{Dims}, ::Val{Id}) where {T, Dims, Id}
180-
ptr = SPIRVIntrinsics.emit_localmemory(T, Val(prod(Dims)))
180+
ptr = POCL.emit_localmemory(T, Val(prod(Dims)))
181181
CLDeviceArray(Dims, ptr)
182182
end
183183

@@ -189,11 +189,11 @@ end
189189
## Synchronization and Printing
190190

191191
@device_override @inline function KA.__synchronize()
192-
SPIRVIntrinsics.barrier(SPIRVIntrinsics.CLK_LOCAL_MEM_FENCE | SPIRVIntrinsics.CLK_GLOBAL_MEM_FENCE)
192+
work_group_barrier.(POCL.LOCAL_MEM_FENCE | POCL.GLOBAL_MEM_FENCE)
193193
end
194194

195195
@device_override @inline function KA.__print(args...)
196-
SPIRVIntrinsics._print(args...)
196+
POCL._print(args...)
197197
end
198198

199199

src/pocl/compiler/compilation.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ GPUCompiler.isintrinsic(job::OpenCLCompilerJob, fn::String) =
1616
Tuple{CompilerJob{SPIRVCompilerTarget}, typeof(fn)},
1717
job, fn
1818
) ||
19-
in(fn, opencl_builtins)
19+
in(fn, known_intrinsics) ||
20+
contains(fn, "__spirv_")
2021

2122

2223
## compiler implementation (cache, configure, compile, and link)

0 commit comments

Comments
 (0)