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 / platform-linux / plat_map_fixture.om

38 lines · 552 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Anonymous mapwrite plus cpufence. Never opens /dev/nvidia. Exit 0 on the expected prefix bytes.
3global b uchar 8
4global out uchar 8
5fn main to int
6h = mapnew neg int 1 0 4096 3 34
7if lt h 0
8ret 2
9end
10put b 0 1
11put b 1 0
12put b 2 0
13put b 3 0
14put b 4 2
15put b 5 0
16put b 6 0
17put b 7 0
18n = mapwrite h 0 b 0 8
19if ne n 8
20ret 3
21end
22cpufence
23got = mapread h 0 out 0 8
24if ne got 8
25ret 3
26end
27if ne get out 0 1
28ret 4
29end
30if ne get out 4 2
31ret 4
32end
33drop = mapdrop h
34if ne drop 0
35ret 5
36end
37ret 0
38end