|
21 | 21 | outputs |
22 | 22 | discs |
23 | 23 | registers |
| 24 | + precisions |
24 | 25 | [profile-ptr #:mutable] |
25 | 26 | profile-instruction |
26 | 27 | profile-number |
|
46 | 47 | roots |
47 | 48 | discs |
48 | 49 | registers |
| 50 | + precisions |
49 | 51 | 0 |
50 | 52 | (make-vector (*rival-profile-executions*)) |
51 | 53 | (make-vector (*rival-profile-executions*)) |
|
76 | 78 | (raise (exn:rival:unsamplable "Unsamplable input" (current-continuation-marks) pt))] |
77 | 79 | [else (loop (* 2 prec))]))) |
78 | 80 |
|
| 81 | +(define (baseline-machine-adjust machine) |
| 82 | + (vector-fill! (baseline-machine-precisions machine) (bf-precision))) |
| 83 | + |
79 | 84 | (define (baseline-machine-full machine inputs) |
80 | | - ; no adjust here |
| 85 | + (baseline-machine-adjust machine) |
81 | 86 | (baseline-machine-load machine inputs) |
82 | 87 | (baseline-machine-run machine) |
83 | 88 | (baseline-machine-return machine)) |
|
89 | 94 | (define ivec (baseline-machine-instructions machine)) |
90 | 95 | (define varc (vector-length (baseline-machine-arguments machine))) |
91 | 96 | (define vregs (baseline-machine-registers machine)) |
92 | | - (define precision (bf-precision)) |
93 | | - |
94 | | - (parameterize ([bf-precision precision]) |
95 | | - (for ([instr (in-vector ivec)] [n (in-naturals varc)]) |
96 | | - (define start (current-inexact-milliseconds)) |
97 | | - (vector-set! vregs n (apply-instruction instr vregs)) |
98 | | - (define name (object-name (car instr))) |
99 | | - (define time (- (current-inexact-milliseconds) start)) |
100 | | - (baseline-machine-record machine name n precision time)))) |
| 97 | + (define precisions (baseline-machine-precisions machine)) |
| 98 | + |
| 99 | + (for ([instr (in-vector ivec)] |
| 100 | + [n (in-naturals varc)] |
| 101 | + [precision (in-vector precisions)]) |
| 102 | + (define start (current-inexact-milliseconds)) |
| 103 | + (parameterize ([bf-precision precision]) |
| 104 | + (vector-set! vregs n (apply-instruction instr vregs))) |
| 105 | + (define name (object-name (car instr))) |
| 106 | + (define time (- (current-inexact-milliseconds) start)) |
| 107 | + (baseline-machine-record machine name n precision time))) |
101 | 108 |
|
102 | 109 | (define (apply-instruction instr regs) |
103 | 110 | ;; By special-casing the 0-3 instruction case, |
|
123 | 130 | (define stuck? #f) |
124 | 131 | (define fvec |
125 | 132 | (for/vector #:length (vector-length rootvec) |
126 | | - ([root (in-vector rootvec)] [disc (in-list discs)] [n (in-naturals)]) |
| 133 | + ([root (in-vector rootvec)] |
| 134 | + [disc (in-list discs)] |
| 135 | + [n (in-naturals)]) |
127 | 136 | (define out (vector-ref vregs root)) |
128 | 137 | (define lo ((discretization-convert disc) (ival-lo out))) |
129 | 138 | (define hi ((discretization-convert disc) (ival-hi out))) |
|
0 commit comments