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 / nvrm / macro_boundary_test.c
| 1 | /* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ |
| 2 | /* HOST_ONLY link control: names alone must not select a C transport. No |
| 3 | * definitions of these forbidden functions are supplied to the linker. */ |
| 4 | #define ioctl cudapp_nvrm_forbidden_fixture_ioctl |
| 5 | #define mmap cudapp_nvrm_forbidden_fixture_mmap |
| 6 | #include "nvrm.c" |
| 7 | #undef ioctl |
| 8 | #undef mmap |
| 9 | #include <assert.h> |
| 10 | _Static_assert(NVRM_C_TRANSPORT == 0, "production macros selected the C transport"); |
| 11 | int main(void) { |
| 12 | int fd=nvrm_file_open("/dev/null"); |
| 13 | assert(fd>=0 && nvrm_file_close(fd)==0); |
| 14 | puts("NVRM PRODUCTION BOUNDARY PASS (ioctl/mmap macro names cannot select C; Omega symbols link and run; HOST_ONLY)"); |
| 15 | return 0; |
| 16 | } |