From c9a4971dbb9c68dbce86a76b5a8430adcc858925 Mon Sep 17 00:00:00 2001 From: utkarsh_raj <49344502+rajutkarsh07@users.noreply.github.com> Date: Fri, 22 Mar 2024 16:46:41 +0000 Subject: [PATCH 01/17] refactor blas/ext/base/dasumpw --- .../@stdlib/blas/ext/base/dasumpw/README.md | 29 +++++-------------- .../ext/base/dasumpw/benchmark/benchmark.js | 20 ++++++------- .../dasumpw/benchmark/benchmark.native.js | 15 ++++------ .../dasumpw/benchmark/benchmark.ndarray.js | 19 ++++++------ .../benchmark/benchmark.ndarray.native.js | 15 ++++------ .../blas/ext/base/dasumpw/docs/repl.txt | 18 +++++------- .../blas/ext/base/dasumpw/examples/index.js | 15 +++------- .../blas/ext/base/dasumpw/include.gypi | 2 +- .../blas/ext/base/dasumpw/lib/index.js | 6 ++-- .../blas/ext/base/dasumpw/lib/ndarray.js | 6 ++-- .../ext/base/dasumpw/lib/ndarray.native.js | 15 ++++------ .../blas/ext/base/dasumpw/manifest.json | 7 ++++- .../base/dasumpw/src/{addon.cpp => addon.c} | 0 .../ext/base/dasumpw/test/test.dasumpw.js | 18 ++++++------ .../base/dasumpw/test/test.dasumpw.native.js | 11 ++++--- .../ext/base/dasumpw/test/test.ndarray.js | 11 ++++--- .../base/dasumpw/test/test.ndarray.native.js | 11 ++++--- 17 files changed, 89 insertions(+), 129 deletions(-) rename lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/{addon.cpp => addon.c} (100%) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/README.md index 505ba34be09c..b0b72520765d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/README.md @@ -2,7 +2,7 @@ @license Apache-2.0 -Copyright (c) 2020 The Stdlib Authors. +Copyright (c) 2024 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. @@ -71,16 +71,14 @@ The function has the following parameters: - **x**: input [`Float64Array`][@stdlib/array/float64]. - **stride**: index increment for `x`. -The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the sum of absolute values of every other element in `x`, +The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to compute the sum of absolute values of every other element in `x`, ```javascript var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); -var v = dasumpw( N, x, 2 ); +var v = dasumpw( 4, x, 2 ); // returns 9.0 ``` @@ -90,14 +88,12 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); -var v = dasumpw( N, x1, 2 ); +var v = dasumpw( 4, x1, 2 ); // returns 9.0 ``` @@ -123,12 +119,10 @@ While [`typed array`][mdn-typed-array] views mandate a view offset based on the ```javascript var Float64Array = require( '@stdlib/array/float64' ); -var floor = require( '@stdlib/math/base/special/floor' ); var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); -var v = dasumpw.ndarray( N, x, 2, 1 ); +var v = dasumpw.ndarray( 4, x, 2, 1 ); // returns 9.0 ``` @@ -154,18 +148,11 @@ var v = dasumpw.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); +var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +var filledarrayBy = require( '@stdlib/array/filled-by' ); var dasumpw = require( '@stdlib/blas/ext/base/dasumpw' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { - x[ i ] = round( randu()*100.0 ); -} +var x = filledarrayBy(10, 'float64', discreteUniform(0, 100)); console.log( x ); var v = dasumpw( x.length, x, 1 ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.js index af5e0780e4eb..028ea29a5e30 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2020 The Stdlib Authors. +* Copyright (c) 2024 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. @@ -21,14 +21,20 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/base/uniform' ).factory; +var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); -var Float64Array = require( '@stdlib/array/float64' ); var pkg = require( './../package.json' ).name; var dasumpw = require( './../lib/dasumpw.js' ); +// VARIABLES // + +var rand = uniform( -100.0, 100.0 ); + + + // FUNCTIONS // /** @@ -39,13 +45,7 @@ var dasumpw = require( './../lib/dasumpw.js' ); * @returns {Function} benchmark function */ function createBenchmark( len ) { - var x; - var i; - - x = new Float64Array( len ); - for ( i = 0; i < x.length; i++ ) { - x[ i ] = ( randu()*20.0 ) - 10.0; - } + var x = filledarrayBy( len, 'float64', rand ); return benchmark; function benchmark( b ) { diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.native.js index fc9e4c753405..8d1f192b7ced 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2020 The Stdlib Authors. +* Copyright (c) 2024 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. @@ -22,10 +22,10 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/base/uniform' ).factory; +var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); -var Float64Array = require( '@stdlib/array/float64' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -36,6 +36,7 @@ var dasumpw = tryRequire( resolve( __dirname, './../lib/dasumpw.native.js' ) ); var opts = { 'skip': ( dasumpw instanceof Error ) }; +var rand = uniform( -100.0, 100.0 ); // FUNCTIONS // @@ -48,13 +49,7 @@ var opts = { * @returns {Function} benchmark function */ function createBenchmark( len ) { - var x; - var i; - - x = new Float64Array( len ); - for ( i = 0; i < x.length; i++ ) { - x[ i ] = ( randu()*20.0 ) - 10.0; - } + var x = filledarrayBy( len, 'float64', rand ); return benchmark; function benchmark( b ) { diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.ndarray.js index 27ad79439608..e7dd3573da17 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.ndarray.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2020 The Stdlib Authors. +* Copyright (c) 2024 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. @@ -21,14 +21,19 @@ // MODULES // var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/base/uniform' ).factory; +var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); -var Float64Array = require( '@stdlib/array/float64' ); var pkg = require( './../package.json' ).name; var dasumpw = require( './../lib/ndarray.js' ); +// VARIABLES // + +var rand = uniform( -100.0, 100.0 ); + + // FUNCTIONS // /** @@ -39,13 +44,7 @@ var dasumpw = require( './../lib/ndarray.js' ); * @returns {Function} benchmark function */ function createBenchmark( len ) { - var x; - var i; - - x = new Float64Array( len ); - for ( i = 0; i < x.length; i++ ) { - x[ i ] = ( randu()*20.0 ) - 10.0; - } + var x = filledarrayBy( len, 'float64', rand ); return benchmark; function benchmark( b ) { diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.ndarray.native.js index 638754aa8ed1..e7152ae3d1cd 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2020 The Stdlib Authors. +* Copyright (c) 2024 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. @@ -22,10 +22,10 @@ var resolve = require( 'path' ).resolve; var bench = require( '@stdlib/bench' ); -var randu = require( '@stdlib/random/base/randu' ); +var uniform = require( '@stdlib/random/base/uniform' ).factory; +var filledarrayBy = require( '@stdlib/array/filled-by' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var pow = require( '@stdlib/math/base/special/pow' ); -var Float64Array = require( '@stdlib/array/float64' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -36,6 +36,7 @@ var dasumpw = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); var opts = { 'skip': ( dasumpw instanceof Error ) }; +var rand = uniform( -100.0, 100.0 ); // FUNCTIONS // @@ -48,13 +49,7 @@ var opts = { * @returns {Function} benchmark function */ function createBenchmark( len ) { - var x; - var i; - - x = new Float64Array( len ); - for ( i = 0; i < x.length; i++ ) { - x[ i ] = ( randu()*20.0 ) - 10.0; - } + var x = filledarrayBy( len, 'float64', rand ); return benchmark; function benchmark( b ) { diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/docs/repl.txt index e9dac9703ee3..5c8614bde09c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/docs/repl.txt @@ -3,8 +3,8 @@ Computes the sum of absolute values (L1 norm) of double-precision floating- point strided array elements using pairwise summation. - The `N` and `stride` parameters determine which elements in `x` are accessed - at runtime. + The `N` and `stride` parameters determine which elements in the strided + array are accessed at runtime. Indexing is relative to the first index. To introduce an offset, use a typed array view. @@ -36,19 +36,16 @@ // Using `N` and `stride` parameters: > x = new {{alias:@stdlib/array/float64}}( [ -2.0, 1.0, 1.0, -5.0, 2.0, -1.0 ] ); - > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 ); - > var stride = 2; - > {{alias}}( N, x, stride ) + > {{alias}}( 3, x, stride ) 5.0 // Using view offsets: > var x0 = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0 ] ); > var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); - > N = {{alias:@stdlib/math/base/special/floor}}( x0.length / 2 ); - > stride = 2; - > {{alias}}( N, x1, stride ) + > {{alias}}( 3, x1, stride ) 5.0 + {{alias}}.ndarray( N, x, stride, offset ) Computes the sum of absolute values (L1 norm) of double-precision floating- point strided array elements using pairwise summation and alternative @@ -85,9 +82,8 @@ 5.0 // Using offset parameter: - > var x = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0 ] ); - > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 ); - > {{alias}}.ndarray( N, x, 2, 1 ) + > x = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0 ] ); + > {{alias}}.ndarray( 3, x, 2, 1 ) 5.0 See Also diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/examples/index.js index 55576b9d1af9..f5dd30a8c37d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/examples/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/examples/index.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2020 The Stdlib Authors. +* Copyright (c) 2024 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. @@ -18,18 +18,11 @@ 'use strict'; -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float64Array = require( '@stdlib/array/float64' ); +var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +var filledarrayBy = require( '@stdlib/array/filled-by' ); var dasumpw = require( './../lib' ); -var x; -var i; - -x = new Float64Array( 10 ); -for ( i = 0; i < x.length; i++ ) { - x[ i ] = round( randu()*100.0 ); -} +var x = filledarrayBy( 10, 'float64', discreteUniform( -100.0, 100.0 ) ); console.log( x ); var v = dasumpw( x.length, x, 1 ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/include.gypi b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/include.gypi index 868c5c12e852..26476a8c2655 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/include.gypi +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/include.gypi @@ -36,7 +36,7 @@ # Source files: 'src_files': [ - '<(src_dir)/addon.cpp', + '<(src_dir)/addon.c', ' Date: Fri, 22 Mar 2024 17:14:31 +0000 Subject: [PATCH 02/17] refactoring changes --- lib/node_modules/@stdlib/blas/ext/base/dasumpw/README.md | 1 - .../@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.js | 1 - .../@stdlib/blas/ext/base/dasumpw/test/test.dasumpw.js | 3 +-- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/README.md index b0b72520765d..73b5a60efd45 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/README.md @@ -92,7 +92,6 @@ var Float64Array = require( '@stdlib/array/float64' ); var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element - var v = dasumpw( 4, x1, 2 ); // returns 9.0 ``` diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.js index 028ea29a5e30..0316fdbdf674 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.js @@ -34,7 +34,6 @@ var dasumpw = require( './../lib/dasumpw.js' ); var rand = uniform( -100.0, 100.0 ); - // FUNCTIONS // /** diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/test/test.dasumpw.js b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/test/test.dasumpw.js index 4e3fab5191c4..5992ab40a302 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/test/test.dasumpw.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/test/test.dasumpw.js @@ -21,7 +21,6 @@ // MODULES // var tape = require( 'tape' ); -var floor = require( '@stdlib/math/base/special/floor' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var Float64Array = require( '@stdlib/array/float64' ); var dasumpw = require( './../lib/dasumpw.js' ); @@ -126,10 +125,10 @@ tape( 'the function supports a `stride` parameter', function test( t ) { }); tape( 'the function supports a negative `stride` parameter', function test( t ) { + var N; var x; var v; var i; - var N; x = new Float64Array([ 1.0, // 3 From c7675986ffd099ff2aa44b00e5d625c999f41b30 Mon Sep 17 00:00:00 2001 From: utkarsh_raj <49344502+rajutkarsh07@users.noreply.github.com> Date: Fri, 22 Mar 2024 17:35:26 +0000 Subject: [PATCH 03/17] refactoring changes --- .../@stdlib/blas/ext/base/dasumpw/test/test.dasumpw.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/test/test.dasumpw.js b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/test/test.dasumpw.js index 5992ab40a302..e38aaaa2503b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/test/test.dasumpw.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/test/test.dasumpw.js @@ -129,7 +129,7 @@ tape( 'the function supports a negative `stride` parameter', function test( t ) var x; var v; var i; - + x = new Float64Array([ 1.0, // 3 2.0, From 0883022cb0b80ca74e130b141849ee8f6be19ecd Mon Sep 17 00:00:00 2001 From: utkarsh_raj <49344502+rajutkarsh07@users.noreply.github.com> Date: Fri, 22 Mar 2024 18:21:09 +0000 Subject: [PATCH 04/17] refactoring changes --- .../blas/ext/base/dasumpw/manifest.json | 86 ++++++------- .../@stdlib/blas/ext/base/dasumpw/src/addon.c | 117 ------------------ 2 files changed, 43 insertions(+), 160 deletions(-) delete mode 100644 lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/manifest.json index 9446b5da488b..cc56386a9d11 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/manifest.json +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/manifest.json @@ -1,45 +1,45 @@ { - "options": {}, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "src": [ - "./src/dasumpw.c" - ], - "include": [ - "./include" - ], - "libraries": [ - "-lm" - ], - "libpath": [], - "dependencies": [ - "stdlib/napi/export.h", - "stdlib/napi/argv.h", - "stdlib/napi/argv_int64.h", - "stdlib/napi/argv_strided_float64array.h" - ] - } - ] + "options": {}, + "fields": [ + { + "field": "src", + "resolve": true, + "relative": true + }, + { + "field": "include", + "resolve": true, + "relative": true + }, + { + "field": "libraries", + "resolve": false, + "relative": false + }, + { + "field": "libpath", + "resolve": true, + "relative": false + } + ], + "confs": [ + { + "src": [ + "./src/dsumkbn2.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lm" + ], + "libpath": [], + "dependencies": [ + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-strided-float64array" + ] + } + ] } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c deleted file mode 100644 index feba4280caa2..000000000000 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c +++ /dev/null @@ -1,117 +0,0 @@ -/** -* @license Apache-2.0 -* -* Copyright (c) 2020 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. -*/ - -#include "stdlib/blas/ext/base/dasumpw.h" -#include -#include -#include -#include -#include - -/** -* Add-on namespace. -*/ -namespace stdlib_blas_ext_base_dasumpw { - - /** - * Computes the sum of absolute values (L1 norm) of double-precision floating-point strided array elements using pairwise summation. - * - * ## Notes - * - * - When called from JavaScript, the function expects three arguments: - * - * - `N`: number of indexed elements - * - `X`: input array - * - `stride`: stride length - */ - napi_value node_dasumpw( napi_env env, napi_callback_info info ) { - napi_status status; - - size_t argc = 3; - napi_value argv[ 3 ]; - status = napi_get_cb_info( env, info, &argc, argv, nullptr, nullptr ); - assert( status == napi_ok ); - - if ( argc < 3 ) { - napi_throw_error( env, nullptr, "invalid invocation. Must provide 3 arguments." ); - return nullptr; - } - - napi_valuetype vtype0; - status = napi_typeof( env, argv[ 0 ], &vtype0 ); - assert( status == napi_ok ); - if ( vtype0 != napi_number ) { - napi_throw_type_error( env, nullptr, "invalid argument. First argument must be a number." ); - return nullptr; - } - - bool res; - status = napi_is_typedarray( env, argv[ 1 ], &res ); - assert( status == napi_ok ); - if ( res == false ) { - napi_throw_type_error( env, nullptr, "invalid argument. Second argument must be a Float64Array." ); - return nullptr; - } - - napi_valuetype vtype2; - status = napi_typeof( env, argv[ 2 ], &vtype2 ); - assert( status == napi_ok ); - if ( vtype2 != napi_number ) { - napi_throw_type_error( env, nullptr, "invalid argument. Third argument must be a number." ); - return nullptr; - } - - int64_t N; - status = napi_get_value_int64( env, argv[ 0 ], &N ); - assert( status == napi_ok ); - - int64_t stride; - status = napi_get_value_int64( env, argv[ 2 ], &stride ); - assert( status == napi_ok ); - - napi_typedarray_type vtype1; - size_t xlen; - void *X; - status = napi_get_typedarray_info( env, argv[ 1 ], &vtype1, &xlen, &X, nullptr, nullptr ); - assert( status == napi_ok ); - if ( vtype1 != napi_float64_array ) { - napi_throw_type_error( env, nullptr, "invalid argument. Second argument must be a Float64Array." ); - return nullptr; - } - if ( (N-1)*llabs(stride) >= (int64_t)xlen ) { - napi_throw_range_error( env, nullptr, "invalid argument. Second argument has insufficient elements based on the associated stride and the number of indexed elements." ); - return nullptr; - } - - napi_value v; - status = napi_create_double( env, stdlib_strided_dasumpw( N, (double *)X, stride ), &v ); - assert( status == napi_ok ); - - return v; - } - - napi_value Init( napi_env env, napi_value exports ) { - napi_status status; - napi_value fcn; - status = napi_create_function( env, "exports", NAPI_AUTO_LENGTH, node_dasumpw, NULL, &fcn ); - assert( status == napi_ok ); - return fcn; - } - - NAPI_MODULE( NODE_GYP_MODULE_NAME, Init ) -} // end namespace stdlib_blas_ext_base_dasumpw From 9a1a43e67a2ecd6d0ec515319e178e739b503d55 Mon Sep 17 00:00:00 2001 From: utkarsh_raj <49344502+rajutkarsh07@users.noreply.github.com> Date: Fri, 22 Mar 2024 18:22:17 +0000 Subject: [PATCH 05/17] added addon.c file --- .../@stdlib/blas/ext/base/dasumpw/src/addon.c | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c new file mode 100644 index 000000000000..e0272f5dea06 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c @@ -0,0 +1,48 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +#include "stdlib/blas/ext/base/ssumpw.h" +#include "stdlib/napi/export.h" +#include "stdlib/napi/argv.h" +#include "stdlib/napi/argv_int64.h" +#include "stdlib/napi/argv_strided_float32array.h" +#include +#include + +/** +* Receives JavaScript callback invocation data. +* +* @private +* @param env environment under which the function is invoked +* @param info callback data +* @return Node-API value +*/ +static napi_value addon( napi_env env, napi_callback_info info ) { + STDLIB_NAPI_ARGV( env, info, argv, argc, 3 ); + STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 ); + STDLIB_NAPI_ARGV_INT64( env, stride, argv, 2 ); + STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, stride, argv, 1 ); + + napi_value v; + napi_status status = napi_create_double( env, (double)stdlib_strided_ssumpw( N, (float *)X, stride ), &v ); + assert( status == napi_ok ); + + return v; +} + +STDLIB_NAPI_MODULE_EXPORT_FCN( addon ) \ No newline at end of file From 5f46e6a7d9bf8373621bf7f37b4fdacda5a5df1e Mon Sep 17 00:00:00 2001 From: utkarsh_raj <49344502+rajutkarsh07@users.noreply.github.com> Date: Fri, 22 Mar 2024 18:28:32 +0000 Subject: [PATCH 06/17] refactoring addon.c --- lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c index e0272f5dea06..2162ae2d4716 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c @@ -16,7 +16,7 @@ * limitations under the License. */ -#include "stdlib/blas/ext/base/ssumpw.h" +#include "stdlib/blas/ext/base/dasumpw.h" #include "stdlib/napi/export.h" #include "stdlib/napi/argv.h" #include "stdlib/napi/argv_int64.h" From 0ccfca97bd1f9468c581f1e4d462b7343cf7c01b Mon Sep 17 00:00:00 2001 From: utkarsh_raj <49344502+rajutkarsh07@users.noreply.github.com> Date: Fri, 22 Mar 2024 18:30:57 +0000 Subject: [PATCH 07/17] refactor addon.c --- lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c index 2162ae2d4716..137875ecc4c8 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c @@ -20,7 +20,7 @@ #include "stdlib/napi/export.h" #include "stdlib/napi/argv.h" #include "stdlib/napi/argv_int64.h" -#include "stdlib/napi/argv_strided_float32array.h" +#include "stdlib/napi/argv_strided_float64array.h" #include #include From 73328c008fd53a68b5b9f01b3a023ec5bce5bcd6 Mon Sep 17 00:00:00 2001 From: utkarsh_raj <49344502+rajutkarsh07@users.noreply.github.com> Date: Fri, 22 Mar 2024 18:36:29 +0000 Subject: [PATCH 08/17] refactor addon.c --- .../@stdlib/blas/ext/base/dasumpw/src/addon.c | 113 ++++++++++++++---- 1 file changed, 91 insertions(+), 22 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c index 137875ecc4c8..8351a9cba259 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2020 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. @@ -17,32 +17,101 @@ */ #include "stdlib/blas/ext/base/dasumpw.h" -#include "stdlib/napi/export.h" -#include "stdlib/napi/argv.h" -#include "stdlib/napi/argv_int64.h" -#include "stdlib/napi/argv_strided_float64array.h" #include +#include +#include +#include #include /** -* Receives JavaScript callback invocation data. -* -* @private -* @param env environment under which the function is invoked -* @param info callback data -* @return Node-API value +* Add-on namespace. */ -static napi_value addon( napi_env env, napi_callback_info info ) { - STDLIB_NAPI_ARGV( env, info, argv, argc, 3 ); - STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 ); - STDLIB_NAPI_ARGV_INT64( env, stride, argv, 2 ); - STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, stride, argv, 1 ); +namespace stdlib_blas_ext_base_dasumpw { + + /** + * Computes the sum of absolute values (L1 norm) of double-precision floating-point strided array elements using pairwise summation. + * + * ## Notes + * + * - When called from JavaScript, the function expects three arguments: + * + * - `N`: number of indexed elements + * - `X`: input array + * - `stride`: stride length + */ + napi_value node_dasumpw( napi_env env, napi_callback_info info ) { + napi_status status; + + size_t argc = 3; + napi_value argv[ 3 ]; + status = napi_get_cb_info( env, info, &argc, argv, nullptr, nullptr ); + assert( status == napi_ok ); + + if ( argc < 3 ) { + napi_throw_error( env, nullptr, "invalid invocation. Must provide 3 arguments." ); + return nullptr; + } + + napi_valuetype vtype0; + status = napi_typeof( env, argv[ 0 ], &vtype0 ); + assert( status == napi_ok ); + if ( vtype0 != napi_number ) { + napi_throw_type_error( env, nullptr, "invalid argument. First argument must be a number." ); + return nullptr; + } + + bool res; + status = napi_is_typedarray( env, argv[ 1 ], &res ); + assert( status == napi_ok ); + if ( res == false ) { + napi_throw_type_error( env, nullptr, "invalid argument. Second argument must be a Float64Array." ); + return nullptr; + } + + napi_valuetype vtype2; + status = napi_typeof( env, argv[ 2 ], &vtype2 ); + assert( status == napi_ok ); + if ( vtype2 != napi_number ) { + napi_throw_type_error( env, nullptr, "invalid argument. Third argument must be a number." ); + return nullptr; + } + + int64_t N; + status = napi_get_value_int64( env, argv[ 0 ], &N ); + assert( status == napi_ok ); + + int64_t stride; + status = napi_get_value_int64( env, argv[ 2 ], &stride ); + assert( status == napi_ok ); + + napi_typedarray_type vtype1; + size_t xlen; + void *X; + status = napi_get_typedarray_info( env, argv[ 1 ], &vtype1, &xlen, &X, nullptr, nullptr ); + assert( status == napi_ok ); + if ( vtype1 != napi_float64_array ) { + napi_throw_type_error( env, nullptr, "invalid argument. Second argument must be a Float64Array." ); + return nullptr; + } + if ( (N-1)*llabs(stride) >= (int64_t)xlen ) { + napi_throw_range_error( env, nullptr, "invalid argument. Second argument has insufficient elements based on the associated stride and the number of indexed elements." ); + return nullptr; + } + + napi_value v; + status = napi_create_double( env, stdlib_strided_dasumpw( N, (double *)X, stride ), &v ); + assert( status == napi_ok ); - napi_value v; - napi_status status = napi_create_double( env, (double)stdlib_strided_ssumpw( N, (float *)X, stride ), &v ); - assert( status == napi_ok ); + return v; + } - return v; -} + napi_value Init( napi_env env, napi_value exports ) { + napi_status status; + napi_value fcn; + status = napi_create_function( env, "exports", NAPI_AUTO_LENGTH, node_dasumpw, NULL, &fcn ); + assert( status == napi_ok ); + return fcn; + } -STDLIB_NAPI_MODULE_EXPORT_FCN( addon ) \ No newline at end of file + NAPI_MODULE( NODE_GYP_MODULE_NAME, Init ) +} // end namespace stdlib_blas_ext_base_dasumpw \ No newline at end of file From d2eb8d8510bdbd74eb916e31053d9ee9d8cc4725 Mon Sep 17 00:00:00 2001 From: utkarsh_raj <49344502+rajutkarsh07@users.noreply.github.com> Date: Fri, 22 Mar 2024 18:48:48 +0000 Subject: [PATCH 09/17] changed addon.c --- .../@stdlib/blas/ext/base/dasumpw/src/addon.c | 156 +++++++++--------- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c index 8351a9cba259..c549fed9ad0f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c @@ -24,94 +24,94 @@ #include /** -* Add-on namespace. +* Computes the sum of absolute values (L1 norm) of double-precision floating-point strided array elements using pairwise summation. +* +* ## Notes +* +* - When called from JavaScript, the function expects three arguments: +* +* - `N`: number of indexed elements +* - `X`: input array +* - `stride`: stride length */ -namespace stdlib_blas_ext_base_dasumpw { - - /** - * Computes the sum of absolute values (L1 norm) of double-precision floating-point strided array elements using pairwise summation. - * - * ## Notes - * - * - When called from JavaScript, the function expects three arguments: - * - * - `N`: number of indexed elements - * - `X`: input array - * - `stride`: stride length - */ - napi_value node_dasumpw( napi_env env, napi_callback_info info ) { - napi_status status; +napi_value node_dasumpw( napi_env env, napi_callback_info info ) { + napi_status status; - size_t argc = 3; - napi_value argv[ 3 ]; - status = napi_get_cb_info( env, info, &argc, argv, nullptr, nullptr ); - assert( status == napi_ok ); + size_t argc = 3; + napi_value argv[ 3 ]; + status = napi_get_cb_info( env, info, &argc, argv, NULL, NULL ); + assert( status == napi_ok ); - if ( argc < 3 ) { - napi_throw_error( env, nullptr, "invalid invocation. Must provide 3 arguments." ); - return nullptr; - } + if ( argc < 3 ) { + napi_throw_error( env, NULL, "invalid invocation. Must provide 3 arguments." ); + return NULL; + } - napi_valuetype vtype0; - status = napi_typeof( env, argv[ 0 ], &vtype0 ); - assert( status == napi_ok ); - if ( vtype0 != napi_number ) { - napi_throw_type_error( env, nullptr, "invalid argument. First argument must be a number." ); - return nullptr; - } + napi_valuetype vtype0; + status = napi_typeof( env, argv[ 0 ], &vtype0 ); + assert( status == napi_ok ); + if ( vtype0 != napi_number ) { + napi_throw_type_error( env, NULL, "invalid argument. First argument must be a number." ); + return NULL; + } - bool res; - status = napi_is_typedarray( env, argv[ 1 ], &res ); - assert( status == napi_ok ); - if ( res == false ) { - napi_throw_type_error( env, nullptr, "invalid argument. Second argument must be a Float64Array." ); - return nullptr; - } + bool res; + status = napi_is_typedarray( env, argv[ 1 ], &res ); + assert( status == napi_ok ); + if ( res == false ) { + napi_throw_type_error( env, NULL, "invalid argument. Second argument must be a Float64Array." ); + return NULL; + } - napi_valuetype vtype2; - status = napi_typeof( env, argv[ 2 ], &vtype2 ); - assert( status == napi_ok ); - if ( vtype2 != napi_number ) { - napi_throw_type_error( env, nullptr, "invalid argument. Third argument must be a number." ); - return nullptr; - } + napi_valuetype vtype2; + status = napi_typeof( env, argv[ 2 ], &vtype2 ); + assert( status == napi_ok ); + if ( vtype2 != napi_number ) { + napi_throw_type_error( env, NULL, "invalid argument. Third argument must be a number." ); + return NULL; + } - int64_t N; - status = napi_get_value_int64( env, argv[ 0 ], &N ); - assert( status == napi_ok ); + int64_t N; + status = napi_get_value_int64( env, argv[ 0 ], &N ); + assert( status == napi_ok ); - int64_t stride; - status = napi_get_value_int64( env, argv[ 2 ], &stride ); - assert( status == napi_ok ); + int64_t stride; + status = napi_get_value_int64( env, argv[ 2 ], &stride ); + assert( status == napi_ok ); - napi_typedarray_type vtype1; - size_t xlen; - void *X; - status = napi_get_typedarray_info( env, argv[ 1 ], &vtype1, &xlen, &X, nullptr, nullptr ); - assert( status == napi_ok ); - if ( vtype1 != napi_float64_array ) { - napi_throw_type_error( env, nullptr, "invalid argument. Second argument must be a Float64Array." ); - return nullptr; - } - if ( (N-1)*llabs(stride) >= (int64_t)xlen ) { - napi_throw_range_error( env, nullptr, "invalid argument. Second argument has insufficient elements based on the associated stride and the number of indexed elements." ); - return nullptr; - } + napi_typedarray_type vtype1; + size_t xlen; + void *X; + status = napi_get_typedarray_info( env, argv[ 1 ], &vtype1, &xlen, &X, NULL, NULL ); + assert( status == napi_ok ); + if ( vtype1 != napi_float64_array ) { + napi_throw_type_error( env, NULL, "invalid argument. Second argument must be a Float64Array." ); + return NULL; + } + if ( (N-1)*llabs(stride) >= (int64_t)xlen ) { + napi_throw_range_error( env, NULL, "invalid argument. Second argument has insufficient elements based on the associated stride and the number of indexed elements." ); + return NULL; + } - napi_value v; - status = napi_create_double( env, stdlib_strided_dasumpw( N, (double *)X, stride ), &v ); - assert( status == napi_ok ); + napi_value v; + status = napi_create_double( env, stdlib_strided_dasumpw( N, (double *)X, stride ), &v ); + assert( status == napi_ok ); - return v; - } + return v; +} - napi_value Init( napi_env env, napi_value exports ) { - napi_status status; - napi_value fcn; - status = napi_create_function( env, "exports", NAPI_AUTO_LENGTH, node_dasumpw, NULL, &fcn ); - assert( status == napi_ok ); - return fcn; - } +/** +* Initialize the add-on. +*/ +napi_value Init( napi_env env, napi_value exports ) { + napi_status status; + napi_value fcn; + status = napi_create_function( env, NULL, NAPI_AUTO_LENGTH, node_dasumpw, NULL, &fcn ); + assert( status == napi_ok ); + return fcn; +} - NAPI_MODULE( NODE_GYP_MODULE_NAME, Init ) -} // end namespace stdlib_blas_ext_base_dasumpw \ No newline at end of file +/** +* Export the add-on. +*/ +NAPI_MODULE( NODE_GYP_MODULE_NAME, Init ) From 12fb2e9a6d9d7eae031d8326cab234a00d39ce40 Mon Sep 17 00:00:00 2001 From: utkarsh_raj <49344502+rajutkarsh07@users.noreply.github.com> Date: Sat, 23 Mar 2024 01:14:34 +0530 Subject: [PATCH 10/17] Update repl.txt Signed-off-by: utkarsh_raj <49344502+rajutkarsh07@users.noreply.github.com> --- .../blas/ext/base/dasumpw/docs/repl.txt | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/docs/repl.txt index 5c8614bde09c..a74de0eb18d2 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/docs/repl.txt @@ -3,8 +3,8 @@ Computes the sum of absolute values (L1 norm) of double-precision floating- point strided array elements using pairwise summation. - The `N` and `stride` parameters determine which elements in the strided - array are accessed at runtime. + The `N` and `stride` parameters determine which elements in `x` are accessed + at runtime. Indexing is relative to the first index. To introduce an offset, use a typed array view. @@ -36,16 +36,19 @@ // Using `N` and `stride` parameters: > x = new {{alias:@stdlib/array/float64}}( [ -2.0, 1.0, 1.0, -5.0, 2.0, -1.0 ] ); - > {{alias}}( 3, x, stride ) + > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 ); + > var stride = 2; + > {{alias}}( N, x, stride ) 5.0 // Using view offsets: > var x0 = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0 ] ); > var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); - > {{alias}}( 3, x1, stride ) + > N = {{alias:@stdlib/math/base/special/floor}}( x0.length / 2 ); + > stride = 2; + > {{alias}}( N, x1, stride ) 5.0 - {{alias}}.ndarray( N, x, stride, offset ) Computes the sum of absolute values (L1 norm) of double-precision floating- point strided array elements using pairwise summation and alternative @@ -82,10 +85,10 @@ 5.0 // Using offset parameter: - > x = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0 ] ); - > {{alias}}.ndarray( 3, x, 2, 1 ) + > var x = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0 ] ); + > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 ); + > {{alias}}.ndarray( N, x, 2, 1 ) 5.0 See Also -------- - From 137589538f00cac3bf1829c9fc14d778c6487627 Mon Sep 17 00:00:00 2001 From: utkarsh_raj <49344502+rajutkarsh07@users.noreply.github.com> Date: Sat, 23 Mar 2024 21:12:03 +0000 Subject: [PATCH 11/17] updated copyright dates --- lib/node_modules/@stdlib/blas/ext/base/dasumpw/README.md | 2 +- .../@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.js | 2 +- .../@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.native.js | 2 +- .../blas/ext/base/dasumpw/benchmark/benchmark.ndarray.js | 2 +- .../blas/ext/base/dasumpw/benchmark/benchmark.ndarray.native.js | 2 +- lib/node_modules/@stdlib/blas/ext/base/dasumpw/docs/repl.txt | 1 + .../@stdlib/blas/ext/base/dasumpw/examples/index.js | 2 +- lib/node_modules/@stdlib/blas/ext/base/dasumpw/lib/index.js | 2 +- lib/node_modules/@stdlib/blas/ext/base/dasumpw/lib/ndarray.js | 2 +- .../@stdlib/blas/ext/base/dasumpw/lib/ndarray.native.js | 2 +- .../@stdlib/blas/ext/base/dasumpw/test/test.dasumpw.js | 2 +- .../@stdlib/blas/ext/base/dasumpw/test/test.dasumpw.native.js | 2 +- .../@stdlib/blas/ext/base/dasumpw/test/test.ndarray.js | 2 +- .../@stdlib/blas/ext/base/dasumpw/test/test.ndarray.native.js | 2 +- 14 files changed, 14 insertions(+), 13 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/README.md index 73b5a60efd45..f215577f9551 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/README.md @@ -2,7 +2,7 @@ @license Apache-2.0 -Copyright (c) 2024 The Stdlib Authors. +Copyright (c) 2020 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. diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.js index 0316fdbdf674..90ab3e8a33bb 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2020 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. diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.native.js index 8d1f192b7ced..610dafc3a3e9 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2020 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. diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.ndarray.js index e7dd3573da17..a171c49f3faa 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.ndarray.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2020 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. diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.ndarray.native.js index e7152ae3d1cd..c9d57e4634d9 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/benchmark/benchmark.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2020 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. diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/docs/repl.txt index a74de0eb18d2..e7e176f41514 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/docs/repl.txt @@ -92,3 +92,4 @@ See Also -------- + diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/examples/index.js index f5dd30a8c37d..96b5f7748224 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/examples/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/examples/index.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2020 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. diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/lib/index.js index da77851c0253..a38dd2b7f258 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/lib/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/lib/index.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2020 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. diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/lib/ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/lib/ndarray.js index e4a5a17c3a0d..35131a5263d7 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/lib/ndarray.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2020 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. diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/lib/ndarray.native.js index fef86d02ded4..c30bcf79ffcf 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/lib/ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/lib/ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2020 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. diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/test/test.dasumpw.js b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/test/test.dasumpw.js index e38aaaa2503b..6b76f6d8d5da 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/test/test.dasumpw.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/test/test.dasumpw.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2020 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. diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/test/test.dasumpw.native.js b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/test/test.dasumpw.native.js index ab0fbda25d25..2e1dc712cd8e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/test/test.dasumpw.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/test/test.dasumpw.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2020 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. diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/test/test.ndarray.js index 46e41d793150..40e273a42b56 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/test/test.ndarray.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2020 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. diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/test/test.ndarray.native.js index 9bff02df40b8..4fab38b1afdc 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/test/test.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/test/test.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2020 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. From ce469a3c4ba36bc7f23a2c04646c8e785ee95fff Mon Sep 17 00:00:00 2001 From: utkarsh_raj <49344502+rajutkarsh07@users.noreply.github.com> Date: Sat, 23 Mar 2024 21:29:38 +0000 Subject: [PATCH 12/17] refactoring manifest.json and addon.c --- .../blas/ext/base/dasumpw/manifest.json | 78 ++++++------- .../@stdlib/blas/ext/base/dasumpw/src/addon.c | 109 ++++-------------- 2 files changed, 59 insertions(+), 128 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/manifest.json index cc56386a9d11..f6dfc51e7040 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/manifest.json +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/manifest.json @@ -1,45 +1,45 @@ { "options": {}, "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } + { + "field": "src", + "resolve": true, + "relative": true + }, + { + "field": "include", + "resolve": true, + "relative": true + }, + { + "field": "libraries", + "resolve": false, + "relative": false + }, + { + "field": "libpath", + "resolve": true, + "relative": false + } ], "confs": [ - { - "src": [ - "./src/dsumkbn2.c" - ], - "include": [ - "./include" - ], - "libraries": [ - "-lm" - ], - "libpath": [], - "dependencies": [ - "@stdlib/napi/export", - "@stdlib/napi/argv", - "@stdlib/napi/argv-int64", - "@stdlib/napi/argv-strided-float64array" - ] - } + { + "src": [ + "./src/dsumkbn2.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lm" + ], + "libpath": [], + "dependencies": [ + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-strided-float64array" + ] + } ] -} + } \ No newline at end of file diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c index c549fed9ad0f..cc66b2c575e4 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2020 The Stdlib Authors. +* Copyright (c) 2018 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. @@ -17,101 +17,32 @@ */ #include "stdlib/blas/ext/base/dasumpw.h" +#include "stdlib/napi/export.h" +#include "stdlib/napi/argv.h" +#include "stdlib/napi/argv_int64.h" +#include "stdlib/napi/argv_strided_float64array.h" #include -#include -#include -#include #include /** -* Computes the sum of absolute values (L1 norm) of double-precision floating-point strided array elements using pairwise summation. +* Receives JavaScript callback invocation data. * -* ## Notes -* -* - When called from JavaScript, the function expects three arguments: -* -* - `N`: number of indexed elements -* - `X`: input array -* - `stride`: stride length +* @private +* @param env environment under which the function is invoked +* @param info callback data +* @return Node-API value */ -napi_value node_dasumpw( napi_env env, napi_callback_info info ) { - napi_status status; - - size_t argc = 3; - napi_value argv[ 3 ]; - status = napi_get_cb_info( env, info, &argc, argv, NULL, NULL ); - assert( status == napi_ok ); - - if ( argc < 3 ) { - napi_throw_error( env, NULL, "invalid invocation. Must provide 3 arguments." ); - return NULL; - } - - napi_valuetype vtype0; - status = napi_typeof( env, argv[ 0 ], &vtype0 ); - assert( status == napi_ok ); - if ( vtype0 != napi_number ) { - napi_throw_type_error( env, NULL, "invalid argument. First argument must be a number." ); - return NULL; - } - - bool res; - status = napi_is_typedarray( env, argv[ 1 ], &res ); - assert( status == napi_ok ); - if ( res == false ) { - napi_throw_type_error( env, NULL, "invalid argument. Second argument must be a Float64Array." ); - return NULL; - } - - napi_valuetype vtype2; - status = napi_typeof( env, argv[ 2 ], &vtype2 ); - assert( status == napi_ok ); - if ( vtype2 != napi_number ) { - napi_throw_type_error( env, NULL, "invalid argument. Third argument must be a number." ); - return NULL; - } - - int64_t N; - status = napi_get_value_int64( env, argv[ 0 ], &N ); - assert( status == napi_ok ); +static napi_value addon( napi_env env, napi_callback_info info ) { + STDLIB_NAPI_ARGV( env, info, argv, argc, 3 ); + STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 ); + STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 2 ); + STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 1 ); - int64_t stride; - status = napi_get_value_int64( env, argv[ 2 ], &stride ); - assert( status == napi_ok ); + napi_value v; + napi_status status = napi_create_double( env, c_dasum( N, (double *)X, strideX ), &v ); + assert( status == napi_ok ); - napi_typedarray_type vtype1; - size_t xlen; - void *X; - status = napi_get_typedarray_info( env, argv[ 1 ], &vtype1, &xlen, &X, NULL, NULL ); - assert( status == napi_ok ); - if ( vtype1 != napi_float64_array ) { - napi_throw_type_error( env, NULL, "invalid argument. Second argument must be a Float64Array." ); - return NULL; - } - if ( (N-1)*llabs(stride) >= (int64_t)xlen ) { - napi_throw_range_error( env, NULL, "invalid argument. Second argument has insufficient elements based on the associated stride and the number of indexed elements." ); - return NULL; - } - - napi_value v; - status = napi_create_double( env, stdlib_strided_dasumpw( N, (double *)X, stride ), &v ); - assert( status == napi_ok ); - - return v; -} - -/** -* Initialize the add-on. -*/ -napi_value Init( napi_env env, napi_value exports ) { - napi_status status; - napi_value fcn; - status = napi_create_function( env, NULL, NAPI_AUTO_LENGTH, node_dasumpw, NULL, &fcn ); - assert( status == napi_ok ); - return fcn; + return v; } -/** -* Export the add-on. -*/ -NAPI_MODULE( NODE_GYP_MODULE_NAME, Init ) +STDLIB_NAPI_MODULE_EXPORT_FCN( addon ) \ No newline at end of file From 69706bb50b5e0d542341dbbbed752d252ac8bee8 Mon Sep 17 00:00:00 2001 From: utkarsh_raj <49344502+rajutkarsh07@users.noreply.github.com> Date: Mon, 25 Mar 2024 04:37:33 +0000 Subject: [PATCH 13/17] refactoring changes --- .../blas/ext/base/dasumpw/docs/repl.txt | 2 +- .../blas/ext/base/dasumpw/manifest.json | 88 +++++++++---------- .../@stdlib/blas/ext/base/dasumpw/src/addon.c | 2 +- 3 files changed, 46 insertions(+), 46 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/docs/repl.txt index e7e176f41514..e9dac9703ee3 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/docs/repl.txt @@ -92,4 +92,4 @@ See Also -------- - + diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/manifest.json index f6dfc51e7040..56a36c33e4cf 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/manifest.json +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/manifest.json @@ -1,45 +1,45 @@ { - "options": {}, - "fields": [ - { - "field": "src", - "resolve": true, - "relative": true - }, - { - "field": "include", - "resolve": true, - "relative": true - }, - { - "field": "libraries", - "resolve": false, - "relative": false - }, - { - "field": "libpath", - "resolve": true, - "relative": false - } - ], - "confs": [ - { - "src": [ - "./src/dsumkbn2.c" - ], - "include": [ - "./include" - ], - "libraries": [ - "-lm" - ], - "libpath": [], - "dependencies": [ - "@stdlib/napi/export", - "@stdlib/napi/argv", - "@stdlib/napi/argv-int64", - "@stdlib/napi/argv-strided-float64array" - ] - } - ] - } \ No newline at end of file + "options": {}, + "fields": [ + { + "field": "src", + "resolve": true, + "relative": true + }, + { + "field": "include", + "resolve": true, + "relative": true + }, + { + "field": "libraries", + "resolve": false, + "relative": false + }, + { + "field": "libpath", + "resolve": true, + "relative": false + } + ], + "confs": [ + { + "src": [ + "./src/dsumkbn2.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lm" + ], + "libpath": [], + "dependencies": [ + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-strided-float64array" + ] + } + ] +} \ No newline at end of file diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c index cc66b2c575e4..d78b7d89bfd4 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c @@ -39,7 +39,7 @@ static napi_value addon( napi_env env, napi_callback_info info ) { STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 1 ); napi_value v; - napi_status status = napi_create_double( env, c_dasum( N, (double *)X, strideX ), &v ); + napi_status status = napi_create_double( env, stdlib_strided_dasumpw( N, (double *)X, strideX ), &v ); assert( status == napi_ok ); return v; From 9a821d1e62707c250da87b85dffc607f41a52607 Mon Sep 17 00:00:00 2001 From: utkarsh_raj <49344502+rajutkarsh07@users.noreply.github.com> Date: Mon, 25 Mar 2024 14:35:11 +0000 Subject: [PATCH 14/17] refactoring changes --- lib/node_modules/@stdlib/blas/ext/base/dasumpw/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/README.md index f215577f9551..0409e7d63c78 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/README.md @@ -151,7 +151,7 @@ var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; var filledarrayBy = require( '@stdlib/array/filled-by' ); var dasumpw = require( '@stdlib/blas/ext/base/dasumpw' ); -var x = filledarrayBy(10, 'float64', discreteUniform(0, 100)); +var x = filledarrayBy( 10, 'float64', discreteUniform( 0, 100 ) ); console.log( x ); var v = dasumpw( x.length, x, 1 ); From bc39bcc7c8aa5e6c731d1fd3a67c4592aad4dd9b Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Tue, 26 Mar 2024 09:09:04 -0400 Subject: [PATCH 15/17] Update lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c Signed-off-by: Philipp Burckhardt --- lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c index d78b7d89bfd4..f665357b6086 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/src/addon.c @@ -39,7 +39,7 @@ static napi_value addon( napi_env env, napi_callback_info info ) { STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 1 ); napi_value v; - napi_status status = napi_create_double( env, stdlib_strided_dasumpw( N, (double *)X, strideX ), &v ); + napi_status status = napi_create_double( env, stdlib_strided_dasumpw( N, X, strideX ), &v ); assert( status == napi_ok ); return v; From d4382fe5e1ad99633fc33ff25ba2d30944c794c2 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Tue, 26 Mar 2024 09:11:38 -0400 Subject: [PATCH 16/17] Update manifest.json Signed-off-by: Philipp Burckhardt --- .../blas/ext/base/dasumpw/manifest.json | 37 +++++++++++++++++-- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/manifest.json index 56a36c33e4cf..9df3ecfe74af 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/manifest.json +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/manifest.json @@ -1,5 +1,7 @@ { - "options": {}, + "options": { + "task": "build" + }, "fields": [ { "field": "src", @@ -24,8 +26,9 @@ ], "confs": [ { + "task": "build", "src": [ - "./src/dsumkbn2.c" + "./src/dasumpw.c" ], "include": [ "./include" @@ -40,6 +43,34 @@ "@stdlib/napi/argv-int64", "@stdlib/napi/argv-strided-float64array" ] + }. + { + "task": "benchmark", + "src": [ + "./src/dasumpw.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lm" + ], + "libpath": [], + "dependencies": [] + }, + { + "task": "examples", + "src": [ + "./src/dasumpw.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lm" + ], + "libpath": [], + "dependencies": [] } ] -} \ No newline at end of file +} From 1093ed58d817e8aafdf0dc4f84841969d8cf411d Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Tue, 26 Mar 2024 09:12:08 -0400 Subject: [PATCH 17/17] Update manifest.json Signed-off-by: Philipp Burckhardt --- lib/node_modules/@stdlib/blas/ext/base/dasumpw/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/manifest.json index 9df3ecfe74af..b2610eaf8e38 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dasumpw/manifest.json +++ b/lib/node_modules/@stdlib/blas/ext/base/dasumpw/manifest.json @@ -43,7 +43,7 @@ "@stdlib/napi/argv-int64", "@stdlib/napi/argv-strided-float64array" ] - }. + }, { "task": "benchmark", "src": [