Added edge handling to _determine_blocksize_b().

Details:
- Added explicit handling of situations where i == dim to
  bli_determine_blocksize_b_sub(). This isn't actually needed by any
  current use case within BLIS, but handling the situation is nonetheless
  prudent. Thanks to Minh Quan for reporting this issue and requesting
  the fix.
This commit is contained in:
Field G. Van Zee
2017-08-05 13:04:31 -05:00
committed by prangana
parent 0c8afa546d
commit a666fd4e26

View File

@@ -363,6 +363,11 @@ dim_t bli_determine_blocksize_b_sub
// chunk that will correspond to the blocksize we are computing now.
dim_left_now = dim - i;
// Sanity check: if dim_left_now is zero, then we can return zero
// without going any further.
if ( dim_left_now == 0 )
return 0;
dim_at_edge = dim_left_now % b_alg;
// If dim_left_now is a multiple of b_alg, we can safely return b_alg