Skip to content

Commit 386197e

Browse files
committed
Use REACTANT_DEFAULT_DEVICE to set default device ID with env var
1 parent 9528846 commit 386197e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/xla/Client.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ function get_device end
1313
function get_addressable_device end
1414
function platform_name end
1515

16-
default_device(client::AbstractClient) = first(addressable_devices(client))
16+
default_device(client::AbstractClient) =
17+
addressable_devices(client)[something(tryparse(Int, get(ENV, "REACTANT_DEFAULT_DEVICE", "1")), 1)]

0 commit comments

Comments
 (0)