Skip to content

Commit

Permalink
Issue1388 (#1389)
Browse files Browse the repository at this point in the history
* Calculation of chunk range limits was ignoring num_cpu

bug introduced by me in #1262 - should fix #1388

* Calculation of range limits was ignoring num_cpu

bug introduced by me in #1262

* Calculation of chunk range limits was ignoring num_cpu

bug introduced by me in #1262

* Calculation of chunk range limits was ignoring num_cpu

bug introduced by me in #1262

* Calculation of chunk range limits was ignoring num_cpu

bug introduced by me in #1262

* Calculation of chunk range limits was ignoring num_cpu

bug introduced by me in #1262
  • Loading branch information
martin-frbg authored Dec 9, 2017
1 parent 281a2b9 commit 177b78c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions driver/level2/gbmv_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,10 @@ int CNAME(BLASLONG m, BLASLONG n, BLASLONG ku, BLASLONG kl, FLOAT *alpha, FLOAT

#ifndef TRANSA
range_m[num_cpu] = num_cpu * ((m + 15) & ~15);
if (range_m[num_cpu] > m) range_m[num_cpu] = m;
if (range_m[num_cpu] > m * num_cpu) range_m[num_cpu] = m * num_cpu;
#else
range_m[num_cpu] = num_cpu * ((n + 15) & ~15);
if (range_m[num_cpu] > n) range_m[num_cpu] = n;
if (range_m[num_cpu] > n * num_cpu) range_m[num_cpu] = n * num_cpu;
#endif

queue[num_cpu].mode = mode;
Expand Down
6 changes: 3 additions & 3 deletions driver/level2/sbmv_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ int CNAME(BLASLONG n, BLASLONG k, FLOAT *alpha, FLOAT *a, BLASLONG lda, FLOAT *x

range_m[MAX_CPU_NUMBER - num_cpu - 1] = range_m[MAX_CPU_NUMBER - num_cpu] - width;
range_n[num_cpu] = num_cpu * (((n + 15) & ~15) + 16);
if (range_n[num_cpu] > n) range_n[num_cpu] = n;
if (range_n[num_cpu] > n * num_cpu) range_n[num_cpu] = n * num_cpu;

queue[num_cpu].mode = mode;
queue[num_cpu].routine = sbmv_kernel;
Expand Down Expand Up @@ -286,7 +286,7 @@ int CNAME(BLASLONG n, BLASLONG k, FLOAT *alpha, FLOAT *a, BLASLONG lda, FLOAT *x

range_m[num_cpu + 1] = range_m[num_cpu] + width;
range_n[num_cpu] = num_cpu * (((n + 15) & ~15) + 16);
if (range_n[num_cpu] > n) range_n[num_cpu] = n;
if (range_n[num_cpu] > n * num_cpu) range_n[num_cpu] = n * num_cpu;

queue[num_cpu].mode = mode;
queue[num_cpu].routine = sbmv_kernel;
Expand Down Expand Up @@ -318,7 +318,7 @@ int CNAME(BLASLONG n, BLASLONG k, FLOAT *alpha, FLOAT *a, BLASLONG lda, FLOAT *x
range_m[num_cpu + 1] = range_m[num_cpu] + width;

range_n[num_cpu] = num_cpu * ((n + 15) & ~15);
if (range_n[num_cpu] > n) range_n[num_cpu] = n;
if (range_n[num_cpu] > n * num_cpu) range_n[num_cpu] = n * num_cpu;

queue[num_cpu].mode = mode;
queue[num_cpu].routine = sbmv_kernel;
Expand Down
4 changes: 2 additions & 2 deletions driver/level2/spmv_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ int CNAME(BLASLONG m, FLOAT *alpha, FLOAT *a, FLOAT *x, BLASLONG incx, FLOAT *y,

range_m[MAX_CPU_NUMBER - num_cpu - 1] = range_m[MAX_CPU_NUMBER - num_cpu] - width;
range_n[num_cpu] = num_cpu * (((m + 15) & ~15) + 16);
if (range_n[num_cpu] > m) range_n[num_cpu] = m;
if (range_n[num_cpu] > m * num_cpu) range_n[num_cpu] = m * num_cpu;

queue[num_cpu].mode = mode;
queue[num_cpu].routine = spmv_kernel;
Expand Down Expand Up @@ -286,7 +286,7 @@ int CNAME(BLASLONG m, FLOAT *alpha, FLOAT *a, FLOAT *x, BLASLONG incx, FLOAT *y,

range_m[num_cpu + 1] = range_m[num_cpu] + width;
range_n[num_cpu] = num_cpu * (((m + 15) & ~15) + 16);
if (range_n[num_cpu] > m) range_n[num_cpu] = m;
if (range_n[num_cpu] > m * num_cpu) range_n[num_cpu] = m * num_cpu;

queue[num_cpu].mode = mode;
queue[num_cpu].routine = spmv_kernel;
Expand Down
4 changes: 2 additions & 2 deletions driver/level2/symv_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ int CNAME(BLASLONG m, FLOAT *alpha, FLOAT *a, BLASLONG lda, FLOAT *x, BLASLONG i

range_m[num_cpu + 1] = range_m[num_cpu] + width;
range_n[num_cpu] = num_cpu * (((m + 15) & ~15) + 16);
if (range_n[num_cpu] > m) range_n[num_cpu] = m;
if (range_n[num_cpu] > m * num_cpu) range_n[num_cpu] = m * num_cpu;

queue[MAX_CPU_NUMBER - num_cpu - 1].mode = mode;
queue[MAX_CPU_NUMBER - num_cpu - 1].routine = symv_kernel;
Expand Down Expand Up @@ -226,7 +226,7 @@ int CNAME(BLASLONG m, FLOAT *alpha, FLOAT *a, BLASLONG lda, FLOAT *x, BLASLONG i

range_m[num_cpu + 1] = range_m[num_cpu] + width;
range_n[num_cpu] = num_cpu * (((m + 15) & ~15) + 16);
if (range_n[num_cpu] > m) range_n[num_cpu] = m;
if (range_n[num_cpu] > m * num_cpu) range_n[num_cpu] = m * num_cpu;

queue[num_cpu].mode = mode;
queue[num_cpu].routine = symv_kernel;
Expand Down
6 changes: 3 additions & 3 deletions driver/level2/tbmv_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ int CNAME(BLASLONG n, BLASLONG k, FLOAT *a, BLASLONG lda, FLOAT *x, BLASLONG inc

range_m[MAX_CPU_NUMBER - num_cpu - 1] = range_m[MAX_CPU_NUMBER - num_cpu] - width;
range_n[num_cpu] = num_cpu * (((n + 15) & ~15) + 16);
if (range_n[num_cpu] > n) range_n[num_cpu] = n;
if (range_n[num_cpu] > n * num_cpu) range_n[num_cpu] = n * num_cpu;

queue[num_cpu].mode = mode;
queue[num_cpu].routine = trmv_kernel;
Expand Down Expand Up @@ -328,7 +328,7 @@ int CNAME(BLASLONG n, BLASLONG k, FLOAT *a, BLASLONG lda, FLOAT *x, BLASLONG inc

range_m[num_cpu + 1] = range_m[num_cpu] + width;
range_n[num_cpu] = num_cpu * (((n + 15) & ~15) + 16);
if (range_n[num_cpu] > n) range_n[num_cpu] = n;
if (range_n[num_cpu] > n * num_cpu) range_n[num_cpu] = n * num_cpu;

queue[num_cpu].mode = mode;
queue[num_cpu].routine = trmv_kernel;
Expand Down Expand Up @@ -358,7 +358,7 @@ int CNAME(BLASLONG n, BLASLONG k, FLOAT *a, BLASLONG lda, FLOAT *x, BLASLONG inc

range_m[num_cpu + 1] = range_m[num_cpu] + width;
range_n[num_cpu] = num_cpu * (((n + 15) & ~15) + 16);
if (range_n[num_cpu] > n) range_n[num_cpu] = n;
if (range_n[num_cpu] > n * num_cpu) range_n[num_cpu] = n * num_cpu;

queue[num_cpu].mode = mode;
queue[num_cpu].routine = trmv_kernel;
Expand Down
4 changes: 2 additions & 2 deletions driver/level2/tpmv_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ int CNAME(BLASLONG m, FLOAT *a, FLOAT *x, BLASLONG incx, FLOAT *buffer, int nthr

range_m[MAX_CPU_NUMBER - num_cpu - 1] = range_m[MAX_CPU_NUMBER - num_cpu] - width;
range_n[num_cpu] = num_cpu * (((m + 15) & ~15) + 16);
if (range_n[num_cpu] > m) range_n[num_cpu] = m;
if (range_n[num_cpu] > m * num_cpu) range_n[num_cpu] = m * num_cpu;

queue[num_cpu].mode = mode;
queue[num_cpu].routine = tpmv_kernel;
Expand Down Expand Up @@ -343,7 +343,7 @@ int CNAME(BLASLONG m, FLOAT *a, FLOAT *x, BLASLONG incx, FLOAT *buffer, int nthr

range_m[num_cpu + 1] = range_m[num_cpu] + width;
range_n[num_cpu] = num_cpu * (((m + 15) & ~15) + 16);
if (range_n[num_cpu] > m) range_n[num_cpu] = m;
if (range_n[num_cpu] > m * num_cpu) range_n[num_cpu] = m * num_cpu;

queue[num_cpu].mode = mode;
queue[num_cpu].routine = tpmv_kernel;
Expand Down

0 comments on commit 177b78c

Please sign in to comment.