Skip to content

Commit e2c108f

Browse files
Jonas HahnfeldJonas Hahnfeld
Jonas Hahnfeld
authored and
Jonas Hahnfeld
committed
CUDA: Correct condition for CRS matrices
1 parent b2b1457 commit e2c108f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cuda/kernel.cu

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ __inline__ __device__ void _matvecKernelCRS(int *ptr, int *index,
99
for (int i = blockIdx.x * blockDim.x + threadIdx.x; i < N;
1010
i += blockDim.x * gridDim.x) {
1111
// Skip load and store if nothing to be done...
12-
if (!roundup || ptr[i] == ptr[i + 1]) {
12+
if (!roundup || ptr[i] != ptr[i + 1]) {
1313
floatType tmp = (roundup ? y[i] : 0);
1414
for (int j = ptr[i]; j < ptr[i + 1]; j++) {
1515
tmp += value[j] * x[index[j]];

0 commit comments

Comments
 (0)