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 / attn_views_bench_main.c
| 1 | /* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ |
| 2 | #include <stdint.h> |
| 3 | #include <stddef.h> |
| 4 | #include <stdio.h> |
| 5 | uint64_t attn_bench_omega(unsigned,size_t,unsigned); |
| 6 | uint64_t attn_bench_oracle(unsigned,size_t,unsigned); |
| 7 | int main(void){ |
| 8 | const char *names[]={"launch-9-addresses","copy-65537-bytes","expand-65537-bf16","descriptor-8-rows","rope-4x128","fold-4x2x8"}; |
| 9 | const unsigned rounds[]={1000,32,32,1000,4,256}; |
| 10 | puts("case\tsample\trounds\tomega_ns\tc_ns"); |
| 11 | for(unsigned op=0;op<6;op++)for(unsigned sample=0;sample<5;sample++){ |
| 12 | uint64_t o,c; |
| 13 | if(sample&1){c=attn_bench_oracle(op,65537,rounds[op]);o=attn_bench_omega(op,65537,rounds[op]);} |
| 14 | else{o=attn_bench_omega(op,65537,rounds[op]);c=attn_bench_oracle(op,65537,rounds[op]);} |
| 15 | printf("%s\t%u\t%u\t%llu\t%llu\n",names[op],sample,rounds[op],(unsigned long long)o,(unsigned long long)c); |
| 16 | } |
| 17 | return 0; |
| 18 | } |