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/openaccel-lab/blob/main/workloads/attn_scores/kernel.cl # openaccel-lab aien-dev/openaccel-lab 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 `openaccel-lab / workloads / attn_scores / kernel.cl` 17 lines ยท 493 bytes Raw Blame History 1 // SPDX-License-Identifier: Apache-2.0 2 __kernel void attn_scores(__global const float *q, __global const float *k, __global float *s, 3 const int T, const int D) 4 { 5 int i = get_global_id(0); 6 int j = get_global_id(1); 7 if (i >= T || j >= T) 8 return; 9 if (j > i) { 10 s[i * T + j] = -1e30f; 11 return; 12 } 13 float acc = 0.0f; 14 for (int c = 0; c < D; c++) 15 acc += q[i * D + c] * k[j * D + c]; 16 s[i * T + j] = acc * 0.125f; 17 }