Browse Source

largeMV works

master
Daniel Gyulai 3 years ago
parent
commit
1510f6fd11
  1. 4
      kernels/linear.cl

4
kernels/linear.cl

@ -84,7 +84,7 @@ void largeMV(const int n, const int m, __global float* y, __global float* A, __g
if (z == 0) { if (z == 0) {
y[i + t] = 0; y[i + t] = 0;
} }
Q[id] = 0; //Q[id] = 0;
for (size_t j = 0; j < n; j += T) { // oszlop kezdete ahol a modul van for (size_t j = 0; j < n; j += T) { // oszlop kezdete ahol a modul van
//Q[t * Z + z] += A[(j + z) + (i + t) * m] * x[i + t]; //Q[t * Z + z] += A[(j + z) + (i + t) * m] * x[i + t];
@ -92,7 +92,7 @@ void largeMV(const int n, const int m, __global float* y, __global float* A, __g
barrier(CLK_LOCAL_MEM_FENCE); barrier(CLK_LOCAL_MEM_FENCE);
for (size_t s = Z / 2; s > 0; s >>= 1) { for (size_t s = Z / 2; s > 0; s >>= 1) {
if (t < s) { if (z < s) {
Q[t * Z + z] = Q[t * Z + z] + Q[t * Z + z + s]; Q[t * Z + z] = Q[t * Z + z] + Q[t * Z + z + s];
} }
barrier(CLK_LOCAL_MEM_FENCE); barrier(CLK_LOCAL_MEM_FENCE);

Loading…
Cancel
Save