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 2efa65e commit 3da4848
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" {
/**
* Multiplies a vector `X` by a constant and adds the result to `Y`.
*/
void c_daxpy( const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *Y, const CBLAS_INT strideY );
void API_SUFFIX(c_daxpy)( const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *Y, const CBLAS_INT strideY );

#ifdef __cplusplus
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ extern "C" {
/**
* Multiplies a vector `X` by a constant and adds the result to `Y`.
*/
void cblas_daxpy( const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *Y, const CBLAS_INT strideY );
void API_SUFFIX(cblas_daxpy)( const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *Y, const CBLAS_INT strideY );

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

#include "stdlib/blas/base/daxpy.h"
#include "stdlib/blas/base/shared.h"
#include "stdlib/napi/export.h"
#include "stdlib/napi/argv.h"
#include "stdlib/napi/argv_double.h"
Expand All @@ -40,7 +41,7 @@ static napi_value addon( napi_env env, napi_callback_info info ) {
STDLIB_NAPI_ARGV_INT64( env, strideY, argv, 5 );
STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, X, N, strideX, argv, 2 );
STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY( env, Y, N, strideY, argv, 4 );
c_daxpy( N, alpha, X, strideX, Y, strideY );
API_SUFFIX(c_daxpy)( N, alpha, X, strideX, Y, strideY );
return NULL;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/node_modules/@stdlib/blas/base/daxpy/src/daxpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* @param Y output array
* @param strideY Y stride length
*/
void c_daxpy( const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *Y, const CBLAS_INT strideY ) {
void API_SUFFIX(c_daxpy)( const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *Y, const CBLAS_INT strideY ) {
CBLAS_INT ix;
CBLAS_INT iy;
CBLAS_INT i;
Expand Down
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/blas/base/daxpy/src/daxpy_cblas.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
* @param Y output array
* @param strideY Y stride length
*/
void c_daxpy( const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *Y, const CBLAS_INT strideY ) {
cblas_daxpy( N, alpha, X, strideX, Y, strideY );
void API_SUFFIX(c_daxpy)( const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *Y, const CBLAS_INT strideY ) {
API_SUFFIX(cblas_daxpy)( N, alpha, X, strideX, Y, strideY );
}
2 changes: 1 addition & 1 deletion lib/node_modules/@stdlib/blas/base/daxpy/src/daxpy_f.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
* @param Y output array
* @param strideY Y stride length
*/
void c_daxpy( const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *Y, const CBLAS_INT strideY ) {
void API_SUFFIX(c_daxpy)( const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *Y, const CBLAS_INT strideY ) {
daxpy( &N, &alpha, X, &strideX, Y, &strideY );
}

0 comments on commit 3da4848

Please sign in to comment.