Skip to content
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

fix: update C function names in blas/ext/base/sfill to prevent name collisions #2945

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions lib/node_modules/@stdlib/blas/ext/base/sfill/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,14 @@ console.log( x );
#include "stdlib/blas/ext/base/sfill.h"
```

#### c_sfill( N, alpha, \*X, strideX )
#### stdlib_strided_sfill( N, alpha, \*X, strideX )

Fills a single-precision floating-point strided array `X` with a specified scalar constant `alpha`.

```c
float x[] = { 1.0f, 2.0f, 3.0f, 4.0f };

c_sfill( 4, 5.0f, x, 1 );
stdlib_strided_sfill( 4, 5.0f, x, 1 );

```

Expand All @@ -187,17 +187,17 @@ The function accepts the following arguments:
- **strideX**: `[in] CBLAS_INT` index increment for `X`.

```c
void c_sfill( const CBLAS_INT N, const float alpha, float *X, const CBLAS_INT strideX );
void stdlib_strided_sfill( const CBLAS_INT N, const float alpha, float *X, const CBLAS_INT strideX );
```

#### c_sfill_ndarray( N, alpha, \*X, strideX, offsetX )
#### stdlib_strided_sfill_ndarray( N, alpha, \*X, strideX, offsetX )

Fills a single-precision floating-point strided array `X` with a specified scalar constant `alpha` using alternative indexing semantics.

```c
float x[] = { 1.0f, 2.0f, 3.0f, 4.0f };

c_sfill_ndarray( 4, 5.0f, x, 1, 0 );
stdlib_strided_sfill_ndarray( 4, 5.0f, x, 1, 0 );
```

The function accepts the following arguments:
Expand All @@ -209,7 +209,7 @@ The function accepts the following arguments:
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.

```c
void c_sfill_ndarray( const CBLAS_INT N, const float alpha, float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );
void stdlib_strided_sfill_ndarray( const CBLAS_INT N, const float alpha, float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );
```

</section>
Expand Down Expand Up @@ -245,7 +245,7 @@ int main( void ) {
const int strideX = 1;

// Fill the array:
c_sfill( N, 5.0f, x, strideX );
stdlib_strided_sfill( N, 5.0f, x, strideX );

// Print the result:
for ( int i = 0; i < 8; i++ ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ static double benchmark1( int iterations, int len ) {
}
t = tic();
for ( i = 0; i < iterations; i++ ) {
c_sfill( len, (float)i, x, 1 );
stdlib_strided_sfill( len, (float)i, x, 1 );
if ( x[ 0 ] != x[ 0 ] ) {
printf( "should not return NaN\n" );
break;
Expand Down Expand Up @@ -136,7 +136,7 @@ static double benchmark2( int iterations, int len ) {
}
t = tic();
for ( i = 0; i < iterations; i++ ) {
c_sfill_ndarray( len, (float)i, x, 1, 0 );
stdlib_strided_sfill_ndarray( len, (float)i, x, 1, 0 );
if ( x[ 0 ] != x[ 0 ] ) {
printf( "should not return NaN\n" );
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ int main( void ) {
const int strideX = 1;

// Fill the array:
c_sfill( N, 5.0f, x, strideX );
stdlib_strided_sfill( N, 5.0f, x, strideX );

// Print the result:
for ( int i = 0; i < 8; i++ ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
var sfill = require( './../lib' );

var x = discreteUniform( 10, -100, {
var x = discreteUniform( 10, -100, 100, {
'dtype': 'float32'
});
console.log( x );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ extern "C" {
/**
* Fills a single-precision floating-point strided array with a specified scalar constant.
*/
void API_SUFFIX(c_sfill)( const CBLAS_INT N, const float alpha, float *X, const CBLAS_INT strideX );
void API_SUFFIX(stdlib_strided_sfill)( const CBLAS_INT N, const float alpha, float *X, const CBLAS_INT strideX );

/**
* Fills a single-precision floating-point strided array with a specified scalar constant using alternative indexing semantics.
*/
void API_SUFFIX(c_sfill_ndarray)( const CBLAS_INT N, const float alpha, float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );
void API_SUFFIX(stdlib_strided_sfill_ndarray)( const CBLAS_INT N, const float alpha, float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX );

#ifdef __cplusplus
}
Expand Down
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/blas/ext/base/sfill/src/addon.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static napi_value addon( napi_env env, napi_callback_info info ) {
STDLIB_NAPI_ARGV_FLOAT( env, alpha, argv, 1 );
STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 3 );
STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, strideX, argv, 2 );
API_SUFFIX(c_sfill)( N, alpha, X, strideX );
API_SUFFIX(stdlib_strided_sfill)( N, alpha, X, strideX );
return NULL;
}

Expand All @@ -56,7 +56,7 @@ static napi_value addon_method( napi_env env, napi_callback_info info ) {
STDLIB_NAPI_ARGV_INT64( env, strideX, argv, 3 );
STDLIB_NAPI_ARGV_INT64( env, offsetX, argv, 4 );
STDLIB_NAPI_ARGV_STRIDED_FLOAT32ARRAY( env, X, N, strideX, argv, 2 );
API_SUFFIX(c_sfill_ndarray)( N, alpha, X, strideX, offsetX );
API_SUFFIX(stdlib_strided_sfill_ndarray)( N, alpha, X, strideX, offsetX );
return NULL;
}

Expand Down
6 changes: 3 additions & 3 deletions lib/node_modules/@stdlib/blas/ext/base/sfill/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
* @param strideX index increment
*/

void API_SUFFIX(c_sfill)( const CBLAS_INT N, const float alpha, float *X, const CBLAS_INT strideX ) {
void API_SUFFIX(stdlib_strided_sfill)( const CBLAS_INT N, const float alpha, float *X, const CBLAS_INT strideX ) {
CBLAS_INT ox = stdlib_strided_stride2offset( N, strideX );
API_SUFFIX(c_sfill_ndarray)( N, alpha, X, strideX, ox );
API_SUFFIX(stdlib_strided_sfill_ndarray)( N, alpha, X, strideX, ox );
}

/**
Expand All @@ -43,7 +43,7 @@ void API_SUFFIX(c_sfill)( const CBLAS_INT N, const float alpha, float *X, const
* @param strideX index increment
* @param offsetX starting index
*/
void API_SUFFIX(c_sfill_ndarray)( const CBLAS_INT N, const float alpha, float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) {
void API_SUFFIX(stdlib_strided_sfill_ndarray)( const CBLAS_INT N, const float alpha, float *X, const CBLAS_INT strideX, const CBLAS_INT offsetX ) {
CBLAS_INT ix;
CBLAS_INT m;
CBLAS_INT i;
Expand Down
Loading