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 / test_prefill_host_rest.c
| 1 | /* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ |
| 2 | #include "cudapp_native.h" |
| 3 | #include <stdint.h> |
| 4 | #include <stdio.h> |
| 5 | #include <string.h> |
| 6 | int main(void) { |
| 7 | const uint32_t a[]={0,1,2,7,8,9,31,32,33,63,64,65,255,256,257,65535,65536,65537,UINT32_MAX}; |
| 8 | for(unsigned i=0;i<sizeof a/sizeof *a;i++) for(unsigned j=0;j<sizeof a/sizeof *a;j++) { |
| 9 | uint64_t r=99; uint64_t want=(uint64_t)32*a[i]*a[j]>65536; |
| 10 | if(omega_arpfreg(&r,a[i],a[j])||r!=want) return 1; |
| 11 | } |
| 12 | float x[4096]; |
| 13 | const uint32_t cls[]={0,0x80000000,1,0x80000001,0x7f800000,0xff800000,0x7fc00000,0x7f800001,0xc479c000,0xc479bfff,0xc479c001}; |
| 14 | for(unsigned i=0;i<4096;i++) memcpy(x+i,cls+i%(sizeof cls/sizeof *cls),4); |
| 15 | for(unsigned n=0;n<=4096;n++) { |
| 16 | uint64_t want=0,r=99; for(unsigned i=0;i<n;i++) if(x[i]==-999.0f) want++; |
| 17 | if(omega_pfcount(&r,x,n)||r!=want) return 2; |
| 18 | } |
| 19 | puts("PASS prefill host register policy and float-class poison differential"); return 0; |
| 20 | } |