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 / tools / dagsim / dagsim_format.h

23 lines · 775 bytes Raw Blame History
1/* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2 * Fixed-view ABI marshalling only; decisions and arithmetic live in dag_fmt.om. */
3#ifndef DAGSIM_FORMAT_H
4#define DAGSIM_FORMAT_H
5#include "cudapp_native.h"
6#include <stdint.h>
7#include <stdlib.h>
8#include <string.h>
9static inline uint64_t ds_fmt(unsigned mode, uint64_t a[16], char s[256]) {
10 uint64_t result = 0;
11 if (omega_dag_fmt(&result, mode, a, 16, s, 256)) abort();
12 return result;
13}
14static inline uint64_t ds_bits(double d) {
15 uint64_t u; memcpy(&u, &d, sizeof u); return u;
16}
17static inline double ds_unbits(uint64_t u) {
18 double d; memcpy(&d, &u, sizeof d); return d;
19}
20static inline uint64_t ds_decide(unsigned mode, uint64_t a[16]) {
21 char s[256]; return ds_fmt(mode, a, s);
22}
23#endif