-
-
Notifications
You must be signed in to change notification settings - Fork 843
feat: add C implementation for blas/base/dsyr
#6566
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
+3,523
−57
Merged
Changes from all commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
9651a1a
feat: add c implementation for blas/base/dsyr
ShabiShett07 c10bded
feat: add c implementation for blas/base/dsyr
ShabiShett07 c6e3f16
fix: file permissions
ShabiShett07 ac5310c
remove: floating point
ShabiShett07 9c4b307
chore: update implementation
ShabiShett07 ce571b1
chore: minor changes
ShabiShett07 635d2af
chore: change datatypes
ShabiShett07 e5ef119
chore: update implementation
ShabiShett07 a66e7ab
chore: update jsdoc
ShabiShett07 a92e9d0
chore: update datatypes
ShabiShett07 5226edb
chore: add indentation
ShabiShett07 f93b8a7
chore: update implementation
ShabiShett07 149b5d9
chore: update implementation
ShabiShett07 d0b30b1
chore: minor clean-up
ShabiShett07 aef4a1d
remove: whitespace
ShabiShett07 291cee5
chore: clean-up
ShabiShett07 51b7a4b
chore: minor clean-up
ShabiShett07 aecaa92
chore: minor clean-up
ShabiShett07 add2333
c
ShabiShett07 6c831d5
chore: minor clean-up
ShabiShett07 81acffa
chore: minor clean-up
ShabiShett07 93409ab
chore: minor clean-up
ShabiShett07 15f4a28
chore: minor clean-up
ShabiShett07 893a336
chore: minor clean-up
ShabiShett07 1e78d95
chore: minor clean-up\
ShabiShett07 f3bbcea
chore: minor clean-up
ShabiShett07 8d5d2e7
chore: add checks
ShabiShett07 3c6f996
chore: clean-up
ShabiShett07 e1ddd8a
chore: clean-up
ShabiShett07 09b7e71
Merge branch 'develop' into feature/dsyr
ShabiShett07 6534b3f
chore: minor clean-up
ShabiShett07 3df6b71
chore: minor clean-up
ShabiShett07 b179a4f
chore: minor clean-up
ShabiShett07 8d3d1b6
chore: minor clean-up
ShabiShett07 1f027ac
chore: minor clean-up
ShabiShett07 4f4f057
chore: add suggestions
ShabiShett07 cd4c878
chore: add suggestions
ShabiShett07 d871fbd
chore: update jsdoc
ShabiShett07 9edb8f3
Apply suggestions from code review
kgryte 1e76bd7
docs: update comment
kgryte 2ebc225
docs: update comment
kgryte 5a20e0f
docs: update comment
kgryte 520a1fb
docs: update comments
kgryte b371c63
docs: update comment
kgryte dfd8998
Apply suggestions from code review
kgryte 6ef0e5d
docs: fix alignment
kgryte 3a09ffe
docs: update description
kgryte c18fde2
docs: update description
kgryte 33e7723
docs: update comment
kgryte File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
109 changes: 109 additions & 0 deletions
109
lib/node_modules/@stdlib/blas/base/dsyr/benchmark/benchmark.native.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
/** | ||
* @license Apache-2.0 | ||
* | ||
* Copyright (c) 2025 The Stdlib Authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
// MODULES // | ||
|
||
var resolve = require( 'path' ).resolve; | ||
var bench = require( '@stdlib/bench' ); | ||
var isnan = require( '@stdlib/math/base/assert/is-nan' ); | ||
var ones = require( '@stdlib/array/ones' ); | ||
var pow = require( '@stdlib/math/base/special/pow' ); | ||
var floor = require( '@stdlib/math/base/special/floor' ); | ||
var tryRequire = require( '@stdlib/utils/try-require' ); | ||
var pkg = require( './../package.json' ).name; | ||
|
||
|
||
// VARIABLES // | ||
|
||
var dsyr = tryRequire( resolve( __dirname, './../lib/dsyr.native.js' ) ); | ||
var opts = { | ||
'skip': ( dsyr instanceof Error ) | ||
}; | ||
var options = { | ||
'dtype': 'float64' | ||
}; | ||
|
||
|
||
// FUNCTIONS // | ||
|
||
/** | ||
* Creates a benchmark function. | ||
* | ||
* @private | ||
* @param {PositiveInteger} N - number of elements along each dimension | ||
* @returns {Function} benchmark function | ||
*/ | ||
function createBenchmark( N ) { | ||
var x = ones( N, options.dtype ); | ||
var A = ones( N*N, options.dtype ); | ||
return benchmark; | ||
|
||
/** | ||
* Benchmark function. | ||
* | ||
* @private | ||
* @param {Benchmark} b - benchmark instance | ||
*/ | ||
function benchmark( b ) { | ||
var z; | ||
var i; | ||
|
||
b.tic(); | ||
for ( i = 0; i < b.iterations; i++ ) { | ||
z = dsyr( 'row-major', 'upper', N, 1.0, x, 1, A, N ); | ||
if ( isnan( z[ i%z.length ] ) ) { | ||
b.fail( 'should not return NaN' ); | ||
} | ||
} | ||
b.toc(); | ||
if ( isnan( z[ i%z.length ] ) ) { | ||
b.fail( 'should not return NaN' ); | ||
} | ||
b.pass( 'benchmark finished' ); | ||
b.end(); | ||
} | ||
} | ||
|
||
|
||
// MAIN // | ||
|
||
/** | ||
* Main execution sequence. | ||
* | ||
* @private | ||
*/ | ||
function main() { | ||
var min; | ||
var max; | ||
var N; | ||
var f; | ||
var i; | ||
|
||
min = 1; // 10^min | ||
max = 6; // 10^max | ||
|
||
for ( i = min; i <= max; i++ ) { | ||
N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); | ||
f = createBenchmark( N ); | ||
bench( pkg+'::native:size='+(N*N), opts, f ); | ||
} | ||
} | ||
|
||
main(); |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.