From 769a07bb8cdf1423b04adb7b5ffc5c707e2a32ea Mon Sep 17 00:00:00 2001 From: opbot_xd Date: Fri, 5 Dec 2025 16:28:24 +0530 Subject: [PATCH 1/5] bench: refactor to use dynamic memory allocation in `blas/base/isamax` --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../blas/base/isamax/benchmark/c/benchmark.length.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/isamax/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/isamax/benchmark/c/benchmark.length.c index 3ba6a878b31b..2b521025dfc1 100644 --- a/lib/node_modules/@stdlib/blas/base/isamax/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/isamax/benchmark/c/benchmark.length.c @@ -96,11 +96,12 @@ static float rand_float( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - float x[ len ]; + float *x; double t; int idx; int i; + x = (float *)malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_float()*20000.0f ) - 10000.0f; } @@ -117,6 +118,7 @@ static double benchmark1( int iterations, int len ) { if ( idx < -2 ) { printf( "unexpected result\n" ); } + free( x ); return elapsed; } @@ -129,11 +131,12 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - float x[ len ]; + float *x; double t; int idx; int i; + x = (float *)malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_float()*20000.0f ) - 10000.0f; } @@ -150,6 +153,7 @@ static double benchmark2( int iterations, int len ) { if ( idx < -2 ) { printf( "unexpected result\n" ); } + free( x ); return elapsed; } From f86a874fe24591c5e861a82614ffdb249b224db7 Mon Sep 17 00:00:00 2001 From: opbot_xd Date: Fri, 5 Dec 2025 16:32:48 +0530 Subject: [PATCH 2/5] bench: refactor to use dynamic memory allocation in `blas/base/sasum` --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../blas/base/sasum/benchmark/c/benchmark.length.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/sasum/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/sasum/benchmark/c/benchmark.length.c index eb649800e680..b0cce5723604 100644 --- a/lib/node_modules/@stdlib/blas/base/sasum/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/sasum/benchmark/c/benchmark.length.c @@ -96,11 +96,12 @@ static float rand_float( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - float x[ len ]; + float *x; float y; double t; int i; + x = (float *)malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_float()*20000.0f ) - 10000.0f; } @@ -117,6 +118,7 @@ static double benchmark1( int iterations, int len ) { if ( y != y ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } @@ -129,11 +131,12 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - float x[ len ]; + float *x; float y; double t; int i; + x = (float *)malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_float()*20000.0f ) - 10000.0f; } @@ -150,6 +153,7 @@ static double benchmark2( int iterations, int len ) { if ( y != y ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } From 1d8eb865695ceb26e1c3603a7828e87716fbe7ec Mon Sep 17 00:00:00 2001 From: opbot_xd Date: Fri, 5 Dec 2025 16:35:23 +0530 Subject: [PATCH 3/5] bench: refactor to use dynamic memory allocation in `blas/base/snrm2` --- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- .../blas/base/snrm2/benchmark/c/benchmark.length.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/snrm2/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/snrm2/benchmark/c/benchmark.length.c index 0e5b3f34d89e..2ba15f4a6323 100644 --- a/lib/node_modules/@stdlib/blas/base/snrm2/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/snrm2/benchmark/c/benchmark.length.c @@ -96,11 +96,12 @@ static float rand_float( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - float x[ len ]; + float *x; float z; double t; int i; + x = (float *)malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_float() * 20000.0f ) - 10000.0f; } @@ -117,6 +118,7 @@ static double benchmark1( int iterations, int len ) { if ( z != z ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } @@ -129,11 +131,12 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - float x[ len ]; + float *x; float z; double t; int i; + x = (float *)malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_float() * 20000.0f ) - 10000.0f; } @@ -150,6 +153,7 @@ static double benchmark2( int iterations, int len ) { if ( z != z ) { printf( "should not return NaN\n" ); } + free( x ); return elapsed; } From 855ad6d4d3f092f78127f83db9a3be46a0ccfbe0 Mon Sep 17 00:00:00 2001 From: Athan Date: Fri, 5 Dec 2025 03:52:45 -0800 Subject: [PATCH 4/5] Discard changes to lib/node_modules/@stdlib/blas/base/isamax/benchmark/c/benchmark.length.c --- .../blas/base/isamax/benchmark/c/benchmark.length.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/isamax/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/isamax/benchmark/c/benchmark.length.c index 2b521025dfc1..3ba6a878b31b 100644 --- a/lib/node_modules/@stdlib/blas/base/isamax/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/isamax/benchmark/c/benchmark.length.c @@ -96,12 +96,11 @@ static float rand_float( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - float *x; + float x[ len ]; double t; int idx; int i; - x = (float *)malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_float()*20000.0f ) - 10000.0f; } @@ -118,7 +117,6 @@ static double benchmark1( int iterations, int len ) { if ( idx < -2 ) { printf( "unexpected result\n" ); } - free( x ); return elapsed; } @@ -131,12 +129,11 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - float *x; + float x[ len ]; double t; int idx; int i; - x = (float *)malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_float()*20000.0f ) - 10000.0f; } @@ -153,7 +150,6 @@ static double benchmark2( int iterations, int len ) { if ( idx < -2 ) { printf( "unexpected result\n" ); } - free( x ); return elapsed; } From 16d00063f2d2a6ace9bb496fecce386a91c5a2c5 Mon Sep 17 00:00:00 2001 From: Athan Date: Fri, 5 Dec 2025 03:52:54 -0800 Subject: [PATCH 5/5] Discard changes to lib/node_modules/@stdlib/blas/base/sasum/benchmark/c/benchmark.length.c --- .../blas/base/sasum/benchmark/c/benchmark.length.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/sasum/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/sasum/benchmark/c/benchmark.length.c index b0cce5723604..eb649800e680 100644 --- a/lib/node_modules/@stdlib/blas/base/sasum/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/sasum/benchmark/c/benchmark.length.c @@ -96,12 +96,11 @@ static float rand_float( void ) { */ static double benchmark1( int iterations, int len ) { double elapsed; - float *x; + float x[ len ]; float y; double t; int i; - x = (float *)malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_float()*20000.0f ) - 10000.0f; } @@ -118,7 +117,6 @@ static double benchmark1( int iterations, int len ) { if ( y != y ) { printf( "should not return NaN\n" ); } - free( x ); return elapsed; } @@ -131,12 +129,11 @@ static double benchmark1( int iterations, int len ) { */ static double benchmark2( int iterations, int len ) { double elapsed; - float *x; + float x[ len ]; float y; double t; int i; - x = (float *)malloc( len * sizeof( float ) ); for ( i = 0; i < len; i++ ) { x[ i ] = ( rand_float()*20000.0f ) - 10000.0f; } @@ -153,7 +150,6 @@ static double benchmark2( int iterations, int len ) { if ( y != y ) { printf( "should not return NaN\n" ); } - free( x ); return elapsed; }