diff --git a/src/XLA.jl b/src/XLA.jl index af2b9539a..bf4e311af 100644 --- a/src/XLA.jl +++ b/src/XLA.jl @@ -8,9 +8,10 @@ mutable struct Client function Client(client::Ptr{Cvoid}) @assert client != C_NULL client = new(client) - finalizer(client) do client - @ccall MLIR.API.mlir_c.FreeClient(client.client::Ptr{Cvoid})::Cvoid - end + #TODO: Client are also constructed from MLIR.API.mlir_c.BufferToClient so the pointer cannot be free when Client is cleaned + #finalizer(client) do client + # @ccall MLIR.API.mlir_c.FreeClient(client.client::Ptr{Cvoid})::Cvoid + #end return client end end diff --git a/src/precompile.jl b/src/precompile.jl index b3cf02e73..83d709626 100644 --- a/src/precompile.jl +++ b/src/precompile.jl @@ -3,7 +3,8 @@ using PrecompileTools: @setup_workload, @compile_workload @setup_workload begin @compile_workload begin Reactant.__init__() - interp = Reactant.ReactantInterpreter() - Base.code_ircode(sum, (Reactant.TracedRArray{Float64,2},); interp) + cpu = XLA.CPUClient() + x = Reactant.ConcreteRArray(randn(Float64, 2, 2); client=cpu) + @code_hlo optimize = false sum(x) end end