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/codegen_pfhost_admit_diff.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 / codegen_pfhost_admit_diff.c` 30 lines · 2042 bytes Raw Blame History 1 /* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ 2 #include "omega_blackwell_codegen_pfhost.h" 3 #include "cudapp_native.h" 4 #include 5 #include 6 #include 7 extern int omega_rl_spec_ok_c(const OmegaRlSpec *); 8 extern uint32_t omega_rl_shared_bytes_c(const OmegaRlSpec *); 9 extern int omega_mc_spec_ok_c(const OmegaMcSpec *); 10 static unsigned cases;static int red; 11 static int same(uint64_t a,uint64_t b){cases++;return (a^(red&&cases==1))==b;} 12 static int rl(OmegaRlSpec s){ 13 uint64_t r; 14 for(unsigned op=0;op<2;op++){ 15 uint64_t want=op?omega_rl_shared_bytes_c(&s):(uint32_t)omega_rl_spec_ok_c(&s); 16 uint64_t got=op?omega_rl_shared_bytes(&s):(uint32_t)omega_rl_spec_ok(&s); 17 if(omega_pf_admit(&r,op,s.k,s.e,s.t,(uint32_t)s.mutant)||!same(r,want)||got!=want)return 0; 18 } 19 return 1; 20 } 21 static int mc(OmegaMcSpec s){uint64_t r;return !omega_pf_admit(&r,2,s.h,s.top_k,0,(uint32_t)s.mutant)&&same(r,omega_mc_spec_ok_c(&s))&&r==(uint64_t)omega_mc_spec_ok(&s);} 22 int main(int argc,char **argv){(void)argv;red=argc>1; 23 if(omega_rl_spec_ok(NULL)||omega_rl_shared_bytes(NULL)||omega_mc_spec_ok(NULL))return 1; 24 for(uint32_t k=128;k<=16384;k+=128)for(uint32_t e=32;e<=1024;e+=32)for(uint32_t t=1;t<=16;t++)for(int m=-1;m<=3;m++){OmegaRlSpec s={k,e,t,m};if(!rl(s))goto fail;} 25 for(uint32_t h=128;h<=4096;h+=128)for(uint32_t top=4;top<=16;top+=4)for(int m=-1;m<=3;m++){OmegaMcSpec s={h,top,m};if(!mc(s))goto fail;} 26 const uint32_t edge[]={0,1,2,3,4,5,15,16,17,31,32,33,127,128,129,1023,1024,1025,4095,4096,4097,16383,16384,16385,UINT32_MAX}; 27 for(unsigned f=0;f<4;f++)for(unsigned j=0;j