Skip to content

Commit 6535933

Browse files
committed
SPIRVIntrinsics 0.5 support
1 parent f1b7875 commit 6535933

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
@@ -178,7 +178,7 @@ end
178178
## Shared and Scratch Memory
179179

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

@@ -190,11 +190,11 @@ end
190190
## Synchronization and Printing
191191

192192
@device_override @inline function KA.__synchronize()
193-
SPIRVIntrinsics.barrier(SPIRVIntrinsics.CLK_LOCAL_MEM_FENCE | SPIRVIntrinsics.CLK_GLOBAL_MEM_FENCE)
193+
work_group_barrier.(POCL.LOCAL_MEM_FENCE | POCL.GLOBAL_MEM_FENCE)
194194
end
195195

196196
@device_override @inline function KA.__print(args...)
197-
SPIRVIntrinsics._print(args...)
197+
POCL._print(args...)
198198
end
199199

200200

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)