CUDApp
CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.
Brought by drakestapleton
CUDApp / om / components / cm_stats.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note 0 trial phase: 0 continue, 1 failed observation accepted, 2 zero latency refused. |
| 3 | note 1 fit phase: stats[0:48], phi[48:56], residual flag[57], quiet mean[58], latency[59]. |
| 4 | fn cm_stats mode ulong out edit ulong 64 to ulong |
| 5 | if eq mode 0 |
| 6 | put out 46 add get out 46 1 |
| 7 | if ne get out 56 0 |
| 8 | put out 47 add get out 47 1 |
| 9 | ret 1 |
| 10 | end |
| 11 | if eq get out 59 0 |
| 12 | ret 2 |
| 13 | end |
| 14 | ret 0 |
| 15 | end |
| 16 | y = cm_log f64 get out 59 true |
| 17 | if ne get out 57 0 |
| 18 | y = sub y bitcast f64 get out 58 |
| 19 | end |
| 20 | k = ulong 0 |
| 21 | for i ulong 8 |
| 22 | x = bitcast f64 get out add 48 i |
| 23 | for j ulong 8 |
| 24 | if ge j i |
| 25 | z = bitcast f64 get out add 48 j |
| 26 | v = bitcast f64 get out k |
| 27 | put out k bitcast ulong add v mul x z |
| 28 | k = add k 1 |
| 29 | end |
| 30 | end |
| 31 | v = bitcast f64 get out add 36 i |
| 32 | put out add 36 i bitcast ulong add v mul x y |
| 33 | end |
| 34 | v = bitcast f64 get out 44 |
| 35 | put out 44 bitcast ulong add v mul y y |
| 36 | put out 45 add get out 45 1 |
| 37 | ret 0 |
| 38 | end |