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/nvrm_counts_test.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 / nvrm_counts_test.c` 45 lines · 2310 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 #include 8 static unsigned long long buddy(const char *line,unsigned order,unsigned long long total) { 9 const char *p=strstr(line,"zone"); if(!p)return total; 10 p+=4; while(*p==' ')p++; while(*p&&*p!=' ')p++; 11 unsigned long long n; 12 for(unsigned o=0;o<32&&sscanf(p," %llu",&n)==1;o++) { 13 if(o>=order)total+=n; 14 while(*p==' ')p++; 15 while(*p&&*p!=' ')p++; 16 } 17 return total; 18 } 19 int main(void) { 20 const char *values[]={"", " ","0","1","-1","+1","`18446744073709551615`","`18446744073709551616`","-`18446744073709551616`","12junk","junk","\t12","+","-0","`00000000000000000000000000000000000000000001`"}; 21 for(size_t i=0;i7&&!strncmp(mismatch[i],"MemFree:",8); 42 assert(matched==(uint64_t)m); assert(state[1]==(m?0:9)); 43 } 44 puts("NVRM COUNTS DIFFERENTIAL PASS (decimal classes, token boundaries, orders 0..33; HOST_ONLY)"); 45 }