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_blackwell_encoder.h

28 lines · 1103 bytes Raw Blame History
1/* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */
2#ifndef OMEGA_BLACKWELL_ENCODER_H
3#define OMEGA_BLACKWELL_ENCODER_H
4
5#include <stdbool.h>
6#include <stddef.h>
7#include <stdint.h>
8
9#define OMEGA_BW_INSTRUCTION_BYTES 16
10#define OMEGA_BW_VECADD_INSN_COUNT 32
11#define OMEGA_BW_VECADD_CODE_SIZE (OMEGA_BW_VECADD_INSN_COUNT * OMEGA_BW_INSTRUCTION_BYTES) /* 512 bytes */
12#define OMEGA_BW_VECADD_EXPECTED_SHA256 "39f3dfdfc529a75a8274a27900acf4e7382b7f280a211e0412c51609f44b62a1"
13
14typedef struct {
15 uint32_t w[4];
16 const char *mnemonic;
17} BlackwellInstruction;
18
19/* Minimal sovereign encoder: emits 512-byte Blackwell sm_121 vector add machine code */
20int omega_blackwell_encode_vecadd(uint8_t *code_buf, size_t max_len, size_t *out_len);
21
22/* Computes SHA-256 digest of emitted machine code */
23int omega_blackwell_compute_code_digest(const uint8_t *code_buf, size_t len, uint8_t *out_digest);
24
25/* Verifies encoder instruction fixtures against reference bit-for-bit disassembled words */
26int omega_blackwell_verify_encoder_fixtures(void);
27
28#endif /* OMEGA_BLACKWELL_ENCODER_H */