Skip to content

Commit e03e708

Browse files
authored
Change check for excess column in ellpack x2 (lanl#743)
New check is after thresholding product, not before
1 parent 557e389 commit e03e708

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/C-interface/ellpack/bml_multiply_ellpack_typed.c

+10-9
Original file line numberDiff line numberDiff line change
@@ -280,14 +280,6 @@ void *TYPED_FUNC(
280280
}
281281
}
282282

283-
// Check for number of non-zeroes per row exceeded
284-
if (l > X2_M)
285-
{
286-
#ifndef USE_OMP_OFFLOAD
287-
LOG_ERROR("Number of non-zeroes per row > M, Increase M\n");
288-
#endif
289-
}
290-
291283
#ifdef INTEL_OPT
292284
__assume_aligned(X2_nnz, MALLOC_ALIGNMENT);
293285
__assume_aligned(X2_index, MALLOC_ALIGNMENT);
@@ -296,7 +288,6 @@ void *TYPED_FUNC(
296288
int ll = 0;
297289
for (int j = 0; j < l; j++)
298290
{
299-
//int jp = X2_index[ROWMAJOR(i, j, N, M)];
300291
int jp = jx[j];
301292
REAL_T xtmp = x[jp];
302293
if (jp == i)
@@ -315,6 +306,16 @@ void *TYPED_FUNC(
315306
ix[jp] = 0;
316307
x[jp] = 0.0;
317308
}
309+
// Check for number of non-zeroes per row exceeded
310+
// We should do it before assigning values to X2_value above,
311+
// but that would be a lot of checks
312+
if (ll > X2_M)
313+
{
314+
#ifndef USE_OMP_OFFLOAD
315+
LOG_ERROR("Number of non-zeroes per row > M, Increase M\n");
316+
#endif
317+
}
318+
318319
X2_nnz[i] = ll;
319320
}
320321

0 commit comments

Comments
 (0)