feat: add C implementation for stats/base/ndarray/dmskmax - #14419
Open
ujjwalv01 wants to merge 3 commits into
Open
feat: add C implementation for stats/base/ndarray/dmskmax#14419ujjwalv01 wants to merge 3 commits into
stats/base/ndarray/dmskmax#14419ujjwalv01 wants to merge 3 commits into
Conversation
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
| #/ | ||
| clean-addon: | ||
| $(QUIET) -rm -f *.o *.node | ||
|
|
Member
There was a problem hiding this comment.
Suggested change
| $(QUIET) -rm -rf build/ | |
@kgryte Are we suppose remove the build folder as well in clean-addon ? I checked other Makefiles as well they all are same, they do not remove build folder on clean.
| function dmskmax( arrays ) { | ||
| var mask = arrays[ 1 ]; | ||
| var x = arrays[ 0 ]; | ||
| return addon( getData( x ), serialize( x ), getData( mask ), serialize( mask ) ); |
Member
There was a problem hiding this comment.
Suggested change
| return addon( getData( x ), serialize( x ), getData( mask ), serialize( mask ) ); | |
| return addon( getData( x ), serialize( x ), getData( mask ), serialize( mask ) ); // eslint-disable-line max-len |
| double stdlib_stats_dmskmax( const struct ndarray *arrays[] ) { | ||
| const struct ndarray *x = arrays[ 0 ]; | ||
| const struct ndarray *mask = arrays[ 1 ]; | ||
| return API_SUFFIX(stdlib_strided_dmskmax_ndarray)( stdlib_ndarray_dimension( x, 0 ), (const double *)stdlib_ndarray_data( x ), stdlib_ndarray_stride_elements( x, 0 ), stdlib_ndarray_offset_elements( x ), (const uint8_t *)stdlib_ndarray_data( mask ), stdlib_ndarray_stride_elements( mask, 0 ), stdlib_ndarray_offset_elements( mask ) ); |
Member
There was a problem hiding this comment.
Suggested change
| return API_SUFFIX(stdlib_strided_dmskmax_ndarray)( stdlib_ndarray_dimension( x, 0 ), (const double *)stdlib_ndarray_data( x ), stdlib_ndarray_stride_elements( x, 0 ), stdlib_ndarray_offset_elements( x ), (const uint8_t *)stdlib_ndarray_data( mask ), stdlib_ndarray_stride_elements( mask, 0 ), stdlib_ndarray_offset_elements( mask ) ); | |
| return API_SUFFIX(stdlib_strided_dmskmax_ndarray)( (const CBLAS_INT)stdlib_ndarray_dimension( x, 0 ), (const double *)stdlib_ndarray_data( x ), (const CBLAS_INT)stdlib_ndarray_stride_elements( x, 0 ), (const CBLAS_INT)stdlib_ndarray_offset_elements( x ), (const uint8_t *)stdlib_ndarray_data( mask ), (const CBLAS_INT)stdlib_ndarray_stride_elements( mask, 0 ), (const CBLAS_INT)stdlib_ndarray_offset_elements( mask ) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves a part of #14034
Description
This pull request:
dmskmax).test.js,test.main.js,test.native.js) and benchmarks to cover and utilize the new native C addon.Related Issues
This pull request has the following related issues:
@stdlib/stats/base/ndarraypackages (tracking issue) #14034Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
I consulted an AI assistant to help research the
stdlibN-API architecture, understand thendarraymasking logic, and to structure and generate the test files (test.main.js,test.native.js) and benchmark files required to test the native C addon. The core logic and implementation were authored manually by myself.@stdlib-js/reviewers