Fixed "root" object bug in bli_her[2]k/syr[2]k.

Details:
- Fixed an obscure bug in the front-ends for herk, her2k, syrk, and syr2k,
  that manifested as the incorrect triangle being updated. It occurred when
  the user would pass in a matrix object that was correctly marked as
  symmetric/Hermitian and lower-stored, but whose root object was never marked
  as lower (or upper). We now alias and re-assign root status for matrix C
  within the front-ends. Note that trmm and trsm were already doing this,
  albeit for a slightly different reason (to allow the internal back-end to
  choose which algorithm to run--lower or upper--based on the uplo of the root
  object for both left and right side cases). Thanks to Bryan Marker for
  leading me to this bug.
This commit is contained in:
Field G. Van Zee
2013-04-16 17:37:16 -05:00
parent 19155a768d
commit 7904e20f2e
4 changed files with 32 additions and 8 deletions

View File

@@ -50,6 +50,7 @@ void bli_her2k( obj_t* alpha,
obj_t alpha_local;
obj_t alpha_conj_local;
obj_t beta_local;
obj_t c_local;
obj_t ah;
obj_t bh;
num_t dt_targ_a;
@@ -71,6 +72,11 @@ void bli_her2k( obj_t* alpha,
return;
}
// Alias C so we can reset it as the root object (in case it is not
// already a root object).
bli_obj_alias_to( *c, c_local );
bli_obj_set_as_root( c_local );
// Create objects to track A' and B' (for the second rank-k update).
bli_obj_alias_with_trans( BLIS_CONJ_TRANSPOSE, *a, ah );
bli_obj_alias_with_trans( BLIS_CONJ_TRANSPOSE, *b, bh );
@@ -145,7 +151,7 @@ void bli_her2k( obj_t* alpha,
b,
&ah,
&beta_local,
c,
&c_local,
cntl );
/*
@@ -153,13 +159,13 @@ void bli_her2k( obj_t* alpha,
a,
&bh,
&beta_local,
c,
&c_local,
herk_cntl );
bli_herk_int( &alpha_conj_local,
b,
&ah,
&BLIS_ONE,
c,
&c_local,
herk_cntl );
*/
}

View File

@@ -47,6 +47,7 @@ void bli_herk( obj_t* alpha,
herk_t* cntl;
obj_t alpha_local;
obj_t beta_local;
obj_t c_local;
obj_t ah;
num_t dt_targ_a;
num_t dt_targ_ah;
@@ -67,6 +68,11 @@ void bli_herk( obj_t* alpha,
return;
}
// Alias C so we can reset it as the root object (in case it is not
// already a root object).
bli_obj_alias_to( *c, c_local );
bli_obj_set_as_root( c_local );
// For herk, the right-hand "B" operand is simply A'.
bli_obj_alias_with_trans( BLIS_CONJ_TRANSPOSE, *a, ah );
@@ -141,7 +147,7 @@ void bli_herk( obj_t* alpha,
a,
&ah,
&beta_local,
c,
&c_local,
cntl );
}

View File

@@ -49,6 +49,7 @@ void bli_syr2k( obj_t* alpha,
her2k_t* cntl;
obj_t alpha_local;
obj_t beta_local;
obj_t c_local;
obj_t at;
obj_t bt;
num_t dt_targ_a;
@@ -70,6 +71,11 @@ void bli_syr2k( obj_t* alpha,
return;
}
// Alias C so we can reset it as the root object (in case it is not
// already a root object).
bli_obj_alias_to( *c, c_local );
bli_obj_set_as_root( c_local );
// Create objects to track A^T and B^T (for the second rank-k update).
bli_obj_alias_with_trans( BLIS_TRANSPOSE, *a, at );
bli_obj_alias_with_trans( BLIS_TRANSPOSE, *b, bt );
@@ -141,20 +147,20 @@ void bli_syr2k( obj_t* alpha,
b,
&at,
&beta_local,
c,
&c_local,
cntl );
/*
bli_herk_int( &alpha_local,
a,
&bt,
&beta_local,
c,
&c_local,
herk_cntl );
bli_herk_int( &alpha_local,
b,
&at,
&BLIS_ONE,
c,
&c_local,
herk_cntl );
*/
}

View File

@@ -47,6 +47,7 @@ void bli_syrk( obj_t* alpha,
herk_t* cntl;
obj_t alpha_local;
obj_t beta_local;
obj_t c_local;
obj_t at;
num_t dt_targ_a;
num_t dt_targ_at;
@@ -67,6 +68,11 @@ void bli_syrk( obj_t* alpha,
return;
}
// Alias C so we can reset it as the root object (in case it is not
// already a root object).
bli_obj_alias_to( *c, c_local );
bli_obj_set_as_root( c_local );
// For syrk, the right-hand "B" operand is simply A^T.
bli_obj_alias_with_trans( BLIS_TRANSPOSE, *a, at );
@@ -144,7 +150,7 @@ void bli_syrk( obj_t* alpha,
a,
&at,
&beta_local,
c,
&c_local,
cntl );
}