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 / moe / ragged_pin_driver.om

58 lines · 1181 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Native driver for the ragged-K builder (cg_moe): builds specs through the unit's own entry cg_moe and compares the emitted
3note instruction count with the count of the C-linked build (omega_fp8_gemv_ragged_prog_stats), so the pinned omc and the units.sh
4note omc can be compared on the same source. Concatenate cg_moe_emit.om, cg_moe_core.om, cg_moe.om and this file. Exit 0 = all equal.
5fn rp_check s view ulong 16 want ulong to ulong
6b = new ulong 8192 0
7m = new ulong 512 0
8rc = cg_moe s edit b edit m
9if ne rc 0
10ret 1
11end
12if ne get m 0 want
13ret 2
14end
15ret 0
16end
17fn rp_refused s view ulong 16 to ulong
18b = new ulong 8192 0
19m = new ulong 512 0
20ret cg_moe s edit b edit m
21end
22fn main to int
23a = new ulong 16 0
24put a 0 640
25put a 1 8
26put a 2 1
27put a 3 8
28put a 10 1
29if ne rp_check view a 119 0
30ret 11
31end
32c = new ulong 16 0
33put c 0 640
34put c 1 16
35put c 2 2
36put c 3 4
37put c 5 1
38put c 6 1
39put c 10 1
40if ne rp_check view c 287 0
41ret 12
42end
43d = new ulong 16 0
44put d 0 2560
45put d 1 16
46put d 2 1
47put d 3 8
48put d 5 1
49put d 10 1
50if ne rp_check view d 153 0
51ret 13
52end
53put a 10 0
54if eq rp_refused view a 0
55ret 14
56end
57ret 0
58end