-
-
Notifications
You must be signed in to change notification settings - Fork 831
feat: add blas/base/strsm
#7021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Coverage Report
The above coverage report was generated for the changes in this PR. |
var f32 = require( '@stdlib/number/float64/base/to-float32' ); | ||
|
||
|
||
// FUNCTIONS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// FUNCTIONS | |
// FUNCTIONS // |
*/ | ||
function strsm( side, uplo, transa, diag, M, N, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB ) { // eslint-disable-line max-params | ||
var nonunit; | ||
var isrma; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ShabiShett07 Mind cleaning up these lint errors concerning indentation? By now you should have set up your local dev environment such that these sorts of lint errors never happen.
|
||
// EXPORTS // | ||
|
||
module.exports = strsm; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing trailing newline.
if ( isrmb ) { | ||
// For row-major matrices, the last dimension has the fastest changing index... | ||
sb0 = strideB2; // stride for innermost loop | ||
sb1 = strideB1; // stride for outermost loop | ||
} else { // isColMajor | ||
// For column-major matrices, the first dimension has the fastest changing index... | ||
sb0 = strideB1; // stride for innermost loop | ||
sb1 = strideB2; // stride for outermost loop | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is why you are getting incorrect results. You need to do whatever A
does above. You shouldn't independently swap the strides of B
. When A
and B
are in two different orders, it is always the case that either A
or B
will be iterated in a non-cache optimal way. In which case, we just have to pick which matrix we want to optimize for and picking either A
or B
is valid. In this case, picking A
is as good a choice as any.
Accordingly, L151-159 should become:
if ( isrma ) {
// For row-major matrices, the last dimension has the fastest changing index...
sa0 = strideA2; // stride for innermost loop
sa1 = strideA1; // stride for outermost loop
sb0 = strideB2;
sb1 = strideB1;
} else { // isColMajor
// For column-major matrices, the first dimension has the fastest changing index...
sa0 = strideA1; // stride for innermost loop
sa1 = strideA2; // stride for outermost loop
sb0 = strideB1;
sb1 = strideB2;
}
Progresses #2039
Description
This pull request:
blas/base/strsm
Related Issues
This pull request:
Questions
No.
Other
No.
Checklist
@stdlib-js/reviewers