Skip to content

feat: add blas/ext/base/wasm/sapxsumkbn #6700

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ import dapxsumkbn = require( './index' );

// Attached to the main export is a `main` method which returns a number...
{
const x = new Float64Array( 10 );
const x = new float32Array( 10 );

dapxsumkbn.main( x.length, 5.0, x, 1 ); // $ExpectType number
}

// The compiler throws an error if the `main` method is provided a first argument which is not a number...
{
const x = new Float64Array( 10 );
const x = new float32Array( 10 );

dapxsumkbn.main( '10', 5.0, x, 1 ); // $ExpectError
dapxsumkbn.main( true, 5.0, x, 1 ); // $ExpectError
Expand All @@ -47,7 +47,7 @@ import dapxsumkbn = require( './index' );

// The compiler throws an error if the `main` method is provided a second argument which is not a number...
{
const x = new Float64Array( 10 );
const x = new float32Array( 10 );

dapxsumkbn.main( x.length, '10', x, 1 ); // $ExpectError
dapxsumkbn.main( x.length, true, x, 1 ); // $ExpectError
Expand All @@ -59,9 +59,9 @@ import dapxsumkbn = require( './index' );
dapxsumkbn.main( x.length, ( x: number ): number => x, x, 1 ); // $ExpectError
}

// The compiler throws an error if the `main` method is provided a third argument which is not a Float64Array...
// The compiler throws an error if the `main` method is provided a third argument which is not a float32Array...
{
const x = new Float64Array( 10 );
const x = new float32Array( 10 );

dapxsumkbn.main( x.length, 5.0, 10, 1 ); // $ExpectError
dapxsumkbn.main( x.length, 5.0, '10', 1 ); // $ExpectError
Expand All @@ -76,7 +76,7 @@ import dapxsumkbn = require( './index' );

// The compiler throws an error if the `main` method is provided a fourth argument which is not a number...
{
const x = new Float64Array( 10 );
const x = new float32Array( 10 );

dapxsumkbn.main( x.length, 5.0, x, '10' ); // $ExpectError
dapxsumkbn.main( x.length, 5.0, x, true ); // $ExpectError
Expand All @@ -90,7 +90,7 @@ import dapxsumkbn = require( './index' );

// The compiler throws an error if the `main` method is provided an unsupported number of arguments...
{
const x = new Float64Array( 10 );
const x = new float32Array( 10 );

dapxsumkbn.main(); // $ExpectError
dapxsumkbn.main( x.length ); // $ExpectError
Expand All @@ -101,14 +101,14 @@ import dapxsumkbn = require( './index' );

// Attached to main export is an `ndarray` method which returns a number...
{
const x = new Float64Array( 10 );
const x = new float32Array( 10 );

dapxsumkbn.ndarray( x.length, 5.0, x, 1, 0 ); // $ExpectType number
}

// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number...
{
const x = new Float64Array( 10 );
const x = new float32Array( 10 );

dapxsumkbn.ndarray( '10', 5.0, x, 1, 0 ); // $ExpectError
dapxsumkbn.ndarray( true, 5.0, x, 1, 0 ); // $ExpectError
Expand All @@ -122,7 +122,7 @@ import dapxsumkbn = require( './index' );

// The compiler throws an error if the `ndarray` method is provided a second argument which is not a number...
{
const x = new Float64Array( 10 );
const x = new float32Array( 10 );

dapxsumkbn.ndarray( x.length, '10', x, 1, 0 ); // $ExpectError
dapxsumkbn.ndarray( x.length, true, x, 1, 0 ); // $ExpectError
Expand All @@ -134,9 +134,9 @@ import dapxsumkbn = require( './index' );
dapxsumkbn.ndarray( x.length, ( x: number ): number => x, x, 1, 0 ); // $ExpectError
}

// The compiler throws an error if the `ndarray` method is provided a third argument which is not a Float64Array...
// The compiler throws an error if the `ndarray` method is provided a third argument which is not a float32Array...
{
const x = new Float64Array( 10 );
const x = new float32Array( 10 );

dapxsumkbn.ndarray( x.length, 5.0, 10, 1, 0 ); // $ExpectError
dapxsumkbn.ndarray( x.length, 5.0, '10', 1, 0 ); // $ExpectError
Expand All @@ -151,7 +151,7 @@ import dapxsumkbn = require( './index' );

// The compiler throws an error if the `ndarray` method is provided a fourth argument which is not a number...
{
const x = new Float64Array( 10 );
const x = new float32Array( 10 );

dapxsumkbn.ndarray( x.length, 5.0, x, '10', 0 ); // $ExpectError
dapxsumkbn.ndarray( x.length, 5.0, x, true, 0 ); // $ExpectError
Expand All @@ -165,7 +165,7 @@ import dapxsumkbn = require( './index' );

// The compiler throws an error if the `ndarray` method is provided a fifth argument which is not a number...
{
const x = new Float64Array( 10 );
const x = new float32Array( 10 );

dapxsumkbn.ndarray( x.length, 5.0, x, 1, '10' ); // $ExpectError
dapxsumkbn.ndarray( x.length, 5.0, x, 1, true ); // $ExpectError
Expand All @@ -179,7 +179,7 @@ import dapxsumkbn = require( './index' );

// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments...
{
const x = new Float64Array( 10 );
const x = new float32Array( 10 );

dapxsumkbn.ndarray(); // $ExpectError
dapxsumkbn.ndarray( x.length ); // $ExpectError
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@
Int32Array before passing the values to this method.

If provided an array having an unknown or "generic" data type, elements are
written as double-precision floating-point numbers.
written as single-precision floating-point numbers.

Parameters
----------
Expand Down Expand Up @@ -396,7 +396,7 @@
after reading memory values using this method.

If provided an output array having an unknown or "generic" data type,
elements are read as double-precision floating-point numbers.
elements are read as single-precision floating-point numbers.

Parameters
----------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@stdlib/blas/base/ext/wasm/sapxsumkbn",
"name": "@stdlib/blas/ext/base/wasm/sapxsumkbn",
"version": "0.0.0",
"description": "Add a constant to each single-precision floating-point strided array element and compute the sum using an improved Kahan–Babuška algorithm.",
"license": "Apache-2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
// MODULES //

var tape = require( 'tape' );
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
var Float32Array = require( '@stdlib/array/float32' );
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
var sapxsumkbn = require( './../lib' );


Expand Down