From 14407ce43a3c97a18280aeed0d43a24bf1fb695c Mon Sep 17 00:00:00 2001 From: miha-q <> Date: Sat, 2 Mar 2024 22:25:44 -0500 Subject: [PATCH] Sat Mar 2 10:25:44 PM EST 2024 --- src/gpu_mmul.cl | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/gpu_mmul.cl b/src/gpu_mmul.cl index 5f649a2..00b6022 100644 --- a/src/gpu_mmul.cl +++ b/src/gpu_mmul.cl @@ -1,11 +1,21 @@ -__kernel void gpu_mmul(__global float* ptrR, __global float* ptrA, __global float* ptrB, const int N, const int W) +__kernel void gpu_mmul +( + __global float* ptrR, + __global float* ptrA, + __global float* ptrB, + const int rowsA, + const int colsB, + const int shared +) { + const int colsA = shared; + const int rowsB = shared; int row = get_global_id(0); int col = get_global_id(1); float sum = 0; for (int i = 0; i < N; i++) { - sum += ptrA[row * W + i] * ptrB[i * W + col]; + sum += ptrA[row * colsA + i] * ptrB[i * colsB + col]; } - ptrR[row * W + col] = sum; + ptrR[row * W + col] = sum } \ No newline at end of file -- 2.39.5