From 2ee6bbca2953d04c967685da9735b3eaf8a4b813 Mon Sep 17 00:00:00 2001 From: "Field G. Van Zee" Date: Mon, 15 Apr 2013 19:27:57 -0500 Subject: [PATCH] Fixed bug in bli_obj_is_packed() and renamed. Details: - This macro is used to determine whether the partitioning routines should call a corresponding packm_part routine instead. However, it was unintentionally catching matrices that were marked as "packed" by virtue of them simply being marked as BLIS_PACKED_UNSPEC in, say, bli_gemv(). The macro has now been renamed to bli_obj_is_panel_packed(), and now only checks for row or column panel packing. (Note that I first attempted to fix this bug in a571af816d72.) Thanks to Bryan Marker for reporting the erroneous behavior that led me to this bug. --- frame/base/bli_part.c | 21 +++++++++++++++------ frame/include/bli_obj_macro_defs.h | 7 ++++--- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/frame/base/bli_part.c b/frame/base/bli_part.c index 90c556170..482b0724b 100644 --- a/frame/base/bli_part.c +++ b/frame/base/bli_part.c @@ -53,8 +53,11 @@ void bli_acquire_mpart_t2b( subpart_t requested_part, doff_t diag_off_inc; - // Call a special function for partitioning packed objects. - if ( bli_obj_is_packed( *obj ) ) + // Call a special function for partitioning packed objects. (By only + // catching those objects packed to panels, we omit cases where the + // object is packed to row or column storage, as such objects can be + // partitioned through normally.) + if ( bli_obj_is_panel_packed( *obj ) ) { bli_packm_acquire_mpart_t2b( requested_part, i, b, obj, sub_obj ); return; @@ -220,8 +223,11 @@ void bli_acquire_mpart_l2r( subpart_t requested_part, doff_t diag_off_inc; - // Call a special function for partitioning packed objects. - if ( bli_obj_is_packed( *obj ) ) + // Call a special function for partitioning packed objects. (By only + // catching those objects packed to panels, we omit cases where the + // object is packed to row or column storage, as such objects can be + // partitioned through normally.) + if ( bli_obj_is_panel_packed( *obj ) ) { bli_packm_acquire_mpart_l2r( requested_part, j, b, obj, sub_obj ); return; @@ -387,8 +393,11 @@ void bli_acquire_mpart_tl2br( subpart_t requested_part, doff_t diag_off_inc; - // Call a special function for partitioning packed objects. - if ( bli_obj_is_packed( *obj ) ) + // Call a special function for partitioning packed objects. (By only + // catching those objects packed to panels, we omit cases where the + // object is packed to row or column storage, as such objects can be + // partitioned through normally.) + if ( bli_obj_is_panel_packed( *obj ) ) { bli_packm_acquire_mpart_tl2br( requested_part, ij, b, obj, sub_obj ); return; diff --git a/frame/include/bli_obj_macro_defs.h b/frame/include/bli_obj_macro_defs.h index c4571efb2..b242abe31 100644 --- a/frame/include/bli_obj_macro_defs.h +++ b/frame/include/bli_obj_macro_defs.h @@ -823,11 +823,12 @@ bli_obj_width_stored( obj ) // Check if an object is a packed object // NOTE: TRUE here does not mean the actual packing is complete, such as with -// incremental packing.) +// incremental packing. -#define bli_obj_is_packed( obj ) \ +#define bli_obj_is_panel_packed( obj ) \ \ - ( bli_obj_pack_status( obj ) != BLIS_NOT_PACKED ) + ( bli_obj_pack_status( obj ) == BLIS_PACKED_ROW_PANELS || \ + bli_obj_pack_status( obj ) == BLIS_PACKED_COL_PANELS ) // Release object's pack (and cast) memory entries back to memory manager