Repository navigation
Conversation
Coverage Report
The above coverage report was generated for the changes in this PR. |
| int main( void ) { | ||
| // Create data buffers: | ||
| float dataX[] = { 1.0f, 2.0f, 3.0f, 4.0f }; | ||
| float dataY[] = { 2.0f, 3.0f, 4.0f, 5.0f }; |
There was a problem hiding this comment.
| float dataY[] = { 2.0f, 3.0f, 4.0f, 5.0f }; | |
| const float dataX[] = { 1.0f, -2.0f, 3.0f, -4.0f, 5.0f, -6.0f, 7.0f, -8.0f }; | |
| float dataY[] = { 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f }; |
| const int64_t ndims = 1; | ||
|
|
||
| // Specify the array shape: | ||
| int64_t shape[] = { 4 }; |
There was a problem hiding this comment.
| int64_t shape[] = { 4 }; | |
| int64_t shape[] = { 8 }; |
| stdlib_blas_ext_saxpby( arrays ); | ||
|
|
||
| // Print the result: | ||
| for ( int i = 0; i < 4; i++ ) { |
There was a problem hiding this comment.
| for ( int i = 0; i < 4; i++ ) { | |
| for ( int i = 0; i < 8; i++ ) { |
| int main( void ) { | ||
| // Create data buffers: | ||
| float dataX[] = { 1.0f, 2.0f, 3.0f, 4.0f }; | ||
| float dataY[] = { 2.0f, 3.0f, 4.0f, 5.0f }; |
There was a problem hiding this comment.
| float dataY[] = { 2.0f, 3.0f, 4.0f, 5.0f }; | |
| const float dataX[] = { 1.0f, -2.0f, 3.0f, -4.0f, 5.0f, -6.0f, 7.0f, -8.0f }; | |
| float dataY[] = { 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f, 8.0f, 9.0f }; |
The C example here repeats the same data and constants as the usage example above, so the two end up showing the exact same computation. It would be clearer if this one used a different setup.
How about reusing the data from blas/ext/base/ndarray/dxpy's C example? Since y is also an input for saxpby, it should stay non-zero;
| const int64_t ndims = 1; | ||
|
|
||
| // Specify the array shape: | ||
| int64_t shape[] = { 4 }; |
There was a problem hiding this comment.
| int64_t shape[] = { 4 }; | |
| int64_t shape[] = { 8 }; |
| const int64_t nsubmodes = 1; | ||
|
|
||
| // Create input ndarrays: | ||
| struct ndarray *x = stdlib_ndarray_allocate( STDLIB_NDARRAY_FLOAT32, (uint8_t *)dataX, ndims, shape, strides, offset, order, imode, nsubmodes, submodes ); |
There was a problem hiding this comment.
| struct ndarray *x = stdlib_ndarray_allocate( STDLIB_NDARRAY_FLOAT32, (uint8_t *)dataX, ndims, shape, strides, offset, order, imode, nsubmodes, submodes ); | |
| struct ndarray *x = stdlib_ndarray_allocate( STDLIB_NDARRAY_FLOAT32, (uint8_t *)dataX, ndims, shape, strides, offset, order, imode, nsubmodes, submodes ); | |
| stdlib_blas_ext_saxpby( arrays ); | ||
|
|
||
| // Print the result: | ||
| for ( int i = 0; i < 4; i++ ) { |
There was a problem hiding this comment.
| for ( int i = 0; i < 4; i++ ) { | |
| for ( int i = 0; i < 8; i++ ) { |
|
Left a few suggestions; |
|
Thanks for the review @ujjwalv01! I've updated binding.gyp and updated the C example data and formatting accordingly. |
0PrashantYadav0
left a comment
There was a problem hiding this comment.
The AI disclosure in the PR description still reads {{TODO: add disclosure if applicable}} even though "Yes" is checked. Please fill it in.
Co-authored-by: JoyBoy <prashantyadav09783@gmail.com> Signed-off-by: Samarth Kolarkar <144821218+Erennn7@users.noreply.github.com>
Progresses #14819
Description
This pull request:
blas/ext/base/ndarray/saxpbyRelated Issues
This pull request has the following related issues:
blas/ext/base/ndarraypackages #14819Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
@stdlib-js/reviewers