mirror of
https://github.com/amd/blis.git
synced 2026-04-20 07:38:53 +00:00
Defined a new level-1d operation: shiftd.
Details: - Defined a new level-1d operation called 'shiftd', including object and typed APIs. This operation adds a scalar value to every element along an arbitrary diagonal of a matrix. Currently, shiftd is implemented in terms of the addv kernel. (The scalar is passed in as the x vector with an increment of zero.) - Replaced ad-hoc usage of setd and addd (after creating a temporary matrix object) with use of shiftd, which is much more concise, in various test driver files in the testsuite. Similar changes were made to the standalone test drivers and the example code. - Added documentation entries in BLISObjectAPI.md and BLISTypedAPI.md for bli_shiftd() and bli_?shiftd(), respectively. - Added observed object properties to level-1d documentation in BLISObjectAPI.md.
This commit is contained in:
@@ -41,7 +41,7 @@ int main( int argc, char** argv )
|
||||
dim_t m, n;
|
||||
inc_t rs, cs;
|
||||
|
||||
obj_t a, x, y, b, d;
|
||||
obj_t a, x, y, b;
|
||||
obj_t* alpha;
|
||||
obj_t* beta;
|
||||
|
||||
@@ -297,9 +297,7 @@ int main( int argc, char** argv )
|
||||
// Load the diagonal. By setting the diagonal to something of greater
|
||||
// absolute value than the off-diagonal elements, we increase the odds
|
||||
// that the matrix is not singular (singular matrices have no inverse).
|
||||
bli_obj_create( dt, m, m, 0, 0, &d );
|
||||
bli_setd( &BLIS_TWO, &d );
|
||||
bli_addd( &d, &a );
|
||||
bli_shiftd( &BLIS_TWO, &a );
|
||||
|
||||
bli_printm( "a: randomized (zeros in upper triangle)", &a, "%4.1f", "" );
|
||||
bli_printm( "b: initial value", &b, "%4.1f", "" );
|
||||
@@ -320,7 +318,6 @@ int main( int argc, char** argv )
|
||||
// Free the objects.
|
||||
bli_obj_free( &a );
|
||||
bli_obj_free( &b );
|
||||
bli_obj_free( &d );
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -42,7 +42,7 @@ int main( int argc, char** argv )
|
||||
inc_t rs, cs;
|
||||
side_t side;
|
||||
|
||||
obj_t a, b, c, d;
|
||||
obj_t a, b, c;
|
||||
obj_t* alpha;
|
||||
obj_t* beta;
|
||||
|
||||
@@ -299,9 +299,7 @@ int main( int argc, char** argv )
|
||||
// Load the diagonal. By setting the diagonal to something of greater
|
||||
// absolute value than the off-diagonal elements, we increase the odds
|
||||
// that the matrix is not singular (singular matrices have no inverse).
|
||||
bli_obj_create( dt, m, m, 0, 0, &d );
|
||||
bli_setd( &BLIS_TWO, &d );
|
||||
bli_addd( &d, &a );
|
||||
bli_shiftd( &BLIS_TWO, &a );
|
||||
|
||||
bli_printm( "a: randomized (zeros in upper triangle)", &a, "%4.1f", "" );
|
||||
bli_printm( "b: initial value", &b, "%4.1f", "" );
|
||||
@@ -323,7 +321,6 @@ int main( int argc, char** argv )
|
||||
bli_obj_free( &a );
|
||||
bli_obj_free( &b );
|
||||
bli_obj_free( &c );
|
||||
bli_obj_free( &d );
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user