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 / om / apirest / bf16.om
| 1 | note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | note Composes ApiViewsElem av_rne unchanged; runtime length may exceed the fixed-view limit. |
| 3 | fn ar_bf16 x view f32 * y edit ushort * to ulong |
| 4 | if ne len x len y |
| 5 | ret 1 |
| 6 | end |
| 7 | base = ulong 0 |
| 8 | for chunks ulong 281474976710656 |
| 9 | if ge base len x |
| 10 | break |
| 11 | end |
| 12 | for j ulong 65536 |
| 13 | i = add base j |
| 14 | if ge i len x |
| 15 | break |
| 16 | end |
| 17 | put y i ushort and av_rne bitcast uint get x i 65535 |
| 18 | end |
| 19 | base = add base 65536 |
| 20 | end |
| 21 | ret 0 |
| 22 | end |