Skip to content

Commit

Permalink
Change check for excess column in ellpack x2
Browse files Browse the repository at this point in the history
New check is after thresholding product, not before
  • Loading branch information
jeanlucf22 committed Nov 20, 2023
1 parent 557e389 commit 996427d
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/C-interface/ellpack/bml_multiply_ellpack_typed.c
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,6 @@ void *TYPED_FUNC(
}
}

// Check for number of non-zeroes per row exceeded
if (l > X2_M)
{
#ifndef USE_OMP_OFFLOAD
LOG_ERROR("Number of non-zeroes per row > M, Increase M\n");
#endif
}

#ifdef INTEL_OPT
__assume_aligned(X2_nnz, MALLOC_ALIGNMENT);
__assume_aligned(X2_index, MALLOC_ALIGNMENT);
Expand All @@ -296,7 +288,6 @@ void *TYPED_FUNC(
int ll = 0;
for (int j = 0; j < l; j++)
{
//int jp = X2_index[ROWMAJOR(i, j, N, M)];
int jp = jx[j];
REAL_T xtmp = x[jp];
if (jp == i)
Expand All @@ -315,6 +306,16 @@ void *TYPED_FUNC(
ix[jp] = 0;
x[jp] = 0.0;
}
// Check for number of non-zeroes per row exceeded
// We should do it before assigning values to X2_value above,
// but that would be a lot of checks
if (ll > X2_M)
{
#ifndef USE_OMP_OFFLOAD
LOG_ERROR("Number of non-zeroes per row > M, Increase M\n");
#endif
}

X2_nnz[i] = ll;
}

Expand Down

0 comments on commit 996427d

Please sign in to comment.