Skip to content

Commit

Permalink
build: fix missing configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
kgryte committed Apr 27, 2024
1 parent 1021465 commit a4a1e2a
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 14 deletions.
40 changes: 35 additions & 5 deletions lib/node_modules/@stdlib/blas/ext/base/dsumkbn2/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"options": {},
"options": {
"task": "build"
},
"fields": [
{
"field": "src",
Expand All @@ -24,21 +26,49 @@
],
"confs": [
{
"task": "build",
"src": [
"./src/dsumkbn2.c"
],
"include": [
"./include"
],
"libraries": [
"-lm"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/napi/export",
"@stdlib/napi/argv",
"@stdlib/napi/argv-int64",
"@stdlib/napi/argv-strided-float64array"
"@stdlib/napi/argv-strided-float64array",
"@stdlib/math/base/special/abs"
]
},
{
"task": "benchmark",
"src": [
"./src/dsumkbn2.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/math/base/special/abs"
]
},
{
"task": "examples",
"src": [
"./src/dsumkbn2.c"
],
"include": [
"./include"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/math/base/special/abs"
]
}
]
Expand Down
12 changes: 6 additions & 6 deletions lib/node_modules/@stdlib/blas/ext/base/dsumkbn2/src/addon.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
static napi_value addon( napi_env env, napi_callback_info info ) {
STDLIB_NAPI_ARGV( env, info, argv, argc, 3 );
STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 );
STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 2 );
STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 1 );
STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 2 );
STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 1 );

napi_value v;
napi_create_double( env, stdlib_strided_dsumkbn2( N, X, strideX ), &v );
return v;
napi_value v;
napi_create_double( env, stdlib_strided_dsumkbn2( N, X, strideX ), &v );

return v;
}

STDLIB_NAPI_MODULE_EXPORT_FCN( addon );
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
*/

#include "stdlib/blas/ext/base/dsumkbn2.h"
#include "stdlib/math/base/special/abs.h"
#include <stdint.h>
#include <math.h>

/**
* Computes the sum of double-precision floating-point strided array elements using a second-order iterative Kahan–Babuška algorithm.
Expand Down Expand Up @@ -64,14 +64,14 @@ double stdlib_strided_dsumkbn2( const int64_t N, const double *X, const int64_t
for ( i = 0; i < N; i++ ) {
v = X[ ix ];
t = sum + v;
if ( fabs( sum ) >= fabs( v ) ) {
if ( stdlib_base_abs( sum ) >= stdlib_base_abs( v ) ) {
c = (sum-t) + v;
} else {
c = (v-t) + sum;
}
sum = t;
t = cs + c;
if ( fabs( cs ) >= fabs( c ) ) {
if ( stdlib_base_abs( cs ) >= stdlib_base_abs( c ) ) {
cc = (cs-t) + c;
} else {
cc = (c-t) + cs;
Expand Down

0 comments on commit a4a1e2a

Please sign in to comment.