diff --git a/frame/3/bli_l3_oapi.c b/frame/3/bli_l3_oapi.c index 29eca1bf1..d09053fe7 100644 --- a/frame/3/bli_l3_oapi.c +++ b/frame/3/bli_l3_oapi.c @@ -57,6 +57,19 @@ void PASTEMAC(opname,EX_SUF) \ bli_init_once(); \ \ BLIS_OAPI_EX_DECLS \ +\ + /* If C has a zero dimension, return early. */ \ + if ( bli_obj_has_zero_dim( c ) ) return; \ +\ + /* if alpha or A or B has a zero dimension, \ + scale C by beta and return early. */ \ + if ( bli_obj_equals( alpha, &BLIS_ZERO ) || \ + bli_obj_has_zero_dim( a ) || \ + bli_obj_has_zero_dim( b ) ) \ + {\ + bli_scalm( beta, c ); \ + return;\ + }\ \ /* If the rntm is non-NULL, it may indicate that we should forgo sup handling altogether. */ \ diff --git a/frame/3/gemm/bli_gemm_front.c b/frame/3/gemm/bli_gemm_front.c index f274d51e5..6ac1755f4 100644 --- a/frame/3/gemm/bli_gemm_front.c +++ b/frame/3/gemm/bli_gemm_front.c @@ -56,15 +56,7 @@ void bli_gemm_front // Check parameters. if ( bli_error_checking_is_enabled() ) bli_gemm_check( alpha, a, b, beta, c, cntx ); - - // If alpha is zero, scale by beta and return. - if ( bli_obj_equals( alpha, &BLIS_ZERO ) ) - { - bli_scalm( beta, c ); - return; - } - - + #ifdef BLIS_ENABLE_SMALL_MATRIX // Only handle small problems separately for homogeneous datatypes. if ( bli_obj_dt( a ) == bli_obj_dt( b ) &&