interplane.Get Omega
Read in your language

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

branch main Branches Tags History

CUDApp / evidence / 2026-11-06-costmodel-rest / rx_cm_math.h.gcov

62 lines · 3220 bytes Raw Blame History
1 -: 0:Source:src/runtime/rx_cm_math.h
2 -: 0:Graph:/tmp/cm-full-cov-v5qvhlky/oracle.gcno
3 -: 0:Data:/tmp/cm-full-cov-v5qvhlky/oracle.gcda
4 -: 0:Runs:2
5 -: 1:/* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */
6 -: 2:#ifndef RX_CM_MATH_H
7 -: 3:#define RX_CM_MATH_H
8 -: 4:#include "cudapp_native.h"
9 -: 5:#include <math.h>
10 -: 6:#include <stdint.h>
11 -: 7:#include <string.h>
12 -: 8:#ifndef CUDAPP_MIGRATION_PENDING_C_CM_MATH
13 -: 9:#define CUDAPP_MIGRATION_PENDING_C_CM_MATH 0
14 -: 10:#endif
15 -: 11:#if !CUDAPP_MIGRATION_PENDING_C_CM_MATH
16 -: 12:/* Binary64 transport only. Numerical computation and exceptional-value policy
17 -: 13: * are in the first-party Omega unit, not a host libm call. */
18function rx_host_math called 807499 returned 100% blocks executed 83%
19 807499: 14:static inline double rx_host_math(unsigned mode, double x) {
20 -: 15: uint64_t input, output;
21 807499: 16: memcpy(&input, &x, sizeof input);
22 807499*: 17: if (omega_cm_math(&output, mode, input) != OMEGA_OK) return NAN;
23call 0 returned 807499
24branch 1 taken 0 (fallthrough)
25branch 2 taken 807499
26 807499: 18: memcpy(&x, &output, sizeof x);
27 807499: 19: return x;
28 -: 20:}
29function rx_host_log called 0 returned 0% blocks executed 0%
30 #####: 21:static inline double rx_host_log(double x) { return rx_host_math(0, x); }
31call 0 never executed
32function rx_host_log2 called 332606 returned 100% blocks executed 100%
33 332606: 22:static inline double rx_host_log2(double x) { return rx_host_math(1, x); }
34call 0 returned 332606
35function rx_host_ceil called 1 returned 100% blocks executed 100%
36 1: 23:static inline double rx_host_ceil(double x) { return rx_host_math(2, x); }
37call 0 returned 1
38function rx_host_exp called 14025 returned 100% blocks executed 100%
39 14025: 24:static inline double rx_host_exp(double x) { return rx_host_math(3, x); }
40call 0 returned 14025
41function rx_host_exp2 called 20931 returned 100% blocks executed 100%
42 20931: 25:static inline double rx_host_exp2(double x) { return rx_host_math(4, x); }
43call 0 returned 20931
44function rx_host_sqrt called 411586 returned 100% blocks executed 100%
45 411586: 26:static inline double rx_host_sqrt(double x) { return rx_host_math(5, x); }
46call 0 returned 411586
47function rx_host_erfc called 28050 returned 100% blocks executed 100%
48 28050: 27:static inline double rx_host_erfc(double x) { return rx_host_math(6, x); }
49call 0 returned 28050
50function rx_host_fabs called 300 returned 100% blocks executed 100%
51 300: 28:static inline double rx_host_fabs(double x) { return rx_host_math(7, x); }
52call 0 returned 300
53 -: 29:#define log rx_host_log
54 -: 30:#define log2 rx_host_log2
55 -: 31:#define ceil rx_host_ceil
56 -: 32:#define exp rx_host_exp
57 -: 33:#define exp2 rx_host_exp2
58 -: 34:#define sqrt rx_host_sqrt
59 -: 35:#define erfc rx_host_erfc
60 -: 36:#define fabs rx_host_fabs
61 -: 37:#endif
62 -: 38:#endif