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 / om / apirest / bf16.om

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