Skip to content

Commit

Permalink
refactor: support building with API suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
kgryte committed Apr 27, 2024
1 parent 9ff6e8e commit 390f8f4
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ extern "C" {
/**
* Computes the L2-norm of a double-precision floating-point vector.
*/
double c_dnrm2( const CBLAS_INT N, const double *X, const CBLAS_INT stride );
double API_SUFFIX(c_dnrm2)( const CBLAS_INT N, const double *X, const CBLAS_INT stride );

#ifdef __cplusplus
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ extern "C" {
/**
* Computes the L2-norm of a double-precision floating-point vector.
*/
double cblas_dnrm2( const CBLAS_INT N, const double *X, const CBLAS_INT stride );
double API_SUFFIX(cblas_dnrm2)( const CBLAS_INT N, const double *X, const CBLAS_INT stride );

#ifdef __cplusplus
}
Expand Down
3 changes: 2 additions & 1 deletion lib/node_modules/@stdlib/blas/base/dnrm2/src/addon.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

#include "stdlib/blas/base/dnrm2.h"
#include "stdlib/blas/base/shared.h"
#include "stdlib/napi/export.h"
#include "stdlib/napi/argv.h"
#include "stdlib/napi/argv_int64.h"
Expand All @@ -37,7 +38,7 @@ static napi_value addon( napi_env env, napi_callback_info info ) {
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_CREATE_DOUBLE( env, c_dnrm2( N, X, strideX ), v );
STDLIB_NAPI_CREATE_DOUBLE( env, API_SUFFIX(c_dnrm2)( N, X, strideX ), v );
return v;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/node_modules/@stdlib/blas/base/dnrm2/src/dnrm2.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* @param stride stride length
* @return L2-norm
*/
double c_dnrm2( const CBLAS_INT N, const double *X, const CBLAS_INT stride ) {
double API_SUFFIX(c_dnrm2)( const CBLAS_INT N, const double *X, const CBLAS_INT stride ) {
double scale;
double ssq;
double ax;
Expand Down
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/blas/base/dnrm2/src/dnrm2_cblas.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
* @param stride stride length
* @return L2-norm
*/
double c_dnrm2( const CBLAS_INT N, const double *X, const CBLAS_INT stride ) {
return cblas_dnrm2( N, X, stride );
double API_SUFFIX(c_dnrm2)( const CBLAS_INT N, const double *X, const CBLAS_INT stride ) {
return API_SUFFIX(cblas_dnrm2)( N, X, stride );
}
2 changes: 1 addition & 1 deletion lib/node_modules/@stdlib/blas/base/dnrm2/src/dnrm2_f.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* @param stride stride length
* @return L2-norm
*/
double c_dnrm2( const CBLAS_INT N, const double *X, const CBLAS_INT stride ) {
double API_SUFFIX(c_dnrm2)( const CBLAS_INT N, const double *X, const CBLAS_INT stride ) {
double nrm2;
dnrm2sub( &N, X, &stride, &nrm2 );
return nrm2;
Expand Down

0 comments on commit 390f8f4

Please sign in to comment.