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
| 1 | /* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ |
| 2 | /* out_sha.h -- print "<label> output sha256 <hex>" for a chip output buffer (D7, same inputs, same bits). |
| 3 | * tools/d7_same_bits_check.sh compares these lines across separate runs of the same binary. */ |
| 4 | #ifndef CUDAPP_TESTS_OUT_SHA_H |
| 5 | #define CUDAPP_TESTS_OUT_SHA_H |
| 6 | #include "sha256.h" |
| 7 | #include <stdio.h> |
| 8 | |
| 9 | static inline void out_sha_print(const char *label, const sha256_ctx *done) { |
| 10 | sha256_ctx c = *done; uint8_t d[SHA256_DIGEST_SIZE]; |
| 11 | sha256_final(&c, d); |
| 12 | printf("%s output sha256 ", label); |
| 13 | for (int i = 0; i < SHA256_DIGEST_SIZE; i++) printf("%02x", d[i]); |
| 14 | printf("\n"); |
| 15 | } |
| 16 | static inline void out_sha_buf(const char *label, const void *data, size_t len) { |
| 17 | sha256_ctx c; sha256_init(&c); sha256_update(&c, (const uint8_t *)data, len); out_sha_print(label, &c); |
| 18 | } |
| 19 | #endif |