File tree Expand file tree Collapse file tree 1 file changed +29
-9
lines changed Expand file tree Collapse file tree 1 file changed +29
-9
lines changed Original file line number Diff line number Diff line change 1
1
# Invoke with
2
- # `julia --project=deps deps/build_local.jl [dbg/opt]`
2
+ # `julia --project=deps deps/build_local.jl [dbg/opt] [auto/cpu/cuda] `
3
3
4
4
# the pre-built ReactantExtra_jll might not be loadable on this platform
5
5
Reactant_jll = Base. UUID (" 0192cb87-2b54-54ad-80e0-3be72ad8a3c0" )
41
41
# --@local_config_cuda//:cuda_compiler=nvcc
42
42
# --crosstool_top="@local_config_cuda//crosstool:toolchain"
43
43
44
- arg = try
45
- run (Cmd (` nvidia-smi` ))
46
- " --config=cuda"
47
- catch
48
- " "
49
- end
50
-
51
- build_kind = if length (ARGS ) == 1
44
+ build_kind = if length (ARGS ) ≥ 1
52
45
kind = ARGS [1 ]
53
46
if kind ∉ (" dbg" , " opt" )
54
47
error (" Invalid build kind $(kind) . Valid options are 'dbg' and 'opt'" )
60
53
61
54
@info " Building JLL with -c $(build_kind) "
62
55
56
+ build_backend = if length (ARGS ) ≥ 2
57
+ backend = ARGS [2 ]
58
+ if backend ∉ (" auto" , " cpu" , " cuda" )
59
+ error (" Invalid build backend $(backend) . Valid options are 'auto', 'cpu', and 'cuda'" )
60
+ end
61
+ backend
62
+ else
63
+ " auto"
64
+ end
65
+
66
+ if build_backend == " auto"
67
+ build_backend = try
68
+ run (Cmd (` nvidia-smi` ))
69
+ " cuda"
70
+ catch
71
+ " cpu"
72
+ end
73
+ end
74
+
75
+ arg = if build_backend == " cuda"
76
+ " --config=cuda"
77
+ elseif build_backend == " cpu"
78
+ " "
79
+ end
80
+
81
+ @info " Building JLL with backend $(build_backend) "
82
+
63
83
if isempty (arg)
64
84
run (
65
85
Cmd (
You can’t perform that action at this time.
0 commit comments