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 / evidence / MAX-INTEROP / G2 / tools / control.cu
| 1 | // Known-good control: same name and parameter ABI as the Omega artifact |
| 2 | // omega_matmul_bf16(A bf16[M*K], B bf16[K*N], C f32[M*N]), M=16 K=16 N=8, 1 block x 32 threads. |
| 3 | #include <stdint.h> |
| 4 | __device__ static float bf(uint16_t h) { return __uint_as_float(((uint32_t)h) << 16); } |
| 5 | extern "C" __global__ void omega_matmul_bf16(const uint16_t *A, const uint16_t *B, float *C) { |
| 6 | const int M = 16, K = 16, N = 8; |
| 7 | for (int o = threadIdx.x; o < M * N; o += blockDim.x) { |
| 8 | int i = o / N, j = o % N; |
| 9 | float s = 0.0f; |
| 10 | for (int p = 0; p < K; p++) s += bf(A[i * K + p]) * bf(B[p * N + j]); |
| 11 | C[o] = s; |
| 12 | } |
| 13 | } |