Skip to content

Commit 2c169ef

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

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/xla/Client.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,8 @@ 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+
function default_device(client::AbstractClient)
17+
return addressable_devices(client)[something(
18+
tryparse(Int, get(ENV, "REACTANT_DEFAULT_DEVICE", "1")), 1
19+
)]
20+
end

0 commit comments

Comments
 (0)