Skip to content

Switch to the LLVM SPIR-V back-end. #491

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Preferences = "21216c6a-2e73-6563-6e65-726566657250"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SPIRVIntrinsics = "71d1d633-e7e8-4a92-83a1-de8814b09ba8"
SPIRV_LLVM_Translator_unified_jll = "85f0d8ed-5b39-5caa-b1ae-7472de402361"
SPIRV_LLVM_Backend_jll = "4376b9bf-cff8-51b6-bb48-39421dff0d0c"
SPIRV_Tools_jll = "6ac6d60f-d740-5983-97d7-a4482c0689f4"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
Expand All @@ -32,13 +32,13 @@ Adapt = "4"
CEnum = "0.4, 0.5"
ExprTools = "0.1"
GPUArrays = "11.2.1"
GPUCompiler = "0.23, 0.24, 0.25, 0.26, 0.27, 1"
GPUCompiler = "1.2"
KernelAbstractions = "0.9.1"
LLVM = "6, 7, 8, 9"
NEO_jll = "=24.26.30049"
Preferences = "1"
SPIRVIntrinsics = "0.2"
SPIRV_LLVM_Translator_unified_jll = "0.7"
SPIRV_LLVM_Backend_jll = "20"
SpecialFunctions = "1.3, 2"
StaticArrays = "1"
julia = "1.10"
Expand Down
5 changes: 1 addition & 4 deletions src/compiler/compilation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,8 @@ end
supports_fp16 = oneL0.module_properties(device()).fp16flags & oneL0.ZE_DEVICE_MODULE_FLAG_FP16 == oneL0.ZE_DEVICE_MODULE_FLAG_FP16
supports_fp64 = oneL0.module_properties(device()).fp64flags & oneL0.ZE_DEVICE_MODULE_FLAG_FP64 == oneL0.ZE_DEVICE_MODULE_FLAG_FP64

# TODO: emit printf format strings in constant memory
extensions = String["SPV_EXT_relaxed_printf_string_address_space"]

# create GPUCompiler objects
target = SPIRVCompilerTarget(; extensions, supports_fp16, supports_fp64, kwargs...)
target = SPIRVCompilerTarget(; supports_fp16, supports_fp64, kwargs...)
params = oneAPICompilerParams()
CompilerConfig(target, params; kernel, name, always_inline)
end
Expand Down
2 changes: 1 addition & 1 deletion src/oneAPI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ using LLVM
using LLVM.Interop
using Core: LLVMPtr

using SPIRV_LLVM_Translator_unified_jll, SPIRV_Tools_jll
using SPIRV_LLVM_Backend_jll, SPIRV_Tools_jll

export oneL0

Expand Down
2 changes: 1 addition & 1 deletion src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ function versioninfo(io::IO=stdout)
if Sys.islinux()
println(io, "Binary dependencies:")
for jll in [oneL0.NEO_jll, oneL0.NEO_jll.libigc_jll, oneL0.NEO_jll.gmmlib_jll,
SPIRV_LLVM_Translator_unified_jll, SPIRV_Tools_jll]
SPIRV_LLVM_Backend_jll, SPIRV_Tools_jll]
name = string(jll)
print(io, "- $(name[1:end-4]): $(Base.pkgversion(jll))")
if jll.host_platform !== nothing
Expand Down
1 change: 1 addition & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ NEO_jll = "700fe977-ac61-5f37-bbc8-c6c4b2b6a9fd"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SPIRV_LLVM_Backend_jll = "4376b9bf-cff8-51b6-bb48-39421dff0d0c"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Expand Down