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/regalloc_om/packers_units.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 / regalloc_om / packers_units.c` 43 lines · 2474 bytes Raw Blame History 1 /* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ 2 #include "cudapp_native.h" 3 #include 4 #include 5 #include 6 #include 7 #define CHECK(x) do { if (!(x)) { fprintf(stderr,"FAIL provider line %d\n",__LINE__); return 1; } } while (0) 8 int main(void) { 9 uint64_t r, p[12] = {0,1,1,16,16}; 10 CHECK(omega_cg_pklen(&r,p,12)==0 && r==0 && p[8]==2 && p[9]==256); 11 uint16_t s=0x1234,d[256],before[256]; 12 memset(d,0x5a,sizeof d); memcpy(before,d,sizeof d); 13 CHECK(omega_cg_pkh(&r,p,12,&s,1,d,256)==0 && (int64_t)r==-1 && !memcmp(d,before,sizeof d)); 14 CHECK(omega_cg_pkh(&r,p,12,&s,2,d,255)==0 && (int64_t)r==-1 && !memcmp(d,before,sizeof d)); 15 p[0]=9; CHECK(omega_cg_pklen(&r,p,12)==0 && (int64_t)r==-1); 16 p[0]=0;p[1]=17; CHECK(omega_cg_pklen(&r,p,12)==0 && (int64_t)r==-1); 17 p[1]=1;p[3]=17; CHECK(omega_cg_pklen(&r,p,12)==0 && (int64_t)r==-1); 18 p[3]=16;p[2]=17; CHECK(omega_cg_pklen(&r,p,12)==0 && (int64_t)r==-1); 19 p[2]=1;p[4]=17; CHECK(omega_cg_pklen(&r,p,12)==0 && (int64_t)r==-1); 20 p[0]=2;p[4]=16;p[6]=2;p[7]=1; CHECK(omega_cg_pklen(&r,p,12)==0 && (int64_t)r==-1); 21 const uint32_t dims[]={0,1,2,7,8,15,16,17,31}; 22 for(unsigned mi=0;mi