Skip to content

Commit 59ff5f4

Browse files
committed
Ensure kernel=false for runtime compilation.
1 parent a031d6c commit 59ff5f4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/rtlib.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ end
118118
function build_runtime(@nospecialize(job::CompilerJob); ctx)
119119
mod = LLVM.Module("GPUCompiler run-time library"; ctx)
120120

121+
# the compiler job passed into here is identifies the job that requires the runtime.
122+
# derive a job that represents the runtime itself (notably with kernel=false).
123+
source = FunctionSpec(identity, Tuple{Nothing}, false, nothing, job.source.world_age)
124+
job = CompilerJob(job.target, source, job.params)
125+
121126
for method in values(Runtime.methods)
122127
def = if isa(method.def, Symbol)
123128
isdefined(runtime_module(job), method.def) || continue

0 commit comments

Comments
 (0)