Skip to content
Merged
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 @@ -20,7 +20,7 @@

// MODULES //

var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );
var f32 = require( '@stdlib/number/float64/base/to-float32' );


// MAIN //
Expand Down Expand Up @@ -58,7 +58,7 @@ function scusumors( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {
ix = offsetX;
iy = offsetY;
for ( i = 0; i < N; i++ ) {
sum = float64ToFloat32( sum + x[ ix ] );
sum = f32( sum + x[ ix ] );
y[ iy ] = sum;
ix += strideX;
iy += strideY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

// MODULES //

var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );
var f32 = require( '@stdlib/number/float64/base/to-float32' );
var floor = require( '@stdlib/math/base/special/floor' );


Expand Down Expand Up @@ -77,8 +77,8 @@ function scusumpw( N, sum, x, strideX, offsetX, y, strideY, offsetY ) {
if ( N <= BLOCKSIZE ) {
s = 0.0;
for ( i = 0; i < N; i++ ) {
s = float64ToFloat32( s + x[ ix ] );
y[ iy ] = float64ToFloat32( sum + s );
s = f32( s + x[ ix ] );
y[ iy ] = f32( sum + s );
ix += strideX;
iy += strideY;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

// MODULES //

var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );
var f32 = require( '@stdlib/number/float64/base/to-float32' );
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
var floor = require( '@stdlib/math/base/special/floor' );

Expand Down Expand Up @@ -81,7 +81,7 @@ function sdsnansumpw( N, x, strideX, offsetX ) {
if ( isnanf( x[ ix ] ) ) {
return 0.0;
}
return float64ToFloat32( N * x[ ix ] );
return f32( N * x[ ix ] );
}
if ( N < 8 ) {
// Use simple summation...
Expand All @@ -92,7 +92,7 @@ function sdsnansumpw( N, x, strideX, offsetX ) {
}
ix += strideX;
}
return float64ToFloat32( s );
return f32( s );
}
if ( N <= BLOCKSIZE ) {
// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...
Expand Down Expand Up @@ -142,12 +142,12 @@ function sdsnansumpw( N, x, strideX, offsetX ) {
}
ix += strideX;
}
return float64ToFloat32( s );
return f32( s );
}
// Recurse by dividing by two, but avoiding non-multiples of unroll factor...
n = floor( N/2 );
n -= n % 8;
return float64ToFloat32( sdsnansumpw( n, x, strideX, ix ) + sdsnansumpw( N-n, x, strideX, ix+(n*strideX) ) ); // eslint-disable-line max-len
return f32( sdsnansumpw( n, x, strideX, ix ) + sdsnansumpw( N-n, x, strideX, ix+(n*strideX) ) ); // eslint-disable-line max-len
}


Expand Down
10 changes: 5 additions & 5 deletions lib/node_modules/@stdlib/blas/ext/base/sdssumpw/lib/ndarray.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

// MODULES //

var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );
var f32 = require( '@stdlib/number/float64/base/to-float32' );
var floor = require( '@stdlib/math/base/special/floor' );


Expand Down Expand Up @@ -77,7 +77,7 @@ function sdssumpw( N, x, strideX, offsetX ) {
}
ix = offsetX;
if ( strideX === 0 ) {
return float64ToFloat32( N * x[ ix ] );
return f32( N * x[ ix ] );
}
if ( N < 8 ) {
// Use simple summation...
Expand All @@ -86,7 +86,7 @@ function sdssumpw( N, x, strideX, offsetX ) {
s += x[ ix ];
ix += strideX;
}
return float64ToFloat32( s );
return f32( s );
}
if ( N <= BLOCKSIZE ) {
// Sum a block with 8 accumulators (by loop unrolling, we lower the effective blocksize to 16)...
Expand Down Expand Up @@ -120,12 +120,12 @@ function sdssumpw( N, x, strideX, offsetX ) {
s += x[ ix ];
ix += strideX;
}
return float64ToFloat32( s );
return f32( s );
}
// Recurse by dividing by two, but avoiding non-multiples of unroll factor...
n = floor( N/2 );
n -= n % 8;
return float64ToFloat32( sdssumpw( n, x, strideX, ix ) + sdssumpw( N-n, x, strideX, ix+(n*strideX) ) ); // eslint-disable-line max-len
return f32( sdssumpw( n, x, strideX, ix ) + sdssumpw( N-n, x, strideX, ix+(n*strideX) ) ); // eslint-disable-line max-len
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

// MODULES //

var float64ToFloat32 = require( '@stdlib/number/float64/base/to-float32' );
var f32 = require( '@stdlib/number/float64/base/to-float32' );
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );


Expand Down Expand Up @@ -61,7 +61,7 @@ function snansumors( N, x, strideX, offsetX ) {
}
for ( i = 0; i < N; i++ ) {
if ( isnanf( x[ ix ] ) === false ) {
sum = float64ToFloat32( sum + x[ ix ] );
sum = f32( sum + x[ ix ] );
}
ix += strideX;
}
Expand Down