Skip to content

Commit

Permalink
Fix GPUCompiler interface implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Feb 27, 2024
1 parent 11e4682 commit 737330a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/compiler/compilation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ GPUCompiler.isintrinsic(job::oneAPICompilerJob, fn::String) =
job, fn) ||
in(fn, opencl_builtins)

function GPUCompiler.finish_module!(job::oneAPICompilerJob, mod::LLVM.Module)
invoke(GPUCompiler.finish_module!,
Tuple{CompilerJob{SPIRVCompilerTarget}, typeof(mod)},
job, mod)
function GPUCompiler.finish_module!(job::oneAPICompilerJob, mod::LLVM.Module,
entry::LLVM.Function)
entry = invoke(GPUCompiler.finish_module!,
Tuple{CompilerJob{SPIRVCompilerTarget}, typeof(mod), typeof(entry)},
job, mod, entry)

# OpenCL 2.0
push!(metadata(mod)["opencl.ocl.version"],
Expand All @@ -33,6 +34,8 @@ function GPUCompiler.finish_module!(job::oneAPICompilerJob, mod::LLVM.Module)
push!(metadata(mod)["opencl.spirv.version"],
MDNode([ConstantInt(Int32(1)),
ConstantInt(Int32(5))]))

return entry
end


Expand Down

0 comments on commit 737330a

Please sign in to comment.