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/controls/gemm_offbyone/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 / controls / gemm_offbyone / kernel.cl` 17 lines ยท 620 bytes Raw Blame History 1 // SPDX-License-Identifier: Apache-2.0 2 // One work-group of 256 per 16x16 tile; A and B are staged in local memory, C[i][j] = sum_k A[i][k] B[k][j]. 3 __kernel void tmatmul16(__global const float *a, __global const float *b, __global float *c, const int tiles) 4 { 5 __local float la[256]; 6 __local float lb[256]; 7 int t = get_group_id(0); 8 int l = get_local_id(0); 9 int i = l / 16, j = l % 16; 10 la[l] = a[t * 256 + l]; 11 lb[l] = b[t * 256 + l]; 12 barrier(CLK_LOCAL_MEM_FENCE); 13 float s = 0.0f; 14 for (int k = 0; k < 15; k++) 15 s += la[i * 16 + k] * lb[k * 16 + j]; 16 c[t * 256 + l] = s; 17 }