From: miha-q <> Date: Sun, 3 Mar 2024 03:25:44 +0000 (-0500) Subject: Sat Mar 2 10:25:44 PM EST 2024 X-Git-Url: http://www.foleosoft.com/?a=commitdiff_plain;h=14407ce43a3c97a18280aeed0d43a24bf1fb695c;p=QAnsel.git Sat Mar 2 10:25:44 PM EST 2024 --- 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