From 0c8afa546d7f33760415519ba328d7c49eb7aa06 Mon Sep 17 00:00:00 2001 From: "Field G. Van Zee" Date: Fri, 4 Aug 2017 14:17:44 -0500 Subject: [PATCH] Fixed a minor bug in level-3 packm management. Details: - Fixed a bug in bli_l3_packm() that caused cntl_t-cached packed mem_t entries to be released and then re-acquired unnecessarily. (In essence, the "<" operands in the conditional that guards the release-and-reacquire code block simply needed to be swapped.) The bug should have only affected performance (rather than the computed result). Thanks to Minh Quan for identifying and reporting the bug. --- frame/3/bli_l3_packm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/frame/3/bli_l3_packm.c b/frame/3/bli_l3_packm.c index 28fb1f857..82383f93a 100644 --- a/frame/3/bli_l3_packm.c +++ b/frame/3/bli_l3_packm.c @@ -115,12 +115,13 @@ void bli_l3_packm // buffer, then a block has already been acquired from the memory // broker and cached in the control tree. - // BUT, we need to make sure that the mem_t object is not associated - // with a block that is too small given the size of the packed matrix - // that we need, according to the return value from packm_init(). + // As a sanity check, we should make sure that the mem_t object isn't + // associated with a block that is too small compared to the size of + // the packed matrix buffer that is needed, according to the return + // value from packm_init(). siz_t cntl_mem_size = bli_mem_size( cntl_mem_p ); - if ( size_needed < cntl_mem_size ) + if ( cntl_mem_size < size_needed ) { if ( bli_thread_am_ochief( thread ) ) {