Skip to content

refactor: update blas/ext/base/dsnansum to follow current project conventions #2001

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

Merged
merged 21 commits into from
Apr 14, 2024

Conversation

Shubh942
Copy link
Contributor

Resolves #1492.

Description

update blas/ext/base/dsnansum to follow current project conventions

What is the purpose of this pull request?

This pull request:

progresses #1152
Fixes #1492

Related Issues

Does this pull request have any related issues?

This pull request:

  • resolves #
  • fixes #

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 Mar 22, 2024
@Shubh942
Copy link
Contributor Author

@Planeshifter @Pranavchiku @kgryte can you please review it

@kgryte kgryte changed the title refactor update blas/ext/base/dsnansum to follow current project conventions refactor: update blas/ext/base/dsnansum to follow current project conventions Mar 22, 2024
@kgryte kgryte added Enhancement Issue or pull request for enhancing existing functionality. Needs Review A pull request which needs code review. Native Addons Issue involves or relates to Node.js native add-ons. C Issue involves or relates to C. labels Mar 22, 2024
Copy link
Member

@Pranavchiku Pranavchiku left a comment

Choose a reason for hiding this comment

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

You have to fix addon.c file, refer similar PRs. Left few comments, once addressed this will be good to merge.

@Pranavchiku Pranavchiku added Needs Changes Pull request which needs changes before being merged. and removed Needs Review A pull request which needs code review. labels Mar 25, 2024
@Shubh942
Copy link
Contributor Author

I will change the code as specified. Thanks for your response

@Shubh942
Copy link
Contributor Author

@Pranavchiku I have made the suggested changes.

Copy link
Member

@Pranavchiku Pranavchiku left a comment

Choose a reason for hiding this comment

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

You will have to update indentation in manifest.json and update addon.c

@Shubh942
Copy link
Contributor Author

@Pranavchiku I have updated the indentation in manifest.json and update addon.c.

@Shubh942
Copy link
Contributor Author

@Planeshifter can you please review my PR

Signed-off-by: Pranav <85227306+Pranavchiku@users.noreply.github.com>
Copy link
Member

@Pranavchiku Pranavchiku left a comment

Choose a reason for hiding this comment

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

This looks good to me. Thanks @Shubh942 !

@Pranavchiku Pranavchiku added Ready To Merge A pull request which is ready to be merged. and removed Needs Changes Pull request which needs changes before being merged. labels Mar 27, 2024
Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
"dependencies": [
"@stdlib/napi/export",
"@stdlib/napi/argv",
"@stdlib/napi/argv-float",
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
"@stdlib/napi/argv-float",

This isn't needed.

#include "stdlib/blas/ext/base/dsnansum.h"
#include "stdlib/napi/export.h"
#include "stdlib/napi/argv.h"
#include "stdlib/napi/argv_float.h"
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
#include "stdlib/napi/argv_float.h"

This isn't used.

@@ -35,7 +34,7 @@ tape( 'main export is a function', function test( t ) {
});

tape( 'the function has an arity of 4', function test( t ) {
t.strictEqual( dsnansum.length, 4, 'has expected arity' );
t.strictEqual( dsnansum.length, 4, 'return expected value' );
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
t.strictEqual( dsnansum.length, 4, 'return expected value' );
t.strictEqual( dsnansum.length, 4, 'returns expected value' );

@@ -35,7 +34,7 @@ tape( 'main export is a function', function test( t ) {
});

tape( 'the function has an arity of 3', function test( t ) {
t.strictEqual( dsnansum.length, 3, 'has expected arity' );
t.strictEqual( dsnansum.length, 3, 'return expected value' );
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
t.strictEqual( dsnansum.length, 3, 'return expected value' );
t.strictEqual( dsnansum.length, 3, 'returns expected value' );

@@ -44,7 +43,7 @@ tape( 'main export is a function', opts, function test( t ) {
});

tape( 'the function has an arity of 4', opts, function test( t ) {
t.strictEqual( dsnansum.length, 4, 'has expected arity' );
t.strictEqual( dsnansum.length, 4, 'return expected value' );
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
t.strictEqual( dsnansum.length, 4, 'return expected value' );
t.strictEqual( dsnansum.length, 4, 'returns expected value' );

x[ i ] = round( randu()*100.0 );
}
}
var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) );
Copy link
Member

Choose a reason for hiding this comment

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

The changes to this example are not equivalent to the original.

x[ i ] = ( randu()*10.0 ) - 20.0;
}
}
var x = filledarrayBy( len, 'float32', rand );
Copy link
Member

Choose a reason for hiding this comment

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

The changes to this (and the other benchmarks) are not equivalent to the original.

@kgryte kgryte added Needs Changes Pull request which needs changes before being merged. and removed Ready To Merge A pull request which is ready to be merged. labels Mar 29, 2024
],
"libpath": [],
"dependencies": [
"@stdlib/blas/ext/base/dsnansumpw"
Copy link
Member

Choose a reason for hiding this comment

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

This dependency has been omitted from the dependencies in each of the configurations. This should be re-added to each of them.

Copy link
Member

@kgryte kgryte left a comment

Choose a reason for hiding this comment

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

This PR needs changes, as directed in the comments, before it can be merged. Benchmark test data generation should remain similar to the original. Namely, NaNs should be present; otherwise, compiler optimizations can result in conditionals being removed, resulting in better measured performance than "real-world" usage.

@Shubh942
Copy link
Contributor Author

@kgryte @Planeshifter I made the required changes. Can you please review it.

Planeshifter and others added 2 commits March 29, 2024 09:38
Signed-off-by: Philipp Burckhardt <pburckhardt@outlook.com>
@Shubh942
Copy link
Contributor Author

@kgryte @Planeshifter I made the required changes.

@kgryte
Copy link
Member

kgryte commented Apr 8, 2024

@Shubh942 Looks like this PR is failing CI, including failing tests and lint errors. Until those are resolved, we won't be able to move this PR forward.

@Planeshifter Planeshifter self-requested a review April 14, 2024 20:35
@Planeshifter Planeshifter merged commit d2ec36e into stdlib-js:develop Apr 14, 2024
8 checks passed
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). C Issue involves or relates to C. Enhancement Issue or pull request for enhancing existing functionality. Native Addons Issue involves or relates to Node.js native add-ons. Needs Changes Pull request which needs changes before being merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[RFC]: refactor blas/ext/base/dsnansum to follow current project conventions
5 participants