Skip to content

Commit 7a3766e

Browse files
Format code (#908)
Co-authored-by: enzyme-ci-bot[bot] <78882869+enzyme-ci-bot[bot]@users.noreply.github.com>
1 parent 28093da commit 7a3766e

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/xla/XLA.jl

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -184,25 +184,25 @@ for runtime in (:PJRT, :IFRT)
184184
state.default_client = cpu
185185

186186
# Try TPU if possible, then try GPU (CUDA)
187-
if !Reactant.precompiling()
188-
@static if !Sys.isapple()
189-
if Reactant.has_tpu()
190-
dataset_dir = @get_scratch!("libtpu")
191-
download_tpu(dataset_dir)
192-
try
193-
if was_initialized && haskey(state.clients, "tpu")
194-
XLA.free_client(state.clients["tpu"])
195-
XLA.$(runtime).tpu_client_count[] -= 1
187+
if !Reactant.precompiling()
188+
@static if !Sys.isapple()
189+
if Reactant.has_tpu()
190+
dataset_dir = @get_scratch!("libtpu")
191+
download_tpu(dataset_dir)
192+
try
193+
if was_initialized && haskey(state.clients, "tpu")
194+
XLA.free_client(state.clients["tpu"])
195+
XLA.$(runtime).tpu_client_count[] -= 1
196+
end
197+
tpu = $(runtime).TPUClient(;
198+
tpu_path=dataset_dir * "/libtpu.so", common_kwargs...
199+
)
200+
state.clients["tpu"] = tpu
201+
state.default_client = tpu
202+
catch e
203+
println(stdout, e)
196204
end
197-
tpu = $(runtime).TPUClient(;
198-
tpu_path=dataset_dir * "/libtpu.so", common_kwargs...
199-
)
200-
state.clients["tpu"] = tpu
201-
state.default_client = tpu
202-
catch e
203-
println(stdout, e)
204-
end
205-
else
205+
else
206206
try
207207
if was_initialized && haskey(state.clients, "gpu")
208208
XLA.free_client(state.clients["gpu"])

0 commit comments

Comments
 (0)