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/runtime/artifact_fixture_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 / runtime / artifact_fixture_diff.c` 63 lines · 3159 bytes Raw Blame History 1 /* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ 2 #include "omega_native_artifact.h" 3 #include "omega_native_artifact_snapshot.h" 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 int artifact_c_export(const OmegaNativeArtifact *, const char *, char *, char *, size_t); 11 int artifact_c_admit(const char *, const char *, char *, char *, size_t); 12 int artifact_c_snapshot(const char *, const char *, char *, OmegaNativeArtifactSnapshot *, char *, size_t); 13 void artifact_c_snapshot_free(OmegaNativeArtifactSnapshot *); 14 static const char *const suffix[]={".manifest",".text.bin",".cubin",".qmd0.bin",".qmd1.bin",".cbank_args.bin",".json",".sha256"}; 15 static void fail(const char *what,int om,int c) { fprintf(stderr,"ARTIFACT differential FAIL %s om=%d c=%d\n",what,om,c); exit(90); } 16 static unsigned char *load(const char *p,size_t *n) { 17 FILE *f=fopen(p,"rb"); if(!f)return NULL; 18 if(fseek(f,0,SEEK_END))exit(91); 19 long z=ftell(f); 20 if(z<0 || fseek(f,0,SEEK_SET))exit(91); 21 unsigned char *b=malloc((size_t)z+1); if(!b)exit(91); 22 if(fread(b,1,(size_t)z,f)!=(size_t)z || fclose(f))exit(91); 23 *n=(size_t)z; 24 return b; 25 } 26 int artifact_diff_export(const OmegaNativeArtifact *a,const char *p,char *id,char *err,size_t cap) { 27 char alt[2048],x[2200],y[2200],cid[65],ce[256]; 28 const char *cp=p; 29 if(p && strlen(p)sizes[i]||memcmp(cs.bytes[i],out->bytes[i],cs.sizes[i]))fail("snapshot bytes",1,0); 62 artifact_c_snapshot_free(&cs);return om; 63 }