Skip to content
Merged
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
12 changes: 11 additions & 1 deletion src/spirv.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ const SPIRV_LLVM_Backend_jll =
const SPIRV_LLVM_Translator_unified_jll =
LazyModule("SPIRV_LLVM_Translator_unified_jll",
UUID("85f0d8ed-5b39-5caa-b1ae-7472de402361"))
const SPIRV_LLVM_Translator_jll =
LazyModule("SPIRV_LLVM_Translator_jll",
UUID("4a5d46fc-d8cf-5151-a261-86b458210efb"))
const SPIRV_Tools_jll =
LazyModule("SPIRV_Tools_jll",
UUID("6ac6d60f-d740-5983-97d7-a4482c0689f4"))
Expand Down Expand Up @@ -127,7 +130,14 @@ end
cmd = `$(cmd) -spirv-ext=$str`
end
elseif job.config.target.backend === :khronos
cmd = `$(SPIRV_LLVM_Translator_unified_jll.llvm_spirv()) -o $translated $input --spirv-debug-info-version=ocl-100`
translator = if isavailable(SPIRV_LLVM_Translator_jll)
SPIRV_LLVM_Translator_jll.llvm_spirv()
elseif isavailable(SPIRV_LLVM_Translator_unified_jll)
SPIRV_LLVM_Translator_unified_jll.llvm_spirv()
else
error("This functionality requires the SPIRV_LLVM_Translator_jll or SPIRV_LLVM_Translator_unified_jll package, which should be installed and loaded first.")
end
cmd = `$translator -o $translated $input --spirv-debug-info-version=ocl-100`

if !isempty(job.config.target.extensions)
str = join(map(ext->"+$ext", job.config.target.extensions), ",")
Expand Down
2 changes: 1 addition & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ 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"
SPIRV_LLVM_Translator_unified_jll = "85f0d8ed-5b39-5caa-b1ae-7472de402361"
SPIRV_LLVM_Translator_jll = "4a5d46fc-d8cf-5151-a261-86b458210efb"
SPIRV_Tools_jll = "6ac6d60f-d740-5983-97d7-a4482c0689f4"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
2 changes: 1 addition & 1 deletion test/setup.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Distributed, Test, GPUCompiler, LLVM

using SPIRV_LLVM_Backend_jll, SPIRV_LLVM_Translator_unified_jll, SPIRV_Tools_jll
using SPIRV_LLVM_Backend_jll, SPIRV_LLVM_Translator_jll, SPIRV_Tools_jll

# include all helpers
include(joinpath(@__DIR__, "helpers", "runtime.jl"))
Expand Down
Loading