]> foleosoft.com Git - QAnsel.git/commitdiff
Sat Mar 2 10:25:44 PM EST 2024
authormiha-q <>
Sun, 3 Mar 2024 03:25:44 +0000 (22:25 -0500)
committermiha-q <>
Sun, 3 Mar 2024 03:25:44 +0000 (22:25 -0500)
src/gpu_mmul.cl

index 5f649a241302222ce686b1dacf1a41fd75ed0427..00b6022313907cf1b1e8a8aaf4d9a779bc43984f 100644 (file)
@@ -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