Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Mar 22, 2024
1 parent f921276 commit 3e1c362
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
2 changes: 2 additions & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ Shubham Mishra <[email protected]>
Snehil Shah <[email protected]>
Spandan Barve <[email protected]>
Stephannie Jiménez Gacha <[email protected]>
Suraj kumar <[email protected]>
Utkarsh <http://[email protected]>
Utkarsh Raj <[email protected]>
Varad Gupta <[email protected]>
Yernar Yergaziyev <[email protected]>
naveen <[email protected]>
nishant-s7 <[email protected]>
orimiles5 <[email protected]>
rei2hu <[email protected]>
14 changes: 9 additions & 5 deletions ext/base/dapxsumkbn/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,6 +26,7 @@
],
"confs": [
{
"task": "build",
"src": [
"./src/dapxsumkbn.c"
],
Expand All @@ -35,10 +38,11 @@
],
"libpath": [],
"dependencies": [
"stdlib/napi/export.h",
"stdlib/napi/argv.h",
"stdlib/napi/argv_int64.h",
"stdlib/napi/argv_strided_float64array.h"
"@stdlib/napi/export",
"@stdlib/napi/argv",
"@stdlib/napi/argv-int64",
"@stdlib/napi/argv-double",
"@stdlib/napi/argv-strided-float64array"
]
},
{
Expand Down
21 changes: 11 additions & 10 deletions ext/base/dapxsumkbn/src/addon.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "stdlib/napi/export.h"
#include "stdlib/napi/argv.h"
#include "stdlib/napi/argv_int64.h"
#include "stdlib/napi/argv_double.h"
#include "stdlib/napi/argv_strided_float64array.h"
#include <node_api.h>
#include <assert.h>
Expand All @@ -33,17 +34,17 @@
* @return Node-API value
*/
static napi_value addon( napi_env env, napi_callback_info info ) {
STDLIB_NAPI_ARGV( env, info, argv, argc, 4 );
STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 );
STDLIB_NAPI_ARGV_DOUBLE( env, alpha, argv, 1 );
STDLIB_NAPI_ARGV_INT64( env, stride, argv, 3 );
STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, stride, argv, 2 );
STDLIB_NAPI_ARGV( env, info, argv, argc, 4 );
STDLIB_NAPI_ARGV_INT64( env, N, argv, 0 );
STDLIB_NAPI_ARGV_DOUBLE( env, alpha, argv, 1 );
STDLIB_NAPI_ARGV_INT64( env, stride, argv, 3 );
STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, stride, argv, 2 );

napi_value v;
napi_status status = napi_create_double( env, stdlib_strided_dapxsumkbn(N, alpha, X, stride), &v );
assert( status == napi_ok );
napi_value v;
napi_status status = napi_create_double( env, stdlib_strided_dapxsumkbn( N, alpha, X, stride ), &v );
assert( status == napi_ok );

return v;
return v;
}

STDLIB_NAPI_MODULE_EXPORT_FCN(addon)
STDLIB_NAPI_MODULE_EXPORT_FCN( addon )

0 comments on commit 3e1c362

Please sign in to comment.