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 / numeric / no_bf16.om

14 lines · 461 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Integer-only freestanding binary32 to bf16 RNE; preserve quiet NaN payload.
3note WolframLanguageEvaluator: FromDigits[#,16]& /@ {"7f800000","007fffff","0040","7fff"}
4note -> {2139095040,8388607,64,32767}.
5fn no_bf16 raw ulong to ulong
6u = uint raw
7if eq and u 2139095040 2139095040
8if ne and u 8388607 0
9ret ulong or shr u 16 64
10end
11end
12u = add add u 32767 and shr u 16 1
13ret ulong shr u 16
14end