Skip to content

Commit cee7aed

Browse files
chore: add benchmark and docs
1 parent 99c6134 commit cee7aed

File tree

13 files changed

+176
-155
lines changed

13 files changed

+176
-155
lines changed

lib/node_modules/@stdlib/blas/ext/base/dnansumkbn2/manifest.json

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"options": {
3-
"task": "build"
3+
"task": "build",
4+
"wasm": false
45
},
56
"fields": [
67
{
@@ -27,6 +28,7 @@
2728
"confs": [
2829
{
2930
"task": "build",
31+
"wasm": false,
3032
"src": [
3133
"./src/main.c"
3234
],
@@ -49,6 +51,7 @@
4951
},
5052
{
5153
"task": "benchmark",
54+
"wasm": false,
5255
"src": [
5356
"./src/main.c"
5457
],
@@ -66,6 +69,24 @@
6669
},
6770
{
6871
"task": "examples",
72+
"wasm": false,
73+
"src": [
74+
"./src/main.c"
75+
],
76+
"include": [
77+
"./include"
78+
],
79+
"libraries": [],
80+
"libpath": [],
81+
"dependencies": [
82+
"@stdlib/math/base/special/abs",
83+
"@stdlib/blas/base/shared",
84+
"@stdlib/strided/base/stride2offset"
85+
]
86+
},
87+
{
88+
"task": "build",
89+
"wasm": true,
6990
"src": [
7091
"./src/main.c"
7192
],

lib/node_modules/@stdlib/blas/ext/base/wasm/dapxsumkbn2/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ limitations under the License.
2020

2121
# dapxsumkbn2
2222

23-
> Add a scalar constant to each double-precision floating-point strided array element and compute the sum using an improved Kahan–Babuška algorithm.
23+
> Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using a second-order iterative Kahan–Babuška algorithm.
2424
2525
<section class="usage">
2626

@@ -32,7 +32,7 @@ var dapxsumkbn2 = require( '@stdlib/blas/ext/base/wasm/dapxsumkbn2' );
3232

3333
#### dapxsumkbn2.main( N, alpha, x, strideX )
3434

35-
Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using an improved Kahan–Babuška algorithm.
35+
Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using a second-order iterative Kahan–Babuška algorithm.
3636

3737
```javascript
3838
var Float64Array = require( '@stdlib/array/float64' );
@@ -77,7 +77,7 @@ var sum = dapxsumkbn2.main( 4, 5.0, x1, 2 );
7777

7878
#### dapxsumkbn2.ndarray( N, alpha, x, strideX, offsetX )
7979

80-
Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using an improved Kahan–Babuška algorithm and alternative indexing semantics.
80+
Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using a second-order iterative Kahan–Babuška algorithm and alternative indexing semantics.
8181

8282
```javascript
8383
var Float64Array = require( '@stdlib/array/float64' );
@@ -132,7 +132,7 @@ mod.initializeSync();
132132

133133
#### dapxsumkbn2.Module.prototype.main( N, alpha, xp, sx )
134134

135-
Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using an improved Kahan–Babuška algorithm.
135+
Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using a second-order iterative Kahan–Babuška algorithm.
136136

137137
<!-- eslint-disable node/no-sync -->
138138

@@ -180,7 +180,7 @@ The function has the following parameters:
180180

181181
#### dapxsumkbn2.Module.prototype.ndarray( N, alpha, xp, sx, ox )
182182

183-
Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using an improved Kahan–Babuška algorithm and alternative indexing semantics.
183+
Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using a second-order iterative Kahan–Babuška algorithm and alternative indexing semantics.
184184

185185
<!-- eslint-disable node/no-sync -->
186186

lib/node_modules/@stdlib/blas/ext/base/wasm/dapxsumkbn2/benchmark/benchmark.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' );
2626
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2727
var pow = require( '@stdlib/math/base/special/pow' );
2828
var pkg = require( './../package.json' ).name;
29-
var dapxsumkbn = require( './../lib' );
29+
var dapxsumkbn2 = require( './../lib' );
3030

3131

3232
// VARIABLES //
@@ -64,7 +64,7 @@ function createBenchmark( len ) {
6464

6565
b.tic();
6666
for ( i = 0; i < b.iterations; i++ ) {
67-
sum = dapxsumkbn.main( x.length, 5.0, x, 1 );
67+
sum = dapxsumkbn2.main( x.length, 5.0, x, 1 );
6868
if ( isnan( sum ) ) {
6969
b.fail( 'should not return NaN' );
7070
}

lib/node_modules/@stdlib/blas/ext/base/wasm/dapxsumkbn2/benchmark/benchmark.module.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var bench = require( '@stdlib/bench' );
2424
var hasWebAssemblySupport = require( '@stdlib/assert/has-wasm-support' );
2525
var Memory = require( '@stdlib/wasm/memory' );
2626
var pkg = require( './../package.json' ).name;
27-
var dapxsumkbn = require( './../lib' );
27+
var dapxsumkbn2 = require( './../lib' );
2828

2929

3030
// VARIABLES //
@@ -52,7 +52,7 @@ bench( pkg+':Module:constructor', opts, function benchmark( b ) {
5252

5353
b.tic();
5454
for ( i = 0; i < b.iterations; i++ ) {
55-
v = new dapxsumkbn.Module( values[ i%values.length ] );
55+
v = new dapxsumkbn2.Module( values[ i%values.length ] );
5656
if ( typeof v !== 'object' ) {
5757
b.fail( 'should return an object' );
5858
}

lib/node_modules/@stdlib/blas/ext/base/wasm/dapxsumkbn2/benchmark/benchmark.module.main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var uniform = require( '@stdlib/random/array/uniform' );
2828
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2929
var pow = require( '@stdlib/math/base/special/pow' );
3030
var pkg = require( './../package.json' ).name;
31-
var dapxsumkbn = require( './../lib' );
31+
var dapxsumkbn2 = require( './../lib' );
3232

3333

3434
// VARIABLES //
@@ -71,7 +71,7 @@ function createBenchmark( len ) {
7171
mem = new Memory({
7272
'initial': 0
7373
});
74-
mod = new dapxsumkbn.Module( mem );
74+
mod = new dapxsumkbn2.Module( mem );
7575

7676
// Initialize the module:
7777
mod.initializeSync(); // eslint-disable-line node/no-sync

lib/node_modules/@stdlib/blas/ext/base/wasm/dapxsumkbn2/benchmark/benchmark.module.ndarray.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var uniform = require( '@stdlib/random/array/uniform' );
2828
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2929
var pow = require( '@stdlib/math/base/special/pow' );
3030
var pkg = require( './../package.json' ).name;
31-
var dapxsumkbn = require( './../lib' );
31+
var dapxsumkbn2 = require( './../lib' );
3232

3333

3434
// VARIABLES //
@@ -71,7 +71,7 @@ function createBenchmark( len ) {
7171
mem = new Memory({
7272
'initial': 0
7373
});
74-
mod = new dapxsumkbn.Module( mem );
74+
mod = new dapxsumkbn2.Module( mem );
7575

7676
// Initialize the module:
7777
mod.initializeSync(); // eslint-disable-line node/no-sync

lib/node_modules/@stdlib/blas/ext/base/wasm/dapxsumkbn2/benchmark/benchmark.ndarray.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var uniform = require( '@stdlib/random/array/uniform' );
2626
var isnan = require( '@stdlib/math/base/assert/is-nan' );
2727
var pow = require( '@stdlib/math/base/special/pow' );
2828
var pkg = require( './../package.json' ).name;
29-
var dapxsumkbn = require( './../lib' );
29+
var dapxsumkbn2 = require( './../lib' );
3030

3131

3232
// VARIABLES //
@@ -64,7 +64,7 @@ function createBenchmark( len ) {
6464

6565
b.tic();
6666
for ( i = 0; i < b.iterations; i++ ) {
67-
sum = dapxsumkbn.ndarray( x.length, 5.0, x, 1, 0 );
67+
sum = dapxsumkbn2.ndarray( x.length, 5.0, x, 1, 0 );
6868
if ( isnan( sum ) ) {
6969
b.fail( 'should not return NaN' );
7070
}

lib/node_modules/@stdlib/blas/ext/base/wasm/dapxsumkbn2/docs/repl.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
{{alias}}.main( N, alpha, x, strideX )
33
Adds a scalar constant to each double-precision floating-point strided
4-
array element and computes the sum using an improved Kahan–Babuška
5-
algorithm.
4+
array element and computes the sum using a second-order iterative
5+
Kahan–Babuška algorithm.
66

77
The `N` and stride parameters determine which elements in the strided array
88
are accessed at runtime.
@@ -51,9 +51,9 @@
5151

5252

5353
{{alias}}.ndarray( N, alpha, x, strideX, offsetX )
54-
Adds a scalar constant to each double-precision floating-point strided array
55-
element and computes the sum using an improved Kahan–Babuška algorithm and
56-
alternative indexing semantics.
54+
Adds a scalar constant to each double-precision floating-point strided
55+
array element and computes the sum using a second-order iterative
56+
Kahan–Babuška algorithm and alternative indexing semantics.
5757

5858
While typed array views mandate a view offset based on the underlying
5959
buffer, the offset parameter supports indexing semantics based on a starting

lib/node_modules/@stdlib/blas/ext/base/wasm/dapxsumkbn2/docs/types/index.d.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ interface ModuleConstructor {
4343
* });
4444
*
4545
* // Create a BLAS routine:
46-
* var mod = new dapxsumkbn.Module( mem );
46+
* var mod = new dapxsumkbn2.Module( mem );
4747
* // returns <Module>
4848
*
4949
* // Initialize the routine:
@@ -84,7 +84,7 @@ interface ModuleConstructor {
8484
* });
8585
*
8686
* // Create a BLAS routine:
87-
* var mod = dapxsumkbn.Module( mem );
87+
* var mod = dapxsumkbn2.Module( mem );
8888
* // returns <Module>
8989
*
9090
* // Initialize the routine:
@@ -110,11 +110,11 @@ interface ModuleConstructor {
110110
}
111111

112112
/**
113-
* Interface describing a `dapxsumkbn` WebAssembly module.
113+
* Interface describing a `dapxsumkbn2` WebAssembly module.
114114
*/
115115
interface Module extends ModuleWrapper {
116116
/**
117-
* Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using an improved Kahan–Babuška algorithm.
117+
* Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using a second-order iterative Kahan–Babuška algorithm.
118118
*
119119
* @param N - number of indexed elements
120120
* @param alpha - scalar constant
@@ -133,7 +133,7 @@ interface Module extends ModuleWrapper {
133133
* });
134134
*
135135
* // Create a BLAS routine:
136-
* var mod = new dapxsumkbn.Module( mem );
136+
* var mod = new dapxsumkbn2.Module( mem );
137137
* // returns <Module>
138138
*
139139
* // Initialize the routine:
@@ -158,7 +158,7 @@ interface Module extends ModuleWrapper {
158158
main( N: number, alpha: number, xptr: number, strideX: number ): number;
159159

160160
/**
161-
* Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using an improved Kahan–Babuška algorithm and alternative indexing semantics.
161+
* Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using a second-order iterative Kahan–Babuška algorithm and alternative indexing semantics.
162162
*
163163
* @param N - number of indexed elements
164164
* @param alpha - scalar constant
@@ -178,7 +178,7 @@ interface Module extends ModuleWrapper {
178178
* });
179179
*
180180
* // Create a BLAS routine:
181-
* var mod = new dapxsumkbn.Module( mem );
181+
* var mod = new dapxsumkbn2.Module( mem );
182182
* // returns <Module>
183183
*
184184
* // Initialize the routine:
@@ -204,11 +204,11 @@ interface Module extends ModuleWrapper {
204204
}
205205

206206
/**
207-
* Interface describing `dapxsumkbn`.
207+
* Interface describing `dapxsumkbn2`.
208208
*/
209209
interface Routine extends ModuleWrapper {
210210
/**
211-
* Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using an improved Kahan–Babuška algorithm.
211+
* Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using a second-order iterative Kahan–Babuška algorithm.
212212
*
213213
* @param N - number of indexed elements
214214
* @param alpha - scalar constant
@@ -221,13 +221,13 @@ interface Routine extends ModuleWrapper {
221221
*
222222
* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );
223223
*
224-
* var out = dapxsumkbn.main( 3, 5.0, x, 1 );
224+
* var out = dapxsumkbn2.main( 3, 5.0, x, 1 );
225225
* // returns 16.0
226226
*/
227227
main( N: number, alpha: number, x: Float64Array, strideX: number ): number;
228228

229229
/**
230-
* Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using an improved Kahan–Babuška algorithm and alternative indexing semantics.
230+
* Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using a second-order iterative Kahan–Babuška algorithm and alternative indexing semantics.
231231
*
232232
* @param N - number of indexed elements
233233
* @param alpha - scalar constant
@@ -241,7 +241,7 @@ interface Routine extends ModuleWrapper {
241241
*
242242
* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
243243
*
244-
* var out = dapxsumkbn.ndarray( 4, 5.0, x, 2, 1 );
244+
* var out = dapxsumkbn2.ndarray( 4, 5.0, x, 2, 1 );
245245
* // returns 25.0
246246
*/
247247
ndarray( N: number, alpha: number, x: Float64Array, strideX: number, offsetX: number ): number;
@@ -263,7 +263,7 @@ interface Routine extends ModuleWrapper {
263263
* });
264264
*
265265
* // Create a BLAS routine:
266-
* var mod = new dapxsumkbn.Module( mem );
266+
* var mod = new dapxsumkbn2.Module( mem );
267267
* // returns <Module>
268268
*
269269
* // Initialize the routine:
@@ -289,7 +289,7 @@ interface Routine extends ModuleWrapper {
289289
}
290290

291291
/**
292-
* Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using an improved Kahan–Babuška algorithm.
292+
* Adds a scalar constant to each double-precision floating-point strided array element and computes the sum using a second-order iterative Kahan–Babuška algorithm.
293293
*
294294
* @param N - number of indexed elements
295295
* @param alpha - scalar constant
@@ -302,20 +302,20 @@ interface Routine extends ModuleWrapper {
302302
*
303303
* var x = new Float64Array( [ 1.0, -2.0, 2.0 ] );
304304
*
305-
* var out = dapxsumkbn.main( 3, 5.0, x, 1 );
305+
* var out = dapxsumkbn2.main( 3, 5.0, x, 1 );
306306
* // returns 16.0
307307
*
308308
* @example
309309
* var Float64Array = require( '@stdlib/array/float64' );
310310
*
311311
* var x = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
312312
*
313-
* var out = dapxsumkbn.ndarray( 4, 5.0, x, 2, 1 );
313+
* var out = dapxsumkbn2.ndarray( 4, 5.0, x, 2, 1 );
314314
* // returns 25.0
315315
*/
316-
declare var dapxsumkbn: Routine;
316+
declare var dapxsumkbn2: Routine;
317317

318318

319319
// EXPORTS //
320320

321-
export = dapxsumkbn;
321+
export = dapxsumkbn2;

0 commit comments

Comments
 (0)