tshort / StaticCompiler.jl

Compiles Julia code to a standalone library (experimental)
Other
488 stars 31 forks source link

Contextfix #143

Closed ArbitRandomUser closed 8 months ago

ArbitRandomUser commented 9 months ago

addressing https://github.com/tshort/StaticCompiler.jl/issues/138 native_llvm_module for multiple functions now starts a context compiles and links the functions within the same context .

ArbitRandomUser commented 9 months ago

i'll need some direction on how to proceed with this . Do i add the version dependent if statements from GPUCompiler.JuliaContext inside native_llvm_module ? , is that a good way to go about it ?

tshort commented 9 months ago

I think version checks can go inside native_llvm_module.

tshort commented 9 months ago

@gbaraldi, I'm curious if you have any comments on this PR. You wrote the original code here.

MasonProtter commented 9 months ago

@ArbitRandomUser sorry for the late reply, yeah you could do the version checks like in the link, but it looks like you could alternatively just use the JuliaContext function directly here, i.e.

JuliaContext() do ctx
    # code using ctx here
end

since JuliaContext appears to use the threadsafe context already.

ArbitRandomUser commented 8 months ago

tested on 1.8.0 and 1.9 on my machine.

ArbitRandomUser commented 8 months ago

good to go ? or do we fix nightlies also ?

MasonProtter commented 8 months ago

Thanks @ArbitRandomUser!