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
CUDApp / tests / runtime / artifact_oracle.c
| 1 | /* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ |
| 2 | #ifndef _GNU_SOURCE |
| 3 | #define _GNU_SOURCE |
| 4 | #endif |
| 5 | /* Do not count oracle reads in the production read-once fixture observer. */ |
| 6 | #define fopen fopen64 |
| 7 | /* Immutable algorithm source is the PENDING branch in the production file. */ |
| 8 | #define CUDAPP_MIGRATION_PENDING_C_ARTIFACT 1 |
| 9 | #define omega_native_artifact_export artifact_c_export |
| 10 | #define omega_native_artifact_admit artifact_c_admit |
| 11 | #define omega_native_artifact_snapshot artifact_c_snapshot |
| 12 | #define omega_native_artifact_snapshot_free artifact_c_snapshot_free |
| 13 | #define omega_native_artifact_rc_name artifact_c_rc_name |
| 14 | #include "../../src/omega_native_artifact.c" |
| 15 | |
| 16 | /* Expose the legacy output codec only to the independent host differential. */ |
| 17 | size_t artifact_c_json_escape(const char *input, unsigned char *out, size_t cap) { |
| 18 | FILE *f = tmpfile(); |
| 19 | if (!f) abort(); |
| 20 | json_str(f, input); |
| 21 | if (fflush(f) || fseek(f, 0, SEEK_SET)) abort(); |
| 22 | size_t n = fread(out, 1, cap, f); |
| 23 | if (ferror(f) || fclose(f)) abort(); |
| 24 | return n; |
| 25 | } |