Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/CUDApp/blob/main/evidence/attention-views/2026-11-06/omega_attn_tables.h.gcov # 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 Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `CUDApp / evidence / attention-views / 2026-11-06 / omega_attn_tables.h.gcov` 267 lines · 13994 bytes Raw Blame History 1 -: 0:Source:src/omega_attn_tables.h 2 -: 0:Graph:~/work/cudastack/lanes/ApiViewsAttn/build/attn-views-qualified-final/cases-oracle.gcno 3 -: 0:Data:~/work/cudastack/lanes/ApiViewsAttn/build/attn-views-qualified-final/cases-oracle.gcda 4 -: 0:Runs:9 5 -: 1:/* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ 6 -: 2:#ifndef OMEGA_ATTN_TABLES_H 7 -: 3:#define OMEGA_ATTN_TABLES_H 8 -: 4:#include "omega_attn_views.h" 9 -: 5:#include "omega_api_plan.h" 10 -: 6:#include "omega_gpu_hostmath.h" 11 function av_ropegen called 16 returned 100% blocks executed 100% 12 16: 7:static inline void av_ropegen(float *d,uint64_t pos,double theta,uint64_t dim,uint64_t width,size_t rows) { 13 -: 8:#if CUDAPP_MIGRATION_PENDING_ATTN_VIEWS 14 4152: 9: for(size_t r=0;r`1000000`)count=`1000000`; 95 -: 61: if(omega_av_touch(&r,start?ids+start:ids,count,slots,nb,touched,nb,g)!=OMEGA_OK)__builtin_trap(); 96 -: 62: if(count==q[0]-start)break; 97 -: 63: start+=count; 98 -: 64: } 99 -: 65: av_fill32(tab+q[3],1,(uint32_t)q[4]); 100 -: 66: return result; 101 -: 67:#endif 102 -: 68:} 103 function av_blocks called 16 returned 100% blocks executed 100% 104 16: 69:static inline int av_blocks(const uint32_t *ids,size_t n,const uint64_t q[16]) { 105 -: 70:#if CUDAPP_MIGRATION_PENDING_ATTN_VIEWS 106 64: 71: for(size_t i=0;iUINT32_MAX || (uint64_t)ids[i]*stride+layer>UINT32_MAX)return 0;return 1; 120 branch 0 taken 40 (fallthrough) 121 branch 1 taken 8 122 branch 2 taken 8 (fallthrough) 123 branch 3 taken 32 124 branch 4 taken 48 125 branch 5 taken 8 (fallthrough) 126 -: 79:#else 127 -: 80: uint64_t q[16]={stride,layer},r=0;if(omega_av_rfit(&r,ids,n,q,16,n)!=OMEGA_OK)__builtin_trap();return (int)r; 128 -: 81:#endif 129 -: 82:} 130 function av_gather called 8 returned 100% blocks executed 100% 131 8: 83:static inline void av_gather(const void *s,size_t sn,void *d,size_t dn,const uint64_t q[16]) { 132 -: 84:#if CUDAPP_MIGRATION_PENDING_ATTN_VIEWS 133 -: 85: (void)sn;(void)dn; 134 104: 86: for(size_t t=0;t`1000000`)count=`1000000`; 155 -: 100: uint64_t wq[16]={count,q[1],q[2],q[3],q[4]+start},r=0; 156 -: 101: if(omega_av_stage(&r,s,sn,d,dn,start?ids+start:ids,count,wq,16)!=OMEGA_OK || r)__builtin_trap(); 157 -: 102: if(count==q[0]-start)break; 158 -: 103: start+=count; 159 -: 104: } 160 -: 105:#endif 161 24: 106:} 162 function av_reset called 8 returned 100% blocks executed 100% 163 8: 107:static inline void av_reset(int32_t *slots,size_t nb,const uint32_t *ids,size_t n) { 164 -: 108:#if CUDAPP_MIGRATION_PENDING_ATTN_VIEWS 165 32: 109: (void)nb;for(size_t i=0;ir)r=(uint32_t)p[8];}return r; 199 call 0 returned `8000088` 200 branch 1 taken 8 (fallthrough) 201 branch 2 taken `8000080` 202 branch 3 taken `8000088` 203 branch 4 taken 16 (fallthrough) 204 -: 132:#else 205 -: 133: uint64_t r=0;if(omega_av_best(&r,e,n,n,hd)!=OMEGA_OK)__builtin_trap();return (uint32_t)r; 206 -: 134:#endif 207 -: 135:} 208 function av_max called 16 returned 100% blocks executed 100% 209 16: 136:static inline uint32_t av_max(const uint32_t *s,size_t n) { 210 -: 137:#if CUDAPP_MIGRATION_PENDING_ATTN_VIEWS 211 `8000104`: 138: uint32_t r=1;for(size_t i=0;ir)r=s[i];return r; 212 branch 0 taken 32 (fallthrough) 213 branch 1 taken `8000056` 214 branch 2 taken `8000088` 215 branch 3 taken 16 (fallthrough) 216 -: 139:#else 217 -: 140: uint64_t r=0;if(omega_av_max(&r,s,n,n)!=OMEGA_OK)__builtin_trap();return (uint32_t)r; 218 -: 141:#endif 219 -: 142:} 220 -: 143:#if CUDAPP_MIGRATION_PENDING_ATTN_VIEWS 221 function av_exp2_oracle called 48 returned 100% blocks executed 92% 222 48: 144:static inline float av_exp2_oracle(float x) { 223 48*: 145: if(x<=-127.0f)return 0.0f;if(x>127.0f)x=127.0f; 224 branch 0 taken 8 (fallthrough) 225 branch 1 taken 40 226 branch 2 taken 0 (fallthrough) 227 branch 3 taken 40 228 40: 146: int n=(int)(x+(x<0?-0.5f:0.5f));float f=x-(float)n,px=1.`535336188319500e`-4f; 229 branch 0 taken 16 (fallthrough) 230 branch 1 taken 24 231 40: 147: px=px*f+1.`339887440266574e`-3f;px=px*f+9.`618437357674640e`-3f;px=px*f+5.`550332471162809e`-2f; 232 40: 148: px=px*f+2.`402264791363012e`-1f;px=px*f+6.`931472028550421e`-1f;px=1.0f+f*px; 233 40: 149: if(n < -126){px*=0.5f;n=-126;}uint32_t b=(uint32_t)(n+127)<<23;float s;memcpy(&s,&b,4);return px*s; 234 branch 0 taken 8 (fallthrough) 235 branch 1 taken 32 236 -: 150:} 237 -: 151:#endif 238 function av_fold called 8 returned 100% blocks executed 100% 239 8: 152:static inline void av_fold(const float *p,float *out,size_t rows,uint32_t S,uint32_t HD) { 240 -: 153:#if CUDAPP_MIGRATION_PENDING_ATTN_VIEWS 241 8: 154: size_t pw=HD+2; 242 40: 155: for(size_t r=0;rmx)mx=p[base+s*pw+HD]; 246 branch 0 taken 24 (fallthrough) 247 branch 1 taken 40 248 branch 2 taken 64 249 branch 3 taken 32 (fallthrough) 250 32: 157: if(!(mx>-__builtin_inff())){memset(out+r*HD,0,HD*4);continue;} 251 branch 0 taken 8 (fallthrough) 252 branch 1 taken 24 253 72: 158: float w[16],lsum=0;for(uint32_t s=0;s