8000 improve benchmarking · DiffSharp/DiffSharp@1859c42 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1859c42

Browse files
committed
improve benchmarking
1 parent 2f8bb86 commit 1859c42

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

tests/Dsbench/Program.fs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,53 +103,53 @@ let rec parseArgsRec args optionsSoFar =
103103
parseArgsRec xss {optionsSoFar with benchmarks= optionsSoFar.benchmarks @ [f]}
104104
| _ ->
105105
eprintfn "Option -b needs to be followed by a benchmark name (1, 2)."
106-
parseArgsRec xs optionsSoFar
106+
exit 1
107107
| ("/m" | "-m") ::xs ->
108108
match xs with
109109
| (("auto" | "numeric") as f)::xss ->
110110
parseArgsRec xss {optionsSoFar with modes = optionsSoFar.modes @ [f]}
111111
| _ ->
112112
eprintfn "Option -b needs to be followed by a mode name (auto,numeric)."
113-
parseArgsRec xs optionsSoFar
113+
exit 1
114114
| "/f"::xs | "-f"::xs ->
115115
match xs with
116116
| f::xss ->
117117
parseArgsRec xss {optionsSoFar with fileName = f; changed = true}
118118
| _ ->
119119
eprintfn "Option -f needs to be followed by a file name."
120-
parseArgsRec xs optionsSoFar
120+
exit 1
121121
| "/r"::xs | "-r"::xs ->
122122
match xs with
123123
| r::xss ->
124124
let couldparse, reps = System.Int32.TryParse r
125125
if couldparse then
126126
if reps < minRepetitions then
127127
eprintfn "Given value for -r was too small, using the minimum: %i." minRepetitions
128-
parseArgsRec xss {optionsSoFar with repetitions = minRepetitions; changed = true}
128+
exit 1
129129
else
130130
parseArgsRec xss {optionsSoFar with repetitions = reps; changed = true}
131131
else
132132
eprintfn "Option -r was followed by an invalid value."
133-
parseArgsRec xs optionsSoFar
133+
exit 1
134134
| _ ->
135135
eprintfn "Option -r needs to be followed by a number."
136-
parseArgsRec xs optionsSoFar
136+
exit 1
137137
| "/vsize"::xs | "-vsize"::xs ->
138138
match xs with
139139
| s::xss ->
140140
let couldparse, size = System.Int32.TryParse s
141141
if couldparse then
142142
if size < minVectorSize then
143143
eprintfn "Given value for -vsize was too small, using the minimum: %i." minVectorSize
144-
parseArgsRec xss {optionsSoFar with vectorSize = minVectorSize; changed = true}
144+
exit 1
145145
else
146146
parseArgsRec xss {optionsSoFar with vectorSize = size; changed = true}
147147
else
148148
eprintfn "Option -vsize was followed by an invalid value."
149-
parseArgsRec xs optionsSoFar
149+
exit 1
150150
| _ ->
151151
eprintfn "Option -vsize needs to be followed by a number."
152-
parseArgsRec xs optionsSoFar
152+
exit 1
153153
| x::xs ->
154154
eprintfn "Option \"%s\" is unrecognized." x
155155
parseArgsRec xs optionsSoFar
@@ -194,16 +194,16 @@ let main argv =
194194

195195
let benchmarks =
196196
match ops.benchmarks with
197-
| [] -> ["bench1"; "bench2"]
197+
| [] -> ["1"; "2"]
198198
| xss -> xss
199199

200200
let modes =
201201
match ops.modes with
202202
| [] -> [ "auto"; "numeric"]
203203
| xss -> xss
204204

205-
let bench1 = List.contains "bench1" benchmarks
206-
let bench2 = List.contains "bench2" benchmarks
205+
let bench1 = List.contains "1" benchmarks
206+
let bench2 = List.contains "2" benchmarks
207207
let auto = List.contains "auto" modes
208208
let numeric = List.contains "numeric" modes
209209

0 commit comments

Comments
 (0)
0