Skip to content
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

feat: add blas/base/drotm-wasm #3021

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

aman-095
Copy link
Member

Progresses #2039.

Description

What is the purpose of this pull request?

This pull request adds wasm support for drotm.

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 Oct 21, 2024
@aman-095
Copy link
Member Author

aman-095 commented Oct 21, 2024

Hey, @kgryte, don't know why the test case inside test.main.js and test.ndarray.js for N < 0 is giving an error.

	drotm.main( -1, x, 1, y, 1, param );

Error message:

# if provided an `N` parameter less than or equal to `0`, the `main` method leaves both input arrays unchanged
/home/aman/stdlib/lib/node_modules/@stdlib/strided/base/write-dataview/lib/ndarray.js:103
                view[ m ]( iv, data[ ix ], littleEndian );
                         ^

RangeError: Offset is outside the bounds of the DataView
    at DataView.setFloat64 (<anonymous>)
    at indexed (/home/aman/stdlib/lib/node_modules/@stdlib/strided/base/write-dataview/lib/ndarray.js:103:12)
    at writeDataView (/home/aman/stdlib/lib/node_modules/@stdlib/strided/base/write-dataview/lib/ndarray.js:296:9)
    at arrays2ptrs (/home/aman/stdlib/lib/node_modules/@stdlib/wasm/base/arrays2ptrs/lib/main.js:161:4)
    at Routine.drotm (/home/aman/stdlib/lib/node_modules/@stdlib/blas/base/drotm-wasm/lib/routine.js:176:9)
    at Routine.drotm (/home/aman/stdlib/lib/node_modules/@stdlib/blas/base/drotm-wasm/lib/routine.js:130:14)
    at Test.test (/home/aman/stdlib/lib/node_modules/@stdlib/blas/base/drotm-wasm/test/test.main.js:680:8)
    at Test.bound [as _cb] (/home/aman/stdlib/node_modules/tape/lib/test.js:58:32)
    at Test.run (/home/aman/stdlib/node_modules/tape/lib/test.js:77:10)
    at Test.bound [as run] (/home/aman/stdlib/node_modules/tape/lib/test.js:58:32)

* // Write vector values to module memory:
* drotm.write( xptr, oneTo( N, dtype ) );
* drotm.write( yptr, ones( N, dtype ) );
* drotm.write( pptr, zeros( 5, dtype ) );
Copy link
Member

Choose a reason for hiding this comment

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

Using all zeros for the parameters is not a particularly "interesting" example.

@kgryte
Copy link
Member

kgryte commented Oct 26, 2024

@aman-095 Looks like there is a bug in what we are passing to strided2object. Namely, it naively assumes that N is a nonnegative integer:

* @param {NonNegativeInteger} N - number of indexed elements

My guess is that we should update

to

- obj.length = N;
+ obj.length = ( N > 0 ) ? N : 0;

@kgryte
Copy link
Member

kgryte commented Oct 26, 2024

This PR will need to incorporate various docs and build changes as made in other blas/base/*-wasm packages recently.

@kgryte kgryte changed the title feat: add wasm support for blas/base/drotm-wasm feat: add blas/base/drotm-wasm Oct 26, 2024
@kgryte kgryte added Feature Issue or pull request for adding a new feature. WebAssembly Issue involves or relates to WebAssembly. labels Oct 26, 2024
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). Feature Issue or pull request for adding a new feature. WebAssembly Issue involves or relates to WebAssembly.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants