-
-
Notifications
You must be signed in to change notification settings - Fork 836
refactor: update blas/ext/base/dapxsum
to follow current project conventions
#1793
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
Changes from 1 commit
f42e542
cbfef39
d5e42f3
f22648c
a6d964e
92f0d22
aaaeded
ea14302
4c9f48a
7ec7491
dd8a81e
5c922e8
4a154cf
8e49951
f2a2a9d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,10 @@ | |
], | ||
"libpath": [], | ||
"dependencies": [ | ||
"@stdlib/napi/export", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file has mixed TABS and spaces. The indentation should be 2-space. This file is also missing separate build configurations for benchmarks and examples. See, e.g., https://github.com/stdlib-js/stdlib/blob/develop/lib/node_modules/%40stdlib/blas/ext/base/dapxsumors/manifest.json. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added the missing confs. |
||
"@stdlib/napi/argv", | ||
"@stdlib/napi/argv-float", | ||
kgryte marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"@stdlib/napi/argv-int64", | ||
"@stdlib/blas/ext/base/dapxsumkbn" | ||
] | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/** | ||
* @license Apache-2.0 | ||
* | ||
* Copyright (c) 2020 The Stdlib Authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#include "stdlib/blas/ext/base/dapxsum.h" | ||
#include "stdlib/napi/export.h" | ||
#include "stdlib/napi/argv.h" | ||
#include "stdlib/napi/argv_int64.h" | ||
kgryte marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#include "stdlib/napi/argv_strided_float32array.h" | ||
kgryte marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#include <node_api.h> | ||
#include <assert.h> | ||
|
||
/** | ||
* Receives JavaScript callback invocation data. | ||
* | ||
* @private | ||
* @param env environment under which the function is invoked | ||
* @param info callback data | ||
* @return Node-API value | ||
*/ | ||
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 ); | ||
kgryte marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
napi_value v; | ||
napi_status status = napi_create_double( env, stdlib_strided_dapxsum( N, alpha, X, stride ), &v ); | ||
assert( status == napi_ok ); | ||
|
||
return v; | ||
} | ||
|
||
STDLIB_NAPI_MODULE_EXPORT_FCN( addon ) |
Uh oh!
There was an error while loading. Please reload this page.