Skip to content

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

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

ShabiShett07
Copy link
Contributor

Progresses #2039

Description

What is the purpose of this pull request?

This pull request:

  • Adds the package blas/base/strsm

Related Issues

Does this pull request have any related issues?

This pull request:

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

No.

Checklist

Please ensure the following tasks are completed before submitting this pull request.


@stdlib-js/reviewers

@stdlib-bot stdlib-bot added the BLAS Issue or pull request related to Basic Linear Algebra Subprograms (BLAS). label May 17, 2025
@ShabiShett07 ShabiShett07 added GSoC Google Summer of Code. gsoc: 2025 Google Summer of Code (2025). labels May 23, 2025
@stdlib-bot
Copy link
Contributor

Coverage Report

Package Statements Branches Functions Lines
blas/base/strsm $\color{red}686/732$
$\color{green}+93.72\%$
$\color{red}147/163$
$\color{green}+90.18\%$
$\color{green}4/4$
$\color{green}+100.00\%$
$\color{red}686/732$
$\color{green}+93.72\%$

The above coverage report was generated for the changes in this PR.

var f32 = require( '@stdlib/number/float64/base/to-float32' );


// FUNCTIONS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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;
Copy link
Member

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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing trailing newline.

Comment on lines +160 to +168
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
}
Copy link
Member

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;
	}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BLAS Issue or pull request related to Basic Linear Algebra Subprograms (BLAS). GSoC Google Summer of Code. gsoc: 2025 Google Summer of Code (2025).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants