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_effects.om

36 lines · 794 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Platform publication barrier and ring-byte store. No device is opened.
3note cpufence is AArch64 DSB SY / x86-64 MFENCE (omega-mv retire compiler, MAPPING.md).
4note Bound 1048576 is 2^20 (WolframLanguageEvaluator: 2^20 -> 1048576).
5om2
6export fn plat_fence to long
7cpufence
8ret long 1
9end
10export fn plat_ring_store dst edit uchar * bytes view uchar * n ulong to long
11if eq n 0
12ret long 0
13end
14if lt 1048576 n
15ret long 0
16end
17for i ulong n
18put dst i get bytes i
19end
20cpufence
21ret long n
22end
23export fn plat_map_store handle long off ulong bytes view uchar * n ulong to long
24if eq n 0
25ret neg long 22
26end
27if lt 1048576 n
28ret neg long 22
29end
30wrote = mapwrite handle off bytes 0 n
31if ne wrote long n
32ret wrote
33end
34cpufence
35ret wrote
36end