Skip to content

Commit

Permalink
review 2
Browse files Browse the repository at this point in the history
  • Loading branch information
glou-nes committed Dec 14, 2024
1 parent 4d27e39 commit 3671ddb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Precompile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ using PrecompileTools: @setup_workload, @compile_workload
XLA.free_client(cpu)
deinitialize_dialect()
end
XLA.cpuclientcount[] = 0
end
3 changes: 3 additions & 0 deletions src/XLA.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,11 @@ end

SetLogLevel(x) = @ccall MLIR.API.mlir_c.SetLogLevel(x::Cint)::Cvoid

global cpuclientcount = Ref(0)
# TODO synchronization when async is not working because `future` in `ConcreteRArray` is always `nothing`
function CPUClient(asynchronous=false, node_id=0, num_nodes=1)
@assert cpuclientcount[] == 0
cpuclientcount[] += 1
f = Libdl.dlsym(Reactant_jll.libReactantExtra_handle, "MakeCPUClient")
client = ccall(f, Ptr{Cvoid}, (UInt, Cint, Cint), asynchronous, node_id, num_nodes)
#client = @ccall MLIR.API.mlir_c.MakeCPUClient(asynchronous::UInt8, node_id::Cint, num_nodes::Cint)::Ptr{Cvoid}
Expand Down

0 comments on commit 3671ddb

Please sign in to comment.