Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/CUDApp/blob/main/tests/components/direct-oracle.c # 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 Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `CUDApp / tests / components / direct-oracle.c` 41 lines · 2140 bytes Raw Blame History 1 /* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ 2 /* Verification only: existing C algorithm and independently retained C encoder. */ 3 #include "omega_blackwell_codegen_moe.h" 4 #include 5 #include 6 #include 7 static void word(uint64_t v) { for (unsigned j=0;j<8;j++) putchar((int)((v>>(j*8))&255)); } 8 static uint64_t reg(int v) { return v < 0 ? UINT64_MAX : (uint64_t)v; } 9 int main(int argc,char **argv) { 10 if(argc!=6) return 65; 11 OmegaFp8GemvSpec s={0}; 12 s.k=(uint32_t)strtoul(argv[1],NULL,10);s.lane_bytes=(uint32_t)strtoul(argv[2],NULL,10); 13 s.rows=(uint32_t)strtoul(argv[3],NULL,10);s.warps=(uint32_t)strtoul(argv[4],NULL,10); 14 s.wfirst=(uint32_t)strtoul(argv[5],NULL,10); 15 BlackwellIRProgram p; 16 omega_bw_ir_init(&p); 17 if(omega_blackwell_codegen_fp8_gemv_prog(&s,&p)!=0) return 66; 18 uint8_t code[16384]; size_t nbytes=0; 19 if(omega_bw_encode_program(&p,code,sizeof code,&nbytes)!=0) return 67; 20 word(p.count);word(p.regalloc.num_vregs);word(p.regalloc.num_uvregs);word(0); 21 word(p.regalloc.peak_gpr_usage);word(p.regalloc.peak_ugpr_usage); 22 for(int v=0;vbundle_size?q->bundle_size:(q->is_pair?2:(q->is_quad?4:1))); 25 word(reg(p.regalloc.vreg_to_phys[v])); 26 } 27 for(int v=0;vop);word(reg(i->dst_vreg));word(reg(i->src1_vreg));word(reg(i->src2_vreg)); 33 word(reg(i->src3_vreg));word(reg(i->ureg)); 34 word((uint64_t)i->imm|((uint64_t)i->control<<32)); 35 word((uint64_t)i->is_uniform|((uint64_t)i->predicate_p0<<1)|((uint64_t)i->predicate_not<<2)| 36 ((uint64_t)i->bar_reg<<8)|((uint64_t)i->dst_subreg<<16)|((uint64_t)i->src1_subreg<<24)| 37 ((uint64_t)i->src2_subreg<<32)|((uint64_t)i->src3_subreg<<40)); 38 } 39 if(fwrite(code,1,nbytes,stdout)!=nbytes) return 74; 40 return 0; 41 }