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 / tests / models / quant-consumer.om

49 lines · 906 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Actual existing mxmm receives canonical packed output without weight expansion.
3fn qt_packcompact a edit uchar 4096 sa edit uchar 256 to uint
4d = new ulong 48 0
5src = new uchar 65536 0
6sc = new uchar 1024 0
7out = new uchar 65536 0
8os = new uchar 1024 0
9qt_base d 4 3
10put src 0 33
11put src 1 3
12put sc 0 127
13if ne quant_repack d src sc out os 0
14ret 1
15end
16for i ulong 16
17put a i get out i
18end
19put sa 0 get os 0
20ret 0
21end
22fn qt_consumer to uint
23a = new uchar 4096 0
24b = new uchar 4096 0
25sa = new uchar 256 0
26sb = new uchar 256 0
27c = new f64 256 0.0f64
28shape = new ulong 4 0
29put shape 0 1
30put shape 1 1
31put shape 2 1
32put shape 3 32
33put a 0 33
34put a 1 3
35put b 0 33
36put b 1 3
37put sa 0 127
38put sb 0 127
39mxmm a sa b sb c shape
40expected = get c 0
41if ne qt_packcompact b sb 0
42ret 1
43end
44mxmm a sa b sb c shape
45if ne get c 0 expected
46ret 2
47end
48ret 0
49end