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 / speculation / oracle-test.om

68 lines · 1334 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2note Independent finite oracle: a two-outcome drafter accepts everything with p,
3note or rejects the first token with 1-p, so E = 1 + k*p without a survival loop.
4global lens ulong 7
5global oparams ulong 4
6fn oracle to ulong
7best = ulong 0
8be = ulong 1000000
9bt = ulong 101
10for r ulong 7
11k = get lens r
12if le add k 1 get oparams 2
13if le add 100 mul r 10 get oparams 3
14expect = add 1000000 mul k get oparams 0
15cost = add 101 mul get oparams 1 mul k k
16if gt mul expect bt mul be cost
17best = k
18be = expect
19bt = cost
20end
21end
22end
23end
24ret best
25end
26fn trialcase remain ulong to void
27put oparams 2 remain
28check eq sbegin 0 0
29put scontrol 0 0
30put scontrol 1 0
31check eq sselect 1000 remain get oparams 3 7 2 0 0
32check eq get decision 0 oracle
33check le get decision 1 remain
34check le get decision 2 32000000
35scancel
36end
37fn sweep to void
38fixture
39put lens 0 0
40put lens 1 1
41put lens 2 2
42put lens 3 4
43put lens 4 8
44put lens 5 16
45put lens 6 31
46for p ulong 5
47put oparams 0 mul p 250000
48for i ulong 31
49put sprior i get oparams 0
50end
51for curve ulong 8
52put oparams 1 curve
53for r ulong 7
54put srows add mul r 11 4 add 100 mul curve mul get lens r get lens r
55end
56for m ulong 2
57put oparams 3 add 130 mul m 30
58for i ulong 32
59trialcase add i 1
60end
61end
62end
63end
64end
65fn main to int
66sweep
67ret finish
68end