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
2 changes: 1 addition & 1 deletion src/compiler/execution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export @opencl, clfunction
## high-level @opencl interface

const MACRO_KWARGS = [:launch]
const COMPILER_KWARGS = [:kernel, :name, :always_inline, :extensions]
const COMPILER_KWARGS = [:kernel, :name, :always_inline, :extensions, :backend]
const LAUNCH_KWARGS = [:global_size, :local_size, :queue]

macro opencl(ex...)
Expand Down
1 change: 1 addition & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SPIRVIntrinsics = "71d1d633-e7e8-4a92-83a1-de8814b09ba8"
SPIRV_LLVM_Backend_jll = "4376b9bf-cff8-51b6-bb48-39421dff0d0c"
SPIRV_LLVM_Translator_jll = "4a5d46fc-d8cf-5151-a261-86b458210efb"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Expand Down
18 changes: 18 additions & 0 deletions test/execution.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using SPIRV_LLVM_Translator_jll

@testset "execution" begin

@testset "@opencl" begin
Expand Down Expand Up @@ -133,4 +135,20 @@ end
end
end

@testset "backends" begin
llvm_backend_llvm = sprint() do io
OpenCL.code_llvm(io, () -> nothing, (); dump_module = true, backend = :llvm)
end
if Int === Int64
@test occursin("target triple = \"spirv64-unknown-unknown-unknown\"", llvm_backend_llvm)
end

llvm_backend_khronos = sprint() do io
OpenCL.code_llvm(io, () -> nothing, (); dump_module = true, backend = :khronos)
end
if Int === Int64
@test occursin("target triple = \"spir64-unknown-unknown\"", llvm_backend_khronos)
end
end

end
Loading