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 / src / omega_bw_policy.h

21 lines · 878 bytes Raw Blame History
1/* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */
2#ifndef OMEGA_BW_POLICY_H
3#define OMEGA_BW_POLICY_H
4#include "cudapp_native.h"
5#include <stdint.h>
6/* The only branch here checks the generated ABI, not GPU policy. The scalar
7 * unit is total and import-free for these canonical unsigned arguments. */
8static inline uint64_t omega_bw_value(uint64_t op, uint64_t x, uint64_t y,
9 uint64_t z, uint64_t w, uint64_t v) {
10 uint64_t result;
11 if (omega_bw_scalar(&result, op, x, y, z, w, v) != OMEGA_OK) __builtin_trap();
12 return result;
13}
14#ifndef OMEGA_GPU_NO_POSIX
15static inline int omega_bw_id(const uint8_t data[256], uint64_t n, uint8_t out[32]) {
16 uint64_t result = 0;
17 uint32_t rc = omega_bw_identity(&result, data, 256, n, out, 32);
18 return (int)(int64_t)omega_bw_value(8, rc, result, 0, 0, 0);
19}
20#endif
21#endif