omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / evidence / OWN30B-T3-TC-PEAK-BW-5faa0f70-20261013T2236Z / fa_ops.cu
| 1 | #include <cuda_bf16.h> |
| 2 | extern "C" __global__ void k(const float *a, unsigned *o, float *f) { |
| 3 | unsigned i = threadIdx.x; |
| 4 | float x = a[i], y = a[i + 32]; |
| 5 | float m = fmaxf(x, __shfl_xor_sync(0xffffffffu, x, 1)); |
| 6 | m = fmaxf(m, __shfl_xor_sync(0xffffffffu, m, 2)); |
| 7 | float s = y + __shfl_xor_sync(0xffffffffu, y, 1); |
| 8 | s = s + __shfl_xor_sync(0xffffffffu, s, 2); |
| 9 | __nv_bfloat162 p = __floats2bfloat162_rn(m, s); |
| 10 | o[i] = *(unsigned *)&p; |
| 11 | __nv_bfloat162 q = __floats2bfloat162_rn(x * 3.0f, y * 5.0f); |
| 12 | o[i + 32] = *(unsigned *)&q; |
| 13 | f[i] = exp2f(m); |
| 14 | } |