Skip to content

Commit 4458c49

Browse files
authored
fix: extract the scalar constant as a float in blas/ext/base/dsapxsum
PR-URL: #3254 Reviewed-by: Athan Reines <kgryte@gmail.com>
1 parent bff0533 commit 4458c49

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

lib/node_modules/@stdlib/blas/ext/base/dsapxsum/src/addon.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "stdlib/napi/export.h"
2222
#include "stdlib/napi/argv.h"
2323
#include "stdlib/napi/argv_int64.h"
24-
#include "stdlib/napi/argv_double.h"
24+
#include "stdlib/napi/argv_float.h"
2525
#include "stdlib/napi/argv_strided_float32array.h"
2626
#include "stdlib/napi/create_double.h"
2727
#include <node_api.h>
@@ -36,7 +36,7 @@
3636
static napi_value addon( napi_env env, napi_callback_info info ) {
3737
STDLIB_NAPI_ARGV( env, info, argv, argc, 4 );
3838
STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 );
39-
STDLIB_NAPI_ARGV_DOUBLE( env, alpha, argv, 1 );
39+
STDLIB_NAPI_ARGV_FLOAT( env, alpha, argv, 1 );
4040
STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 3 );
4141
STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, strideX, argv, 2 );
4242
STDLIB_NAPI_CREATE_DOUBLE( env, API_SUFFIX(stdlib_strided_dsapxsum)( N, alpha, X, strideX ), v );
@@ -53,7 +53,7 @@ static napi_value addon( napi_env env, napi_callback_info info ) {
5353
static napi_value addon_method( napi_env env, napi_callback_info info ) {
5454
STDLIB_NAPI_ARGV( env, info, argv, argc, 5 );
5555
STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 );
56-
STDLIB_NAPI_ARGV_DOUBLE( env, alpha, argv, 1 );
56+
STDLIB_NAPI_ARGV_FLOAT( env, alpha, argv, 1 );
5757
STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 3 );
5858
STDLIB_NAPI_ARGV_INT64( env, offsetX, argv, 4 );
5959
STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, strideX, argv, 2 );

lib/node_modules/@stdlib/blas/ext/base/dsapxsum/src/main.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
/**
2525
* Adds a scalar constant to each single-precision floating-point strided array element, and computes the sum using extended accumulation and returning an extended precision result.
2626
*
27-
* @param N number of indexed elements
28-
* @param alpha scalar constant
29-
* @param X input array
27+
* @param N number of indexed elements
28+
* @param alpha scalar constant
29+
* @param X input array
3030
* @param strideX stride length
31-
* @return output value
31+
* @return output value
3232
*/
3333
double API_SUFFIX(stdlib_strided_dsapxsum)( const CBLAS_INT N, const float alpha, const float *X, const CBLAS_INT strideX ) {
3434
CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX );
@@ -38,12 +38,12 @@ double API_SUFFIX(stdlib_strided_dsapxsum)( const CBLAS_INT N, const float alpha
3838
/**
3939
* Adds a scalar constant to each single-precision floating-point strided array element, and computes the sum using extended accumulation and using alternative indexing semantics and returning an extended precision result.
4040
*
41-
* @param N number of indexed elements
42-
* @param alpha scalar constant
43-
* @param X input array
41+
* @param N number of indexed elements
42+
* @param alpha scalar constant
43+
* @param X input array
4444
* @param strideX stride length
4545
* @param offsetX starting index
46-
* @return output value
46+
* @return output value
4747
*/
4848
double API_SUFFIX(stdlib_strided_dsapxsum_ndarray)( const CBLAS_INT N, const float alpha, const float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) {
4949
return API_SUFFIX(stdlib_strided_dsapxsumpw_ndarray)( N, alpha, X, strideX, offsetX );

0 commit comments

Comments
 (0)