From 86070dcb6f20052a4e2910e567ee20b0d506728c Mon Sep 17 00:00:00 2001 From: soumajit23 Date: Fri, 22 Mar 2024 18:01:54 +0530 Subject: [PATCH 1/7] refactor: update blas/ext/base/dssumpw to follow current project conventions --- .../@stdlib/blas/ext/base/dssumpw/README.md | 32 ++--- .../ext/base/dssumpw/benchmark/benchmark.js | 19 ++- .../dssumpw/benchmark/benchmark.native.js | 15 +-- .../dssumpw/benchmark/benchmark.ndarray.js | 19 ++- .../benchmark/benchmark.ndarray.native.js | 15 +-- .../ext/base/dssumpw/benchmark/c/Makefile | 2 +- .../dssumpw/benchmark/c/benchmark.length.c | 2 +- .../@stdlib/blas/ext/base/dssumpw/binding.gyp | 2 +- .../blas/ext/base/dssumpw/docs/repl.txt | 17 ++- .../ext/base/dssumpw/docs/types/index.d.ts | 2 +- .../blas/ext/base/dssumpw/docs/types/test.ts | 2 +- .../blas/ext/base/dssumpw/examples/c/Makefile | 2 +- .../ext/base/dssumpw/examples/c/example.c | 2 +- .../blas/ext/base/dssumpw/examples/index.js | 15 +-- .../blas/ext/base/dssumpw/include.gypi | 4 +- .../include/stdlib/blas/ext/base/dssumpw.h | 2 +- .../blas/ext/base/dssumpw/lib/dssumpw.js | 2 +- .../ext/base/dssumpw/lib/dssumpw.native.js | 2 +- .../blas/ext/base/dssumpw/lib/index.js | 6 +- .../@stdlib/blas/ext/base/dssumpw/lib/main.js | 2 +- .../blas/ext/base/dssumpw/lib/native.js | 2 +- .../blas/ext/base/dssumpw/lib/ndarray.js | 13 +- .../ext/base/dssumpw/lib/ndarray.native.js | 18 +-- .../blas/ext/base/dssumpw/manifest.json | 114 ++++++++++++++++- .../blas/ext/base/dssumpw/package.json | 4 +- .../blas/ext/base/dssumpw/src/Makefile | 2 +- .../@stdlib/blas/ext/base/dssumpw/src/addon.c | 47 +++++++ .../blas/ext/base/dssumpw/src/addon.cpp | 117 ------------------ .../blas/ext/base/dssumpw/src/dssumpw.c | 2 +- .../ext/base/dssumpw/test/test.dssumpw.js | 21 ++-- .../base/dssumpw/test/test.dssumpw.native.js | 21 ++-- .../blas/ext/base/dssumpw/test/test.js | 2 +- .../ext/base/dssumpw/test/test.ndarray.js | 23 ++-- .../base/dssumpw/test/test.ndarray.native.js | 23 ++-- 34 files changed, 271 insertions(+), 302 deletions(-) create mode 100644 lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/addon.c delete mode 100644 lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/addon.cpp diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/README.md index 4b4110ee7d29..1685d7889a9b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/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. @@ -56,16 +56,14 @@ The function has the following parameters: - **x**: input [`Float32Array`][@stdlib/array/float32]. - **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 every other element in `x`, +The `N` and stride parameters determine which elements in x are accessed at runtime. For example, to compute the sum of every other element in `x`, ```javascript var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); var x = new Float32Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] ); -var N = floor( x.length / 2 ); -var v = dssumpw( N, x, 2 ); +var v = dssumpw( 4, x, 2 ); // returns 5.0 ``` @@ -75,14 +73,11 @@ Note that indexing is relative to the first index. To introduce an offset, use [ ```javascript var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); var x0 = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -var N = floor( x0.length / 2 ); - -var v = dssumpw( N, x1, 2 ); +var v = dssumpw( 4, x1, 2 ); // returns 5.0 ``` @@ -104,16 +99,14 @@ The function has the following additional parameters: - **offset**: starting index for `x`. -While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value +While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, the offset parameter supports indexing semantics based on a starting index. For example, to calculate the sum of every other value in `x` starting from the second value ```javascript var Float32Array = require( '@stdlib/array/float32' ); -var floor = require( '@stdlib/math/base/special/floor' ); var x = new Float32Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] ); -var N = floor( x.length / 2 ); -var v = dssumpw.ndarray( N, x, 2, 1 ); +var v = dssumpw.ndarray( 4, x, 2, 1 ); // returns 5.0 ``` @@ -139,18 +132,11 @@ var v = dssumpw.ndarray( N, x, 2, 1 ); ```javascript -var randu = require( '@stdlib/random/base/randu' ); -var round = require( '@stdlib/math/base/special/round' ); -var Float32Array = require( '@stdlib/array/float32' ); +var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +var filledarrayBy = require( '@stdlib/array/filled-by' ); var dssumpw = require( '@stdlib/blas/ext/base/dssumpw' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { - x[ i ] = round( randu()*100.0 ); -} +var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); console.log( x ); var v = dssumpw( x.length, x, 1 ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.js index 837d1dde1737..cd093abdcd88 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/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,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 Float32Array = require( '@stdlib/array/float32' ); var pkg = require( './../package.json' ).name; var dssumpw = require( './../lib/dssumpw.js' ); +// VARIABLES // + +var rand = uniform( -100.0, 100.0 ); + + // FUNCTIONS // /** @@ -39,13 +44,7 @@ var dssumpw = require( './../lib/dssumpw.js' ); * @returns {Function} benchmark function */ function createBenchmark( len ) { - var x; - var i; - - x = new Float32Array( len ); - for ( i = 0; i < x.length; i++ ) { - x[ i ] = ( randu()*10.0 ) - 20.0; - } + var x = filledarrayBy( len, 'float32', rand ); return benchmark; function benchmark( b ) { diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.native.js index 9bfb27a30804..b2da9677c72c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/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 Float32Array = require( '@stdlib/array/float32' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -36,6 +36,7 @@ var dssumpw = tryRequire( resolve( __dirname, './../lib/dssumpw.native.js' ) ); var opts = { 'skip': ( dssumpw 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 Float32Array( len ); - for ( i = 0; i < x.length; i++ ) { - x[ i ] = ( randu()*10.0 ) - 20.0; - } + var x = filledarrayBy( len, 'float32', rand ); return benchmark; function benchmark( b ) { diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.ndarray.js index 55aa868d5d5f..5a511ec13b5d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/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 Float32Array = require( '@stdlib/array/float32' ); var pkg = require( './../package.json' ).name; var dssumpw = require( './../lib/ndarray.js' ); +// VARIABLES // + +var rand = uniform( -100.0, 100.0 ); + + // FUNCTIONS // /** @@ -39,13 +44,7 @@ var dssumpw = require( './../lib/ndarray.js' ); * @returns {Function} benchmark function */ function createBenchmark( len ) { - var x; - var i; - - x = new Float32Array( len ); - for ( i = 0; i < x.length; i++ ) { - x[ i ] = ( randu()*10.0 ) - 20.0; - } + var x = filledarrayBy( len, 'float32', rand ); return benchmark; function benchmark( b ) { diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.ndarray.native.js index 7586535833c7..4ce0a14621ad 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/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 Float32Array = require( '@stdlib/array/float32' ); var tryRequire = require( '@stdlib/utils/try-require' ); var pkg = require( './../package.json' ).name; @@ -36,6 +36,7 @@ var dssumpw = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); var opts = { 'skip': ( dssumpw 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 Float32Array( len ); - for ( i = 0; i < x.length; i++ ) { - x[ i ] = ( randu()*10.0 ) - 20.0; - } + var x = filledarrayBy( len, 'float32', rand ); return benchmark; function benchmark( b ) { diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/c/Makefile b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/c/Makefile index 7280962b4c4d..9f97140e7cb0 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/c/Makefile +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/c/Makefile @@ -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. diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/c/benchmark.length.c index b9843ad92540..88fef77fc03f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/c/benchmark.length.c @@ -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. diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/binding.gyp b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/binding.gyp index 7d0005b2e390..ec3992233442 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/binding.gyp +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/binding.gyp @@ -1,6 +1,6 @@ # @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. diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/docs/repl.txt index 48a4a9ee9647..d86618cc5070 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/docs/repl.txt @@ -4,7 +4,7 @@ using pairwise summation with extended accumulation and returning an extended precision result. - The `N` and `stride` parameters determine which elements in `x` are accessed + 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 @@ -35,28 +35,27 @@ > {{alias}}( x.length, x, 1 ) 1.0 - // Using `N` and `stride` parameters: + // Using `N` and stride parameters: > x = new {{alias:@stdlib/array/float32}}( [ -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 ) 1.0 // Using view offsets: > var x0 = new {{alias:@stdlib/array/float32}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0 ] ); > var x1 = new {{alias:@stdlib/array/float32}}( 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 ) -1.0 + {{alias}}.ndarray( N, x, stride, offset ) Computes the sum of single-precision floating-point strided array elements using pairwise summation with extended accumulation and alternative indexing semantics and returning an extended precision result. While typed array views mandate a view offset based on the underlying - buffer, the `offset` parameter supports indexing semantics based on a + buffer, the offset parameter supports indexing semantics based on a starting index. Parameters @@ -87,10 +86,10 @@ // Using offset parameter: > var x = new {{alias:@stdlib/array/float32}}( [ 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 ) + > {{alias}}.ndarray( 3, x, 2, 1 ) -1.0 + See Also -------- diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/docs/types/index.d.ts index b78f95c40427..45c4a5b1a7a4 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/docs/types/index.d.ts @@ -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. diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/docs/types/test.ts index 19c65fda7c36..b96881d44fb3 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/docs/types/test.ts @@ -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. diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/examples/c/Makefile b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/examples/c/Makefile index ff5293d3059f..6aed70daf167 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/examples/c/Makefile +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/examples/c/Makefile @@ -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. diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/examples/c/example.c b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/examples/c/example.c index dfd625dead71..0abf5b45e877 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/examples/c/example.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/examples/c/example.c @@ -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. diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/examples/index.js index 1a566bcb972e..45c4d950e1d3 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/examples/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/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 Float32Array = require( '@stdlib/array/float32' ); +var discreteUniform = require( '@stdlib/random/base/discrete-uniform' ).factory; +var filledarrayBy = require( '@stdlib/array/filled-by' ); var dssumpw = require( './../lib' ); -var x; -var i; - -x = new Float32Array( 10 ); -for ( i = 0; i < x.length; i++ ) { - x[ i ] = round( randu()*100.0 ); -} +var x = filledarrayBy( 10, 'float32', discreteUniform( 0, 100 ) ); console.log( x ); var v = dssumpw( x.length, x, 1 ); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/include.gypi b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/include.gypi index 868c5c12e852..575cb043c0bf 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/include.gypi +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/include.gypi @@ -1,6 +1,6 @@ # @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. @@ -36,7 +36,7 @@ # Source files: 'src_files': [ - '<(src_dir)/addon.cpp', + '<(src_dir)/addon.c', ' + +/** +* 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, 6 ); + STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 ); + STDLIB_NAPI_ARGV_FLOAT( env, alpha, argv, 1 ); + STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 3 ); + STDLIB_NAPI_ARGV_INT64( env, strideY, argv, 5 ); + STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, strideX, argv, 2 ); + STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, Y, N, strideY, argv, 4 ); + c_saxpy( N, alpha, X, strideX, Y, strideY ); + return NULL; +} + +STDLIB_NAPI_MODULE_EXPORT_FCN( addon ) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/addon.cpp b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/addon.cpp deleted file mode 100644 index f1d5973bbc69..000000000000 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/addon.cpp +++ /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/dssumpw.h" -#include -#include -#include -#include -#include - -/** -* Add-on namespace. -*/ -namespace stdlib_blas_ext_base_dssumpw { - - /** - * Computes the sum of single-precision floating-point strided array elements using pairwise summation with extended accumulation and returning an extended precision result. - * - * ## Notes - * - * - When called from JavaScript, the function expects three arguments: - * - * - `N`: number of indexed elements - * - `X`: input array - * - `stride`: stride length - */ - napi_value node_dssumpw( 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 Float32Array." ); - 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_float32_array ) { - napi_throw_type_error( env, nullptr, "invalid argument. Second argument must be a Float32Array." ); - 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_dssumpw( N, (float *)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_dssumpw, NULL, &fcn ); - assert( status == napi_ok ); - return fcn; - } - - NAPI_MODULE( NODE_GYP_MODULE_NAME, Init ) -} // end namespace stdlib_blas_ext_base_dssumpw diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/dssumpw.c b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/dssumpw.c index b1f7a4d93eb1..8816193d19d2 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/dssumpw.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/dssumpw.c @@ -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. diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.dssumpw.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.dssumpw.js index ba5c27707da2..edb4302c9394 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.dssumpw.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.dssumpw.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,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 Float32Array = require( '@stdlib/array/float32' ); var dssumpw = require( './../lib/dssumpw.js' ); @@ -102,8 +101,7 @@ tape( 'if provided an `N` parameter equal to `1`, the function returns the first t.end(); }); -tape( 'the function supports a `stride` parameter', function test( t ) { - var N; +tape( 'the function supports a stride parameter', function test( t ) { var x; var v; @@ -118,15 +116,13 @@ tape( 'the function supports a `stride` parameter', function test( t ) { 2.0 ]); - N = floor( x.length / 2 ); - v = dssumpw( N, x, 2 ); + v = dssumpw( 4, x, 2 ); t.strictEqual( v, 5.0, 'returns expected value' ); t.end(); }); -tape( 'the function supports a negative `stride` parameter', function test( t ) { - var N; +tape( 'the function supports a negative stride parameter', function test( t ) { var x; var v; var i; @@ -142,8 +138,7 @@ tape( 'the function supports a negative `stride` parameter', function test( t ) 2.0 ]); - N = floor( x.length / 2 ); - v = dssumpw( N, x, -2 ); + v = dssumpw( 4, x, -2 ); t.strictEqual( v, 5.0, 'returns expected value' ); @@ -157,7 +152,7 @@ tape( 'the function supports a negative `stride` parameter', function test( t ) t.end(); }); -tape( 'if provided a `stride` parameter equal to `0`, the function returns the first element', function test( t ) { +tape( 'if provided a stride parameter equal to `0`, the function returns the first element', function test( t ) { var x; var v; @@ -172,7 +167,6 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the f tape( 'the function supports view offsets', function test( t ) { var x0; var x1; - var N; var v; x0 = new Float32Array([ @@ -188,9 +182,8 @@ tape( 'the function supports view offsets', function test( t ) { ]); x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element - N = floor(x1.length / 2); - v = dssumpw( N, x1, 2 ); + v = dssumpw( 4, x1, 2 ); t.strictEqual( v, 5.0, 'returns expected value' ); t.end(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.dssumpw.native.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.dssumpw.native.js index 86d78448a693..2ebf73f10d2f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.dssumpw.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.dssumpw.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,7 +22,6 @@ var resolve = require( 'path' ).resolve; var tape = require( 'tape' ); -var floor = require( '@stdlib/math/base/special/floor' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var Float32Array = require( '@stdlib/array/float32' ); var tryRequire = require( '@stdlib/utils/try-require' ); @@ -193,8 +192,7 @@ tape( 'if provided an `N` parameter equal to `1`, the function returns the first t.end(); }); -tape( 'the function supports a `stride` parameter', opts, function test( t ) { - var N; +tape( 'the function supports a stride parameter', opts, function test( t ) { var x; var v; @@ -209,15 +207,13 @@ tape( 'the function supports a `stride` parameter', opts, function test( t ) { 2.0 ]); - N = floor( x.length / 2 ); - v = dssumpw( N, x, 2 ); + v = dssumpw( 4, x, 2 ); t.strictEqual( v, 5.0, 'returns expected value' ); t.end(); }); -tape( 'the function supports a negative `stride` parameter', opts, function test( t ) { - var N; +tape( 'the function supports a negative stride parameter', opts, function test( t ) { var x; var v; var i; @@ -233,8 +229,7 @@ tape( 'the function supports a negative `stride` parameter', opts, function test 2.0 ]); - N = floor( x.length / 2 ); - v = dssumpw( N, x, -2 ); + v = dssumpw( 4, x, -2 ); t.strictEqual( v, 5.0, 'returns expected value' ); @@ -248,7 +243,7 @@ tape( 'the function supports a negative `stride` parameter', opts, function test t.end(); }); -tape( 'if provided a `stride` parameter equal to `0`, the function returns the first element', opts, function test( t ) { +tape( 'if provided a stride parameter equal to `0`, the function returns the first element', opts, function test( t ) { var x; var v; @@ -263,7 +258,6 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the f tape( 'the function supports view offsets', opts, function test( t ) { var x0; var x1; - var N; var v; x0 = new Float32Array([ @@ -279,9 +273,8 @@ tape( 'the function supports view offsets', opts, function test( t ) { ]); x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element - N = floor(x1.length / 2); - v = dssumpw( N, x1, 2 ); + v = dssumpw( 4, x1, 2 ); t.strictEqual( v, 5.0, 'returns expected value' ); t.end(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.js index d4cc2857d674..53825db07d8d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.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. diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.ndarray.js index c47a0014e465..1b93bfb5d622 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.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,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 Float32Array = require( '@stdlib/array/float32' ); var dssumpw = require( './../lib/ndarray.js' ); @@ -102,8 +101,7 @@ tape( 'if provided an `N` parameter equal to `1`, the function returns the first t.end(); }); -tape( 'the function supports a `stride` parameter', function test( t ) { - var N; +tape( 'the function supports a stride parameter', function test( t ) { var x; var v; @@ -118,15 +116,13 @@ tape( 'the function supports a `stride` parameter', function test( t ) { 2.0 ]); - N = floor( x.length / 2 ); - v = dssumpw( N, x, 2, 0 ); + v = dssumpw( 4, x, 2, 0 ); t.strictEqual( v, 5.0, 'returns expected value' ); t.end(); }); -tape( 'the function supports a negative `stride` parameter', function test( t ) { - var N; +tape( 'the function supports a negative stride parameter', function test( t ) { var x; var v; var i; @@ -142,8 +138,7 @@ tape( 'the function supports a negative `stride` parameter', function test( t ) 2.0 ]); - N = floor( x.length / 2 ); - v = dssumpw( N, x, -2, 6 ); + v = dssumpw( 4, x, -2, 6 ); t.strictEqual( v, 5.0, 'returns expected value' ); @@ -157,7 +152,7 @@ tape( 'the function supports a negative `stride` parameter', function test( t ) t.end(); }); -tape( 'if provided a `stride` parameter equal to `0`, the function returns the first indexed element', function test( t ) { +tape( 'if provided a stride parameter equal to `0`, the function returns the first indexed element', function test( t ) { var x; var v; @@ -169,8 +164,7 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the f t.end(); }); -tape( 'the function supports an `offset` parameter', function test( t ) { - var N; +tape( 'the function supports an offset parameter', function test( t ) { var x; var v; @@ -184,9 +178,8 @@ tape( 'the function supports an `offset` parameter', function test( t ) { 3.0, 4.0 // 3 ]); - N = floor( x.length / 2 ); - v = dssumpw( N, x, 2, 1 ); + v = dssumpw( 4, x, 2, 1 ); t.strictEqual( v, 5.0, 'returns expected value' ); t.end(); diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.ndarray.native.js index d9547e7f4291..0c81d5a80698 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.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,7 +22,6 @@ var resolve = require( 'path' ).resolve; var tape = require( 'tape' ); -var floor = require( '@stdlib/math/base/special/floor' ); var isnan = require( '@stdlib/math/base/assert/is-nan' ); var Float32Array = require( '@stdlib/array/float32' ); var tryRequire = require( '@stdlib/utils/try-require' ); @@ -111,8 +110,7 @@ tape( 'if provided an `N` parameter equal to `1`, the function returns the first t.end(); }); -tape( 'the function supports a `stride` parameter', opts, function test( t ) { - var N; +tape( 'the function supports a stride parameter', opts, function test( t ) { var x; var v; @@ -127,15 +125,13 @@ tape( 'the function supports a `stride` parameter', opts, function test( t ) { 2.0 ]); - N = floor( x.length / 2 ); - v = dssumpw( N, x, 2, 0 ); + v = dssumpw( 4, x, 2, 0 ); t.strictEqual( v, 5.0, 'returns expected value' ); t.end(); }); -tape( 'the function supports a negative `stride` parameter', opts, function test( t ) { - var N; +tape( 'the function supports a negative stride parameter', opts, function test( t ) { var x; var v; var i; @@ -151,8 +147,7 @@ tape( 'the function supports a negative `stride` parameter', opts, function test 2.0 ]); - N = floor( x.length / 2 ); - v = dssumpw( N, x, -2, 6 ); + v = dssumpw( 4, x, -2, 6 ); t.strictEqual( v, 5.0, 'returns expected value' ); @@ -166,7 +161,7 @@ tape( 'the function supports a negative `stride` parameter', opts, function test t.end(); }); -tape( 'if provided a `stride` parameter equal to `0`, the function returns the first indexed element', opts, function test( t ) { +tape( 'if provided a stride parameter equal to `0`, the function returns the first indexed element', opts, function test( t ) { var x; var v; @@ -178,8 +173,7 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the f t.end(); }); -tape( 'the function supports an `offset` parameter', opts, function test( t ) { - var N; +tape( 'the function supports an offset parameter', opts, function test( t ) { var x; var v; @@ -193,9 +187,8 @@ tape( 'the function supports an `offset` parameter', opts, function test( t ) { 3.0, 4.0 // 3 ]); - N = floor( x.length / 2 ); - v = dssumpw( N, x, 2, 1 ); + v = dssumpw( 4, x, 2, 1 ); t.strictEqual( v, 5.0, 'returns expected value' ); t.end(); From 0271a8fe2a3e243d40c995566b6e77804c918eb2 Mon Sep 17 00:00:00 2001 From: soumajit23 Date: Mon, 25 Mar 2024 18:14:52 +0530 Subject: [PATCH 2/7] refactor: update addon.c file --- .../@stdlib/blas/ext/base/dssumpw/src/addon.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/addon.c index fff3439bdbea..6a807b063416 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/addon.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/addon.c @@ -36,12 +36,14 @@ static napi_value addon( napi_env env, napi_callback_info info ) { STDLIB_NAPI_ARGV( env, info, argv, argc, 6 ); STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 ); STDLIB_NAPI_ARGV_FLOAT( env, alpha, argv, 1 ); - STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 3 ); - STDLIB_NAPI_ARGV_INT64( env, strideY, argv, 5 ); - STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, strideX, argv, 2 ); - STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, Y, N, strideY, argv, 4 ); - c_saxpy( N, alpha, X, strideX, Y, strideY ); - return NULL; + STDLIB_NAPI_ARGV_INT64( env, stride, argv, 3 ); + STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, stride, argv, 2 ); + + napi_value v; + napi_status status = napi_create_double( env, (double)stdlib_strided_dssumpw( N, alpha, X, stride ), &v ); + assert( status == napi_ok ); + + return v; } STDLIB_NAPI_MODULE_EXPORT_FCN( addon ) From 7ea57c623c604a2969e9ccd1628718f790bfbdb0 Mon Sep 17 00:00:00 2001 From: Soumajit Chatterjee <121816890+soumajit23@users.noreply.github.com> Date: Fri, 29 Mar 2024 12:28:06 +0530 Subject: [PATCH 3/7] refactor: update addon.c Signed-off-by: Soumajit Chatterjee <121816890+soumajit23@users.noreply.github.com> --- lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/addon.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/addon.c index 6a807b063416..7b71f7d5a011 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/addon.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/addon.c @@ -19,7 +19,6 @@ #include "stdlib/blas/ext/base/dssumpw.h" #include "stdlib/napi/export.h" #include "stdlib/napi/argv.h" -#include "stdlib/napi/argv_float.h" #include "stdlib/napi/argv_int64.h" #include "stdlib/napi/argv_strided_float32array.h" #include @@ -35,12 +34,11 @@ static napi_value addon( napi_env env, napi_callback_info info ) { STDLIB_NAPI_ARGV( env, info, argv, argc, 6 ); STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 ); - STDLIB_NAPI_ARGV_FLOAT( env, alpha, argv, 1 ); STDLIB_NAPI_ARGV_INT64( env, stride, argv, 3 ); STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, stride, argv, 2 ); napi_value v; - napi_status status = napi_create_double( env, (double)stdlib_strided_dssumpw( N, alpha, X, stride ), &v ); + napi_status status = napi_create_double( env, (double)stdlib_strided_dssumpw( N, X, stride ), &v ); assert( status == napi_ok ); return v; From fee559404ba0f02e3133eb103bcf71a8157ec126 Mon Sep 17 00:00:00 2001 From: Soumajit Chatterjee <121816890+soumajit23@users.noreply.github.com> Date: Fri, 29 Mar 2024 12:31:37 +0530 Subject: [PATCH 4/7] refactor: update manifest.json Signed-off-by: Soumajit Chatterjee <121816890+soumajit23@users.noreply.github.com> --- .../blas/ext/base/dssumpw/manifest.json | 212 ++++++------------ 1 file changed, 70 insertions(+), 142 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/manifest.json index b909933711d0..da20859e1e60 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/manifest.json +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/manifest.json @@ -1,148 +1,76 @@ { - "options": { - "os": "linux", - "blas": "" - }, - "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": [ - { - "os": "linux", - "blas": "", - "src": [ - "./src/saxpy.f", - "./src/saxpy_f.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ + "options": { + "task": "build" + }, + "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": [ + { + "task": "build", + "src": [ + "./src/dssumpw.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lm" + ], + "libpath": [], + "dependencies": [ "@stdlib/napi/export", "@stdlib/napi/argv", - "@stdlib/napi/argv-float", "@stdlib/napi/argv-int64", - "@stdlib/napi/argv-strided-float32array" + "@stdlib/napi/argv-strided-float64array" ] - }, - { - "os": "linux", - "blas": "openblas", - "src": [ - "./src/saxpy_cblas.c" - ], - "include": [ - "./include" - ], - "libraries": [ - "-lopenblas", - "-lpthread" - ], - "libpath": [], - "dependencies": [ - "@stdlib/napi/export", - "@stdlib/napi/argv", - "@stdlib/napi/argv-float", - "@stdlib/napi/argv-int64", - "@stdlib/napi/argv-strided-float32array" - ] - }, - { - "os": "mac", - "blas": "", - "src": [ - "./src/saxpy.f", - "./src/saxpy_f.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [ - "@stdlib/napi/export", - "@stdlib/napi/argv", - "@stdlib/napi/argv-float", - "@stdlib/napi/argv-int64", - "@stdlib/napi/argv-strided-float32array" - ] - }, - { - "os": "mac", - "blas": "apple_accelerate_framework", - "src": [ - "./src/saxpy_cblas.c" - ], - "include": [ - "./include" - ], - "libraries": [ - "-lblas" - ], - "libpath": [], - "dependencies": [ - "@stdlib/napi/export", - "@stdlib/napi/argv", - "@stdlib/napi/argv-float", - "@stdlib/napi/argv-int64", - "@stdlib/napi/argv-strided-float32array" - ] - }, - { - "os": "mac", - "blas": "openblas", - "src": [ - "./src/saxpy_cblas.c" - ], - "include": [ - "./include" - ], - "libraries": [ - "-lopenblas", - "-lpthread" - ], - "libpath": [], - "dependencies": [ - "@stdlib/napi/export", - "@stdlib/napi/argv", - "@stdlib/napi/argv-float", - "@stdlib/napi/argv-int64", - "@stdlib/napi/argv-strided-float32array" - ] - }, - { - "os": "win", - "blas": "", - "src": [ - "./src/saxpy.c" - ], - "include": [ - "./include" - ], - "libraries": [], - "libpath": [], - "dependencies": [] - } - ] + }, + { + "task": "benchmark", + "src": [ + "./src/dssumpw.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lm" + ], + "libpath": [], + "dependencies": [] + }, + { + "task": "examples", + "src": [ + "./src/dssumpw.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lm" + ], + "libpath": [], + "dependencies": [] + } + ] } From 2090b01268e4321b2629df98e0acb24d7f4a46b8 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Fri, 29 Mar 2024 08:51:07 -0400 Subject: [PATCH 5/7] chore: revert copyright year changes Signed-off-by: Philipp Burckhardt --- lib/node_modules/@stdlib/blas/ext/base/dssumpw/README.md | 2 +- .../@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.js | 2 +- .../@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.native.js | 2 +- .../blas/ext/base/dssumpw/benchmark/benchmark.ndarray.js | 2 +- .../blas/ext/base/dssumpw/benchmark/benchmark.ndarray.native.js | 2 +- .../@stdlib/blas/ext/base/dssumpw/benchmark/c/Makefile | 2 +- .../blas/ext/base/dssumpw/benchmark/c/benchmark.length.c | 2 +- lib/node_modules/@stdlib/blas/ext/base/dssumpw/binding.gyp | 2 +- .../@stdlib/blas/ext/base/dssumpw/docs/types/index.d.ts | 2 +- .../@stdlib/blas/ext/base/dssumpw/docs/types/test.ts | 2 +- .../@stdlib/blas/ext/base/dssumpw/examples/c/Makefile | 2 +- .../@stdlib/blas/ext/base/dssumpw/examples/c/example.c | 2 +- .../@stdlib/blas/ext/base/dssumpw/examples/index.js | 2 +- lib/node_modules/@stdlib/blas/ext/base/dssumpw/include.gypi | 2 +- .../ext/base/dssumpw/include/stdlib/blas/ext/base/dssumpw.h | 2 +- lib/node_modules/@stdlib/blas/ext/base/dssumpw/lib/dssumpw.js | 2 +- .../@stdlib/blas/ext/base/dssumpw/lib/dssumpw.native.js | 2 +- lib/node_modules/@stdlib/blas/ext/base/dssumpw/lib/index.js | 2 +- lib/node_modules/@stdlib/blas/ext/base/dssumpw/lib/main.js | 2 +- lib/node_modules/@stdlib/blas/ext/base/dssumpw/lib/native.js | 2 +- .../@stdlib/blas/ext/base/dssumpw/lib/ndarray.native.js | 2 +- lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/Makefile | 2 +- lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/addon.c | 2 +- lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/dssumpw.c | 2 +- .../@stdlib/blas/ext/base/dssumpw/test/test.dssumpw.js | 2 +- .../@stdlib/blas/ext/base/dssumpw/test/test.dssumpw.native.js | 2 +- lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.js | 2 +- .../@stdlib/blas/ext/base/dssumpw/test/test.ndarray.js | 2 +- .../@stdlib/blas/ext/base/dssumpw/test/test.ndarray.native.js | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/README.md b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/README.md index 1685d7889a9b..5c53e3713ff7 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/README.md +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/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/dssumpw/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.js index cd093abdcd88..bd552bf16289 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/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/dssumpw/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.native.js index b2da9677c72c..6286255ae58a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/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/dssumpw/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.ndarray.js index 5a511ec13b5d..d3011d60af1c 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/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/dssumpw/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.ndarray.native.js index 4ce0a14621ad..69a521c23bbe 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/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/dssumpw/benchmark/c/Makefile b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/c/Makefile index 9f97140e7cb0..6ccbf75f377b 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/c/Makefile +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/c/Makefile @@ -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/dssumpw/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/c/benchmark.length.c index 88fef77fc03f..b9843ad92540 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/c/benchmark.length.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. diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/binding.gyp b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/binding.gyp index ec3992233442..82d4bda38662 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/binding.gyp +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/binding.gyp @@ -1,6 +1,6 @@ # @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/dssumpw/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/docs/types/index.d.ts index 45c4a5b1a7a4..b78f95c40427 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/docs/types/index.d.ts @@ -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/dssumpw/docs/types/test.ts b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/docs/types/test.ts index b96881d44fb3..19c65fda7c36 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/docs/types/test.ts @@ -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/dssumpw/examples/c/Makefile b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/examples/c/Makefile index 6aed70daf167..8795afa01295 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/examples/c/Makefile +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/examples/c/Makefile @@ -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/dssumpw/examples/c/example.c b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/examples/c/example.c index 0abf5b45e877..dfd625dead71 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/examples/c/example.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/examples/c/example.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. diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/examples/index.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/examples/index.js index 45c4d950e1d3..31d23d34e677 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/examples/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/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/dssumpw/include.gypi b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/include.gypi index 575cb043c0bf..26476a8c2655 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/include.gypi +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/include.gypi @@ -1,6 +1,6 @@ # @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/dssumpw/include/stdlib/blas/ext/base/dssumpw.h b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/include/stdlib/blas/ext/base/dssumpw.h index f17468b1c40a..b972feae6665 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/include/stdlib/blas/ext/base/dssumpw.h +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/include/stdlib/blas/ext/base/dssumpw.h @@ -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/dssumpw/lib/dssumpw.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/lib/dssumpw.js index 7713a1a211de..2e9f2801426e 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/lib/dssumpw.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/lib/dssumpw.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/dssumpw/lib/dssumpw.native.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/lib/dssumpw.native.js index ee4d649e2c51..3912ea7bc6da 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/lib/dssumpw.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/lib/dssumpw.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/dssumpw/lib/index.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/lib/index.js index 28d3fa197ede..1ac2b8cb8e2d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/lib/index.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/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/dssumpw/lib/main.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/lib/main.js index 636ac2c9ce95..10c68f825333 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/lib/main.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/lib/main.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/dssumpw/lib/native.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/lib/native.js index b7bbb7bdf308..55ebab7448b0 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/lib/native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/lib/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/dssumpw/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/lib/ndarray.native.js index be2892661e72..f404e560dc77 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/lib/ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/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/dssumpw/src/Makefile b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/Makefile index bcf18aa46655..dd720a3de8f2 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/Makefile +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/Makefile @@ -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/dssumpw/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/addon.c index 7b71f7d5a011..46b391929836 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/addon.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/addon.c @@ -38,7 +38,7 @@ static napi_value addon( napi_env env, napi_callback_info info ) { STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, stride, argv, 2 ); napi_value v; - napi_status status = napi_create_double( env, (double)stdlib_strided_dssumpw( N, X, stride ), &v ); + napi_status status = napi_create_double( env, stdlib_strided_dssumpw( N, X, stride ), &v ); assert( status == napi_ok ); return v; diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/dssumpw.c b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/dssumpw.c index 8816193d19d2..b1f7a4d93eb1 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/dssumpw.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/dssumpw.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. diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.dssumpw.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.dssumpw.js index edb4302c9394..7f26f13e67e3 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.dssumpw.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.dssumpw.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/dssumpw/test/test.dssumpw.native.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.dssumpw.native.js index 2ebf73f10d2f..cb57f682072d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.dssumpw.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.dssumpw.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/dssumpw/test/test.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.js index 53825db07d8d..d4cc2857d674 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.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/dssumpw/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.ndarray.js index 1b93bfb5d622..b481765bc89a 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/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/dssumpw/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.ndarray.native.js index 0c81d5a80698..4d56979a2c46 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/test/test.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/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 586be1d637890b325ea3b39e47034746fa73add2 Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Fri, 29 Mar 2024 08:54:11 -0400 Subject: [PATCH 6/7] chore: fix error in committed review suggestions Signed-off-by: Philipp Burckhardt --- .../@stdlib/blas/ext/base/dssumpw/benchmark/c/Makefile | 2 +- lib/node_modules/@stdlib/blas/ext/base/dssumpw/binding.gyp | 2 +- .../@stdlib/blas/ext/base/dssumpw/examples/c/Makefile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/c/Makefile b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/c/Makefile index 6ccbf75f377b..7280962b4c4d 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/c/Makefile +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/c/Makefile @@ -1,7 +1,7 @@ #/ # @license Apache-2.0 # -* Copyright (c) 2020 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/dssumpw/binding.gyp b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/binding.gyp index 82d4bda38662..7d0005b2e390 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/binding.gyp +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/binding.gyp @@ -1,6 +1,6 @@ # @license Apache-2.0 # -* Copyright (c) 2020 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/dssumpw/examples/c/Makefile b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/examples/c/Makefile index 8795afa01295..ff5293d3059f 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/examples/c/Makefile +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/examples/c/Makefile @@ -1,7 +1,7 @@ #/ # @license Apache-2.0 # -* Copyright (c) 2020 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 c8571698de419a79a60a2daa8501f1c81babecfd Mon Sep 17 00:00:00 2001 From: Philipp Burckhardt Date: Sun, 14 Apr 2024 21:36:22 -0400 Subject: [PATCH 7/7] fix: rewrite addon.c and other clean-up --- .../@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.js | 2 +- .../blas/ext/base/dssumpw/benchmark/benchmark.native.js | 2 +- .../blas/ext/base/dssumpw/benchmark/benchmark.ndarray.js | 2 +- .../base/dssumpw/benchmark/benchmark.ndarray.native.js | 2 +- .../@stdlib/blas/ext/base/dssumpw/docs/repl.txt | 1 - .../@stdlib/blas/ext/base/dssumpw/lib/ndarray.js | 9 +++++++-- .../@stdlib/blas/ext/base/dssumpw/manifest.json | 2 +- .../@stdlib/blas/ext/base/dssumpw/src/addon.c | 6 +++--- 8 files changed, 15 insertions(+), 11 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.js index bd552bf16289..008acc1d5249 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.js @@ -31,7 +31,7 @@ var dssumpw = require( './../lib/dssumpw.js' ); // VARIABLES // -var rand = uniform( -100.0, 100.0 ); +var rand = uniform( -10.0, 10.0 ); // FUNCTIONS // diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.native.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.native.js index 6286255ae58a..6bc4e6652181 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.native.js @@ -36,7 +36,7 @@ var dssumpw = tryRequire( resolve( __dirname, './../lib/dssumpw.native.js' ) ); var opts = { 'skip': ( dssumpw instanceof Error ) }; -var rand = uniform( -100.0, 100.0 ); +var rand = uniform( -10.0, 10.0 ); // FUNCTIONS // diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.ndarray.js index d3011d60af1c..fbe2d7ae0eed 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.ndarray.js @@ -31,7 +31,7 @@ var dssumpw = require( './../lib/ndarray.js' ); // VARIABLES // -var rand = uniform( -100.0, 100.0 ); +var rand = uniform( -10.0, 10.0 ); // FUNCTIONS // diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.ndarray.native.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.ndarray.native.js index 69a521c23bbe..41a148a009ec 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/benchmark/benchmark.ndarray.native.js @@ -36,7 +36,7 @@ var dssumpw = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); var opts = { 'skip': ( dssumpw instanceof Error ) }; -var rand = uniform( -100.0, 100.0 ); +var rand = uniform( -10.0, 10.0 ); // FUNCTIONS // diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/docs/repl.txt b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/docs/repl.txt index d86618cc5070..2422708a6ef2 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/docs/repl.txt @@ -89,7 +89,6 @@ > {{alias}}.ndarray( 3, x, 2, 1 ) -1.0 - See Also -------- diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/lib/ndarray.js b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/lib/ndarray.js index c81545873043..f40e3b843673 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/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. @@ -18,6 +18,11 @@ 'use strict'; +// MODULES // + +var floor = require( '@stdlib/math/base/special/floor' ); + + // VARIABLES // // Blocksize for pairwise summation (NOTE: decreasing the blocksize decreases rounding error as more pairs are summed, but also decreases performance. Because the inner loop is unrolled eight times, the blocksize is effectively `16`.): @@ -117,7 +122,7 @@ function dssumpw( N, x, stride, offset ) { return s; } // Recurse by dividing by two, but avoiding non-multiples of unroll factor... - n = (N + 0.5) - (( N + 0.5 ) % 1); + n = floor( N/2 ); n -= n % 8; return dssumpw( n, x, stride, ix ) + dssumpw( N-n, x, stride, ix+(n*stride) ); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/manifest.json b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/manifest.json index da20859e1e60..e2267ed7d036 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/manifest.json +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/manifest.json @@ -41,7 +41,7 @@ "@stdlib/napi/export", "@stdlib/napi/argv", "@stdlib/napi/argv-int64", - "@stdlib/napi/argv-strided-float64array" + "@stdlib/napi/argv-strided-float32array" ] }, { diff --git a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/addon.c b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/addon.c index 46b391929836..39cbfc5851f4 100644 --- a/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/addon.c +++ b/lib/node_modules/@stdlib/blas/ext/base/dssumpw/src/addon.c @@ -32,10 +32,10 @@ * @return Node-API value */ static napi_value addon( napi_env env, napi_callback_info info ) { - STDLIB_NAPI_ARGV( env, info, argv, argc, 6 ); + STDLIB_NAPI_ARGV( env, info, argv, argc, 3 ); STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 ); - STDLIB_NAPI_ARGV_INT64( env, stride, argv, 3 ); - STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, stride, argv, 2 ); + 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, stdlib_strided_dssumpw( N, X, stride ), &v );