From 039dd4c971dd9b060e9c83156a1aed0fec7cd2c1 Mon Sep 17 00:00:00 2001 From: DhruvArvindSingh Date: Wed, 8 Apr 2026 18:46:33 +0530 Subject: [PATCH 1/6] feat: adds C and fortran implmentation of blas/base/dgemm --- 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: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: missing_dependencies - task: lint_c_examples status: missing_dependencies - 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 --- --- .../@stdlib/blas/base/dgemm/README.md | 160 +- ...nchmark_ca_cb_cc_nta_ntb.ndarray.native.js | 111 ++ ...enchmark_ca_cb_cc_nta_tb.ndarray.native.js | 111 ++ ...enchmark_ca_cb_cc_ta_ntb.ndarray.native.js | 111 ++ ...benchmark_ca_cb_cc_ta_tb.ndarray.native.js | 111 ++ ...nchmark_ca_cb_rc_nta_ntb.ndarray.native.js | 111 ++ ...enchmark_ca_cb_rc_nta_tb.ndarray.native.js | 111 ++ ...enchmark_ca_cb_rc_ta_ntb.ndarray.native.js | 111 ++ ...benchmark_ca_cb_rc_ta_tb.ndarray.native.js | 111 ++ ...nchmark_ca_rb_cc_nta_ntb.ndarray.native.js | 111 ++ ...enchmark_ca_rb_cc_nta_tb.ndarray.native.js | 111 ++ ...enchmark_ca_rb_cc_ta_ntb.ndarray.native.js | 111 ++ ...benchmark_ca_rb_cc_ta_tb.ndarray.native.js | 111 ++ ...nchmark_ca_rb_rc_nta_ntb.ndarray.native.js | 111 ++ ...enchmark_ca_rb_rc_nta_tb.ndarray.native.js | 111 ++ ...enchmark_ca_rb_rc_ta_ntb.ndarray.native.js | 111 ++ ...benchmark_ca_rb_rc_ta_tb.ndarray.native.js | 111 ++ .../benchmark_column_major_nta_ntb.native.js | 111 ++ .../benchmark_column_major_nta_tb.native.js | 111 ++ .../benchmark_column_major_ta_ntb.native.js | 111 ++ .../benchmark_column_major_ta_tb.native.js | 111 ++ ...nchmark_ra_cb_cc_nta_ntb.ndarray.native.js | 111 ++ ...enchmark_ra_cb_cc_nta_tb.ndarray.native.js | 111 ++ ...enchmark_ra_cb_cc_ta_ntb.ndarray.native.js | 111 ++ ...benchmark_ra_cb_cc_ta_tb.ndarray.native.js | 111 ++ ...nchmark_ra_cb_rc_nta_ntb.ndarray.native.js | 111 ++ ...enchmark_ra_cb_rc_nta_tb.ndarray.native.js | 111 ++ ...enchmark_ra_cb_rc_ta_ntb.ndarray.native.js | 111 ++ ...benchmark_ra_cb_rc_ta_tb.ndarray.native.js | 111 ++ ...nchmark_ra_rb_cc_nta_ntb.ndarray.native.js | 111 ++ ...enchmark_ra_rb_cc_nta_tb.ndarray.native.js | 111 ++ ...enchmark_ra_rb_cc_ta_ntb.ndarray.native.js | 111 ++ ...benchmark_ra_rb_cc_ta_tb.ndarray.native.js | 111 ++ ...nchmark_ra_rb_rc_nta_ntb.ndarray.native.js | 111 ++ ...enchmark_ra_rb_rc_nta_tb.ndarray.native.js | 111 ++ ...enchmark_ra_rb_rc_ta_ntb.ndarray.native.js | 111 ++ ...benchmark_ra_rb_rc_ta_tb.ndarray.native.js | 111 ++ .../benchmark_row_major_nta_ntb.native.js | 111 ++ .../benchmark_row_major_nta_tb.native.js | 111 ++ .../benchmark_row_major_ta_ntb.native.js | 111 ++ .../benchmark_row_major_ta_tb.native.js | 111 ++ .../blas/base/dgemm/benchmark/c/Makefile | 146 ++ .../base/dgemm/benchmark/c/benchmark.length.c | 208 +++ .../base/dgemm/benchmark/fortran/Makefile | 141 ++ .../benchmark/fortran/benchmark.length.f | 218 +++ .../@stdlib/blas/base/dgemm/binding.gyp | 265 +++ .../blas/base/dgemm/examples/c/Makefile | 146 ++ .../blas/base/dgemm/examples/c/example.c | 57 + .../@stdlib/blas/base/dgemm/include.gypi | 70 + .../dgemm/include/stdlib/blas/base/dgemm.h | 48 + .../include/stdlib/blas/base/dgemm_cblas.h | 43 + .../include/stdlib/blas/base/dgemm_fortran.h | 41 + .../blas/base/dgemm/lib/dgemm.native.js | 134 ++ .../@stdlib/blas/base/dgemm/lib/native.js | 35 + .../blas/base/dgemm/lib/ndarray.native.js | 99 ++ .../@stdlib/blas/base/dgemm/manifest.json | 458 +++++ .../@stdlib/blas/base/dgemm/src/Makefile | 70 + .../@stdlib/blas/base/dgemm/src/addon.c | 210 +++ .../@stdlib/blas/base/dgemm/src/dgemm.c | 132 ++ .../@stdlib/blas/base/dgemm/src/dgemm.f | 239 +++ .../@stdlib/blas/base/dgemm/src/dgemm_cblas.c | 43 + .../@stdlib/blas/base/dgemm/src/dgemm_f.c | 74 + .../blas/base/dgemm/src/dgemm_ndarray.c | 141 ++ .../blas/base/dgemm/test/test.dgemm.native.js | 714 ++++++++ .../base/dgemm/test/test.ndarray.native.js | 1496 +++++++++++++++++ 65 files changed, 9821 insertions(+), 7 deletions(-) create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_nta_ntb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_nta_tb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_ta_ntb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_ta_tb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_nta_ntb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_nta_tb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_ta_ntb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_ta_tb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_nta_ntb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_nta_tb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_ta_ntb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_ta_tb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_nta_ntb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_nta_tb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_ta_ntb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_ta_tb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_nta_ntb.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_nta_tb.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_ta_ntb.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_ta_tb.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_nta_ntb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_nta_tb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_ta_ntb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_ta_tb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_nta_ntb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_nta_tb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_ta_ntb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_ta_tb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_nta_ntb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_nta_tb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_ta_ntb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_ta_tb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_nta_ntb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_nta_tb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_ta_ntb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_ta_tb.ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_nta_ntb.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_nta_tb.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_ta_ntb.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_ta_tb.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/c/Makefile create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/c/benchmark.length.c create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/fortran/Makefile create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/benchmark/fortran/benchmark.length.f create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/binding.gyp create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/examples/c/Makefile create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/examples/c/example.c create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/include.gypi create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/include/stdlib/blas/base/dgemm.h create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/include/stdlib/blas/base/dgemm_cblas.h create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/include/stdlib/blas/base/dgemm_fortran.h create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/lib/dgemm.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/lib/native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/lib/ndarray.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/manifest.json create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/src/Makefile create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/src/addon.c create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm.c create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm.f create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm_cblas.c create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm_f.c create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm_ndarray.c create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/test/test.dgemm.native.js create mode 100644 lib/node_modules/@stdlib/blas/base/dgemm/test/test.ndarray.native.js diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/README.md b/lib/node_modules/@stdlib/blas/base/dgemm/README.md index b8bd1feb27e0..40a2a189d108 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/README.md +++ b/lib/node_modules/@stdlib/blas/base/dgemm/README.md @@ -22,6 +22,12 @@ limitations under the License. > Perform the matrix-matrix operation `C = α*op(A)*op(B) + β*C` where `op(X)` is one of the `op(X) = X`, or `op(X) = X^T`. +
+ +
+ + +
## Usage @@ -62,7 +68,7 @@ The function has the following parameters: - **C**: third input matrix stored in linear memory as a [`Float64Array`][mdn-float64array]. - **ldc**: stride of the first dimension of `C` (leading dimension of `C`). -The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to perform matrix multiplication of two subarrays +The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to perform matrix multiplication of two subarrays, ```javascript var Float64Array = require( '@stdlib/array/float64' ); @@ -75,6 +81,27 @@ dgemm( 'row-major', 'no-transpose', 'no-transpose', 2, 2, 2, 1.0, A, 4, B, 4, 1. // C => [ 2.0, 5.0, 6.0, 11.0 ] ``` +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + + + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +// Initial arrays (with extra leading element to be skipped): +var A0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0 ] ); +var B0 = new Float64Array( [ 0.0, 1.0, 1.0, 0.0, 1.0 ] ); +var C0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0, 4.0 ] ); + +// Create offset views... +var A1 = new Float64Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +var B1 = new Float64Array( B0.buffer, B0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +var C1 = new Float64Array( C0.buffer, C0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +dgemm( 'row-major', 'no-transpose', 'no-transpose', 2, 2, 2, 1.0, A1, 2, B1, 2, 1.0, C1, 2 ); +// C0 => [ 0.0, 2.0, 5.0, 6.0, 11.0 ] +``` + #### dgemm.ndarray( ta, tb, M, N, K, α, A, sa1, sa2, oa, B, sb1, sb2, ob, β, C, sc1, sc2, oc ) @@ -190,18 +217,99 @@ console.log( C ); #include "stdlib/blas/base/dgemm.h" ``` -#### TODO +#### c_dgemm( layout, transA, transB, M, N, K, alpha, \*A, LDA, \*B, LDB, beta, \*C, LDC ) -TODO. +Performs the matrix-matrix operation `C = alpha*op(A)*op(B) + beta*C`, where `op(X)` is either `op(X) = X` or `op(X) = X^T`, `alpha` and `beta` are scalars, and `A`, `B`, and `C` are matrices, with `op(A)` an `M`-by-`K` matrix, `op(B)` a `K`-by-`N` matrix, and `C` an `M`-by-`N` matrix. ```c -TODO +#include "stdlib/blas/base/shared.h" + +double A[ 2*3 ] = { + 1.0, 2.0, 3.0, + 4.0, 5.0, 6.0 +}; +double B[ 3*2 ] = { + 7.0, 8.0, + 9.0, 10.0, + 11.0, 12.0 +}; +double C[ 2*2 ] = { + 0.0, 0.0, + 0.0, 0.0 +}; + +c_dgemm( CblasRowMajor, CblasNoTrans, CblasNoTrans, 2, 2, 3, 1.0, A, 3, B, 2, 0.0, C, 2 ); ``` -TODO +The function accepts the following arguments: + +- **layout**: `[in] CBLAS_LAYOUT` storage layout. +- **transA**: `[in] CBLAS_TRANSPOSE` specifies whether `A` should be transposed, conjugate-transposed, or not transposed. +- **transB**: `[in] CBLAS_TRANSPOSE` specifies whether `B` should be transposed, conjugate-transposed, or not transposed. +- **M**: `[in] CBLAS_INT` number of rows in the matrix `op(A)` and in the matrix `C`. +- **N**: `[in] CBLAS_INT` number of columns in the matrix `op(B)` and in the matrix `C`. +- **K**: `[in] CBLAS_INT` number of columns in the matrix `op(A)` and number of rows in the matrix `op(B)`. +- **alpha**: `[in] double` scalar constant. +- **A**: `[in] double*` first input matrix. +- **LDA**: `[in] CBLAS_INT` stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). +- **B**: `[in] double*` second input matrix. +- **LDB**: `[in] CBLAS_INT` stride of the first dimension of `B` (a.k.a., leading dimension of the matrix `B`). +- **beta**: `[in] double` scalar constant. +- **C**: `[inout] double*` result matrix. +- **LDC**: `[in] CBLAS_INT` stride of the first dimension of `C` (a.k.a., leading dimension of the matrix `C`). ```c -TODO +void c_dgemm( const CBLAS_LAYOUT layout, const CBLAS_TRANSPOSE transA, const CBLAS_TRANSPOSE transB, const CBLAS_INT M, const CBLAS_INT N, const CBLAS_INT K, const double alpha, const double *A, const CBLAS_INT LDA, const double *B, const CBLAS_INT LDB, const double beta, double *C, const CBLAS_INT LDC ); +``` + +#### c_dgemm_ndarray( transA, transB, M, N, K, alpha, \*A, sa1, sa2, oa, \*B, sb1, sb2, ob, beta, \*C, sc1, sc2, oc ) + +Performs the matrix-matrix operation `C = alpha*op(A)*op(B) + beta*C`, using alternative indexing semantics and where `op(X)` is either `op(X) = X` or `op(X) = X^T`, `alpha` and `beta` are scalars, and `A`, `B`, and `C` are matrices, with `op(A)` an `M`-by-`K` matrix, `op(B)` a `K`-by-`N` matrix, and `C` an `M`-by-`N` matrix. + +```c +#include "stdlib/blas/base/shared.h" + +double A[ 2*3 ] = { + 1.0, 2.0, 3.0, + 4.0, 5.0, 6.0 +}; +double B[ 3*2 ] = { + 7.0, 8.0, + 9.0, 10.0, + 11.0, 12.0 +}; +double C[ 2*2 ] = { + 0.0, 0.0, + 0.0, 0.0 +}; + +c_dgemm_ndarray( CblasNoTrans, CblasNoTrans, 2, 2, 3, 1.0, A, 3, 1, 0, B, 2, 1, 0, 0.0, C, 2, 1, 0 ); +``` + +The function accepts the following arguments: + +- **transA**: `[in] CBLAS_TRANSPOSE` specifies whether `A` should be transposed, conjugate-transposed, or not transposed. +- **transB**: `[in] CBLAS_TRANSPOSE` specifies whether `B` should be transposed, conjugate-transposed, or not transposed. +- **M**: `[in] CBLAS_INT` number of rows in the matrix `op(A)` and in the matrix `C`. +- **N**: `[in] CBLAS_INT` number of columns in the matrix `op(B)` and in the matrix `C`. +- **K**: `[in] CBLAS_INT` number of columns in the matrix `op(A)` and number of rows in the matrix `op(B)`. +- **alpha**: `[in] double` scalar constant. +- **A**: `[in] double*` first input matrix. +- **sa1**: `[in] CBLAS_INT` stride of the first dimension of `A`. +- **sa2**: `[in] CBLAS_INT` stride of the second dimension of `A`. +- **oa**: `[in] CBLAS_INT` starting index for `A`. +- **B**: `[in] double*` second input matrix. +- **sb1**: `[in] CBLAS_INT` stride of the first dimension of `B`. +- **sb2**: `[in] CBLAS_INT` stride of the second dimension of `B`. +- **ob**: `[in] CBLAS_INT` starting index for `B`. +- **beta**: `[in] double` scalar constant. +- **C**: `[inout] double*` result matrix. +- **sc1**: `[in] CBLAS_INT` stride of the first dimension of `C`. +- **sc2**: `[in] CBLAS_INT` stride of the second dimension of `C`. +- **oc**: `[in] CBLAS_INT` starting index for `C`. + +```c +void c_dgemm_ndarray( const CBLAS_TRANSPOSE transA, const CBLAS_TRANSPOSE transB, const CBLAS_INT M, const CBLAS_INT N, const CBLAS_INT K, const double alpha, const double *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA, const double *B, const CBLAS_INT strideB1, const CBLAS_INT strideB2, const CBLAS_INT offsetB, const double beta, double *C, const CBLAS_INT strideC1, const CBLAS_INT strideC2, const CBLAS_INT offsetC ); ```
@@ -223,7 +331,45 @@ TODO ### Examples ```c -TODO +#include "stdlib/blas/base/dgemm.h" +#include "stdlib/blas/base/shared.h" +#include + +int main( void ) { + // Define a 2x2 output matrix stored in row-major order: + double C[ 2*2 ] = { + 0.0, 0.0, + 0.0, 0.0 + }; + + // Define a 2x3 matrix `A` stored in row-major order: + const double A[ 2*3 ] = { + 1.0, 2.0, 3.0, + 4.0, 5.0, 6.0 + }; + + // Define a 3x2 matrix `B` stored in row-major order: + const double B[ 3*2 ] = { + 7.0, 8.0, + 9.0, 10.0, + 11.0, 12.0 + }; + + // Specify matrix dimensions: + const int M = 2; // rows of op(A) and C + const int N = 2; // columns of op(B) and C + const int K = 3; // columns of op(A) and rows of op(B) + + // Perform operation: C = 1.0*A*B + 0.0*C + c_dgemm( CblasRowMajor, CblasNoTrans, CblasNoTrans, M, N, K, 1.0, A, K, B, N, 0.0, C, N ); + + // Print the result: + for ( int i = 0; i < M; i++ ) { + for ( int j = 0; j < N; j++ ) { + printf( "C[%i,%i] = %lf\n", i, j, C[ (i*N)+j ] ); + } + } +} ``` diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_nta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_nta_ntb.ndarray.native.js new file mode 100644 index 000000000000..d686324717fe --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_nta_ntb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'no-transpose', 'no-transpose', N, N, N, 1.0, A, 1, N, 0, B, 1, N, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=false,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_nta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_nta_tb.ndarray.native.js new file mode 100644 index 000000000000..9a3110d30015 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_nta_tb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'no-transpose', 'transpose', N, N, N, 1.0, A, 1, N, 0, B, 1, N, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=true,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_ta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_ta_ntb.ndarray.native.js new file mode 100644 index 000000000000..57c9a0e4940c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_ta_ntb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'transpose', 'no-transpose', N, N, N, 1.0, A, 1, N, 0, B, 1, N, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=false,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_ta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_ta_tb.ndarray.native.js new file mode 100644 index 000000000000..19d10c8d825d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_ta_tb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'transpose', 'transpose', N, N, N, 1.0, A, 1, N, 0, B, 1, N, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=true,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_nta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_nta_ntb.ndarray.native.js new file mode 100644 index 000000000000..202284030852 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_nta_ntb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'no-transpose', 'no-transpose', N, N, N, 1.0, A, 1, N, 0, B, 1, N, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=column-major,order(B)=column-major,order(C)=row-major,trans(A)=false,trans(B)=false,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_nta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_nta_tb.ndarray.native.js new file mode 100644 index 000000000000..51d42aa60ad5 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_nta_tb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'no-transpose', 'transpose', N, N, N, 1.0, A, 1, N, 0, B, 1, N, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=column-major,order(B)=column-major,order(C)=row-major,trans(A)=false,trans(B)=true,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_ta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_ta_ntb.ndarray.native.js new file mode 100644 index 000000000000..901bccd61428 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_ta_ntb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'transpose', 'no-transpose', N, N, N, 1.0, A, 1, N, 0, B, 1, N, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=column-major,order(B)=column-major,order(C)=row-major,trans(A)=true,trans(B)=false,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_ta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_ta_tb.ndarray.native.js new file mode 100644 index 000000000000..958c8bc99649 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_ta_tb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'transpose', 'transpose', N, N, N, 1.0, A, 1, N, 0, B, 1, N, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=column-major,order(B)=column-major,order(C)=row-major,trans(A)=true,trans(B)=true,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_nta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_nta_ntb.ndarray.native.js new file mode 100644 index 000000000000..c828ceb822e4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_nta_ntb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'no-transpose', 'no-transpose', N, N, N, 1.0, A, 1, N, 0, B, N, 1, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=column-major,order(B)=row-major,order(C)=column-major,trans(A)=false,trans(B)=false,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_nta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_nta_tb.ndarray.native.js new file mode 100644 index 000000000000..ce8ffc2c17b8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_nta_tb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'no-transpose', 'transpose', N, N, N, 1.0, A, 1, N, 0, B, N, 1, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=column-major,order(B)=row-major,order(C)=column-major,trans(A)=false,trans(B)=true,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_ta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_ta_ntb.ndarray.native.js new file mode 100644 index 000000000000..380875aedb6e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_ta_ntb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'transpose', 'no-transpose', N, N, N, 1.0, A, 1, N, 0, B, N, 1, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=column-major,order(B)=row-major,order(C)=column-major,trans(A)=true,trans(B)=false,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_ta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_ta_tb.ndarray.native.js new file mode 100644 index 000000000000..bd46ee277d9a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_ta_tb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'transpose', 'transpose', N, N, N, 1.0, A, 1, N, 0, B, N, 1, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=column-major,order(B)=row-major,order(C)=column-major,trans(A)=true,trans(B)=true,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_nta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_nta_ntb.ndarray.native.js new file mode 100644 index 000000000000..c81205da27b2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_nta_ntb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'no-transpose', 'no-transpose', N, N, N, 1.0, A, 1, N, 0, B, N, 1, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=column-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=false,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_nta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_nta_tb.ndarray.native.js new file mode 100644 index 000000000000..c90d6e3d02a2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_nta_tb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'no-transpose', 'transpose', N, N, N, 1.0, A, 1, N, 0, B, N, 1, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=column-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=true,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_ta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_ta_ntb.ndarray.native.js new file mode 100644 index 000000000000..22e7793acef9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_ta_ntb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'transpose', 'no-transpose', N, N, N, 1.0, A, 1, N, 0, B, N, 1, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=column-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=false,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_ta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_ta_tb.ndarray.native.js new file mode 100644 index 000000000000..232696a256f4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_ta_tb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'transpose', 'transpose', N, N, N, 1.0, A, 1, N, 0, B, N, 1, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=column-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=true,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_nta_ntb.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_nta_ntb.native.js new file mode 100644 index 000000000000..3a740487aff4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_nta_ntb.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/dgemm.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'column-major', 'no-transpose', 'no-transpose', N, N, N, 1.0, A, N, B, N, 1.0, C, N ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=false,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_nta_tb.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_nta_tb.native.js new file mode 100644 index 000000000000..3faaff190ecf --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_nta_tb.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/dgemm.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'column-major', 'no-transpose', 'transpose', N, N, N, 1.0, A, N, B, N, 1.0, C, N ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=true,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_ta_ntb.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_ta_ntb.native.js new file mode 100644 index 000000000000..ca62b8ac60b0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_ta_ntb.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/dgemm.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'column-major', 'transpose', 'no-transpose', N, N, N, 1.0, A, N, B, N, 1.0, C, N ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=false,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_ta_tb.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_ta_tb.native.js new file mode 100644 index 000000000000..0c6f98f26c64 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_ta_tb.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/dgemm.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'column-major', 'transpose', 'transpose', N, N, N, 1.0, A, N, B, N, 1.0, C, N ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:order(A)=column-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=true,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_nta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_nta_ntb.ndarray.native.js new file mode 100644 index 000000000000..ed7bf39ebfdc --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_nta_ntb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'no-transpose', 'no-transpose', N, N, N, 1.0, A, N, 1, 0, B, 1, N, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=row-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=false,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_nta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_nta_tb.ndarray.native.js new file mode 100644 index 000000000000..d84f17f7c6c6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_nta_tb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'no-transpose', 'transpose', N, N, N, 1.0, A, N, 1, 0, B, 1, N, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=row-major,order(B)=column-major,order(C)=column-major,trans(A)=false,trans(B)=true,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_ta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_ta_ntb.ndarray.native.js new file mode 100644 index 000000000000..60dafb61ad42 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_ta_ntb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'transpose', 'no-transpose', N, N, N, 1.0, A, N, 1, 0, B, 1, N, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=row-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=false,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_ta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_ta_tb.ndarray.native.js new file mode 100644 index 000000000000..331545908197 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_ta_tb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'transpose', 'transpose', N, N, N, 1.0, A, N, 1, 0, B, 1, N, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=row-major,order(B)=column-major,order(C)=column-major,trans(A)=true,trans(B)=true,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_nta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_nta_ntb.ndarray.native.js new file mode 100644 index 000000000000..2d89a6b65e44 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_nta_ntb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'no-transpose', 'no-transpose', N, N, N, 1.0, A, N, 1, 0, B, 1, N, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=row-major,order(B)=column-major,order(C)=row-major,trans(A)=false,trans(B)=false,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_nta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_nta_tb.ndarray.native.js new file mode 100644 index 000000000000..4fea0108bef3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_nta_tb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'no-transpose', 'transpose', N, N, N, 1.0, A, N, 1, 0, B, 1, N, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=row-major,order(B)=column-major,order(C)=row-major,trans(A)=false,trans(B)=true,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_ta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_ta_ntb.ndarray.native.js new file mode 100644 index 000000000000..87a9b3a428d2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_ta_ntb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'transpose', 'no-transpose', N, N, N, 1.0, A, N, 1, 0, B, 1, N, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=row-major,order(B)=column-major,order(C)=row-major,trans(A)=true,trans(B)=false,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_ta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_ta_tb.ndarray.native.js new file mode 100644 index 000000000000..7ac2118773c3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_ta_tb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'transpose', 'transpose', N, N, N, 1.0, A, N, 1, 0, B, 1, N, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=row-major,order(B)=column-major,order(C)=row-major,trans(A)=true,trans(B)=true,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_nta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_nta_ntb.ndarray.native.js new file mode 100644 index 000000000000..96de8fdc143a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_nta_ntb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'no-transpose', 'no-transpose', N, N, N, 1.0, A, N, 1, 0, B, N, 1, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=row-major,order(B)=row-major,order(C)=column-major,trans(A)=false,trans(B)=false,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_nta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_nta_tb.ndarray.native.js new file mode 100644 index 000000000000..60b4c7dd7be7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_nta_tb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'no-transpose', 'transpose', N, N, N, 1.0, A, N, 1, 0, B, N, 1, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=row-major,order(B)=row-major,order(C)=column-major,trans(A)=false,trans(B)=true,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_ta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_ta_ntb.ndarray.native.js new file mode 100644 index 000000000000..a13ad99e3b90 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_ta_ntb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'transpose', 'no-transpose', N, N, N, 1.0, A, N, 1, 0, B, N, 1, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=row-major,order(B)=row-major,order(C)=column-major,trans(A)=true,trans(B)=false,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_ta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_ta_tb.ndarray.native.js new file mode 100644 index 000000000000..cd9656f1fa9e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_ta_tb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'transpose', 'transpose', N, N, N, 1.0, A, N, 1, 0, B, N, 1, 0, 1.0, C, 1, N, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=row-major,order(B)=row-major,order(C)=column-major,trans(A)=true,trans(B)=true,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_nta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_nta_ntb.ndarray.native.js new file mode 100644 index 000000000000..ca81a7d38cc5 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_nta_ntb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'no-transpose', 'no-transpose', N, N, N, 1.0, A, N, 1, 0, B, N, 1, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=false,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_nta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_nta_tb.ndarray.native.js new file mode 100644 index 000000000000..0848ee30df88 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_nta_tb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'no-transpose', 'transpose', N, N, N, 1.0, A, N, 1, 0, B, N, 1, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=true,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_ta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_ta_ntb.ndarray.native.js new file mode 100644 index 000000000000..83ecff3dbc5d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_ta_ntb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'transpose', 'no-transpose', N, N, N, 1.0, A, N, 1, 0, B, N, 1, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=false,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_ta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_ta_tb.ndarray.native.js new file mode 100644 index 000000000000..c0b8873a100a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_ta_tb.ndarray.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'transpose', 'transpose', N, N, N, 1.0, A, N, 1, 0, B, N, 1, 0, 1.0, C, N, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:ndarray:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=true,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_nta_ntb.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_nta_ntb.native.js new file mode 100644 index 000000000000..9d48589b450c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_nta_ntb.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/dgemm.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'row-major', 'no-transpose', 'no-transpose', N, N, N, 1.0, A, N, B, N, 1.0, C, N ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=false,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_nta_tb.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_nta_tb.native.js new file mode 100644 index 000000000000..fe6253d8a18e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_nta_tb.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/dgemm.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'row-major', 'no-transpose', 'transpose', N, N, N, 1.0, A, N, B, N, 1.0, C, N ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=false,trans(B)=true,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_ta_ntb.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_ta_ntb.native.js new file mode 100644 index 000000000000..a5a2165226c7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_ta_ntb.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/dgemm.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'row-major', 'transpose', 'no-transpose', N, N, N, 1.0, A, N, B, N, 1.0, C, N ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=false,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_ta_tb.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_ta_tb.native.js new file mode 100644 index 000000000000..2d6102a14a38 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_ta_tb.native.js @@ -0,0 +1,111 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var format = require( '@stdlib/string/format' ); +var isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var pkg = require( './../package.json' ).name; + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/dgemm.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - array dimension size +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var A = uniform( N*N, -10.0, 10.0, options ); + var B = uniform( N*N, -10.0, 10.0, options ); + var C = uniform( N*N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dgemm( 'row-major', 'transpose', 'transpose', N, N, N, 1.0, A, N, B, N, 1.0, C, N ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 5; // 10^max + + for ( i = min; i <= max; i++ ) { + len = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( len ); + bench( format( '%s::native:order(A)=row-major,order(B)=row-major,order(C)=row-major,trans(A)=true,trans(B)=true,size=%d', pkg, len*len ), opts, f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/c/Makefile b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/c/Makefile new file mode 100644 index 000000000000..9f97140e7cb0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2024 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. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := benchmark.length.out + + +# RULES # + +#/ +# Compiles source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) +# @param {string} [SOURCE_FILES] - list of source files +# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) +# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler (e.g., `gcc`) +# @param {string} CFLAGS - C compiler options +# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) +# @param {string} SOURCE_FILES - list of source files +# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) +# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) + +#/ +# Runs compiled benchmarks. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/c/benchmark.length.c new file mode 100644 index 000000000000..42af1fc0b577 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/c/benchmark.length.c @@ -0,0 +1,208 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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/base/dgemm.h" +#include "stdlib/blas/base/shared.h" +#include +#include +#include +#include +#include + +#define NAME "dgemm" +#define ITERATIONS 1000000 +#define REPEATS 3 +#define MIN 1 +#define MAX 6 + +/** +* Prints the TAP version. +*/ +static void print_version( void ) { + printf( "TAP version 13\n" ); +} + +/** +* Prints the TAP summary. +* +* @param total total number of tests +* @param passing total number of passing tests +*/ +static void print_summary( int total, int passing ) { + printf( "#\n" ); + printf( "1..%d\n", total ); // TAP plan + printf( "# total %d\n", total ); + printf( "# pass %d\n", passing ); + printf( "#\n" ); + printf( "# ok\n" ); +} + +/** +* Prints benchmarks results. +* +* @param iterations number of iterations +* @param elapsed elapsed time in seconds +*/ +static void print_results( int iterations, double elapsed ) { + double rate = (double)iterations / elapsed; + printf( " ---\n" ); + printf( " iterations: %d\n", iterations ); + printf( " elapsed: %0.9f\n", elapsed ); + printf( " rate: %0.9f\n", rate ); + printf( " ...\n" ); +} + +/** +* Returns a clock time. +* +* @return clock time +*/ +static double tic( void ) { + struct timeval now; + gettimeofday( &now, NULL ); + return (double)now.tv_sec + (double)now.tv_usec/1.0e6; +} + +/** +* Generates a random number on the interval [0,1). +* +* @return random number +*/ +static double rand_double( void ) { + int r = rand(); + return (double)r / ( (double)RAND_MAX + 1.0 ); +} + +/** +* Runs a benchmark for the row-major interface. +* +* @param iterations number of iterations +* @param N array dimension size +* @return elapsed time in seconds +*/ +static double benchmark1( int iterations, int N ) { + double elapsed; + double A[ N*N ]; + double B[ N*N ]; + double C[ N*N ]; + double t; + int i; + int j; + + for ( i = 0; i < N; i++ ) { + for ( j = 0; j < N; j++ ) { + A[ (i*N)+j ] = ( rand_double()*20.0 ) - 10.0; + B[ (i*N)+j ] = ( rand_double()*20.0 ) - 10.0; + C[ (i*N)+j ] = ( rand_double()*20.0 ) - 10.0; + } + } + t = tic(); + for ( i = 0; i < iterations; i++ ) { + // cppcheck-suppress uninitvar + c_dgemm( CblasRowMajor, CblasNoTrans, CblasNoTrans, N, N, N, 1.0, A, N, B, N, 0.0, C, N ); + if ( C[ i%(N*2) ] != C[ i%(N*2) ] ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + if ( C[ i%(N*2) ] != C[ i%(N*2) ] ) { + printf( "should not return NaN\n" ); + } + return elapsed; +} + +/** +* Runs a benchmark for the ndarray interface. +* +* @param iterations number of iterations +* @param N array dimension size +* @return elapsed time in seconds +*/ +static double benchmark2( int iterations, int N ) { + double elapsed; + double A[ N*N ]; + double B[ N*N ]; + double C[ N*N ]; + double t; + int i; + int j; + + for ( i = 0; i < N; i++ ) { + for ( j = 0; j < N; j++ ) { + A[ (i*N)+j ] = ( rand_double()*20.0 ) - 10.0; + B[ (i*N)+j ] = ( rand_double()*20.0 ) - 10.0; + C[ (i*N)+j ] = ( rand_double()*20.0 ) - 10.0; + } + } + t = tic(); + for ( i = 0; i < iterations; i++ ) { + // cppcheck-suppress uninitvar + c_dgemm_ndarray( CblasNoTrans, CblasNoTrans, N, N, N, 1.0, A, N, 1, 0, B, N, 1, 0, 0.0, C, N, 1, 0 ); + if ( C[ i%(N*2) ] != C[ i%(N*2) ] ) { + printf( "should not return NaN\n" ); + break; + } + } + elapsed = tic() - t; + if ( C[ i%(N*2) ] != C[ i%(N*2) ] ) { + printf( "should not return NaN\n" ); + } + return elapsed; +} + +/** +* Main execution sequence. +*/ +int main( void ) { + double elapsed; + int count; + int iter; + int N; + int i; + int j; + + // Use the current time to seed the random number generator: + srand( time( NULL ) ); + + print_version(); + count = 0; + for ( i = MIN; i <= MAX; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + iter = ITERATIONS / pow( 10, i-1 ); + for ( j = 0; j < REPEATS; j++ ) { + count += 1; + printf( "# c::%s:size=%d\n", NAME, N*N ); + elapsed = benchmark1( iter, N ); + print_results( iter, elapsed ); + printf( "ok %d benchmark finished\n", count ); + } + } + for ( i = MIN; i <= MAX; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + iter = ITERATIONS / pow( 10, i-1 ); + for ( j = 0; j < REPEATS; j++ ) { + count += 1; + printf( "# c::%s:ndarray:size=%d\n", NAME, N*N ); + elapsed = benchmark2( iter, N ); + print_results( iter, elapsed ); + printf( "ok %d benchmark finished\n", count ); + } + } + print_summary( count, count ); +} diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/fortran/Makefile b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/fortran/Makefile new file mode 100644 index 000000000000..aa5cade65e05 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/fortran/Makefile @@ -0,0 +1,141 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2024 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. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling Fortran source files: +ifdef FORTRAN_COMPILER + FC := $(FORTRAN_COMPILER) +else + FC := gfortran +endif + +# Define the command-line options when compiling Fortran files: +FFLAGS ?= \ + -std=f95 \ + -ffree-form \ + -O3 \ + -Wall \ + -Wextra \ + -Wno-compare-reals \ + -Wimplicit-interface \ + -fno-underscoring \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop`): +INCLUDE ?= + +# List of Fortran source files: +SOURCE_FILES ?= ../../src/dgemm.f + +# List of Fortran targets: +f_targets := benchmark.length.out + + +# RULES # + +#/ +# Compiles Fortran source files. +# +# @param {string} SOURCE_FILES - list of Fortran source files +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop`) +# @param {string} [FORTRAN_COMPILER] - Fortran compiler +# @param {string} [FFLAGS] - Fortran compiler flags +# @param {(string|void)} [fPIC] - compiler flag indicating whether to generate position independent code +# +# @example +# make +# +# @example +# make all +#/ +all: $(f_targets) + +.PHONY: all + +#/ +# Compiles Fortran source files. +# +# @private +# @param {string} SOURCE_FILES - list of Fortran source files +# @param {(string|void)} INCLUDE - list of includes (e.g., `-I /foo/bar -I /beep/boop`) +# @param {string} FC - Fortran compiler +# @param {string} FFLAGS - Fortran compiler flags +# @param {(string|void)} fPIC - compiler flag indicating whether to generate position independent code +#/ +$(f_targets): %.out: %.f + $(QUIET) $(FC) $(FFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< + +#/ +# Runs compiled benchmarks. +# +# @example +# make run +#/ +run: $(f_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/fortran/benchmark.length.f b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/fortran/benchmark.length.f new file mode 100644 index 000000000000..4c721a74e804 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/fortran/benchmark.length.f @@ -0,0 +1,218 @@ +!> +! @license Apache-2.0 +! +! Copyright (c) 2024 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. +!< + +program bench + implicit none + ! .. + ! Local constants: + character(5), parameter :: name = 'dgemm' ! if changed, be sure to adjust length + integer, parameter :: iterations = 1000000 + integer, parameter :: repeats = 3 + integer, parameter :: min = 1 + integer, parameter :: max = 6 + ! .. + ! Run the benchmarks: + call main() + ! .. + ! Functions: +contains + ! .. + ! Prints the TAP version. + ! .. + subroutine print_version() + print '(A)', 'TAP version 13' + end subroutine print_version + ! .. + ! Prints the TAP summary. + ! + ! @param {integer} total - total number of tests + ! @param {integer} passing - total number of passing tests + ! .. + subroutine print_summary( total, passing ) + ! .. + ! Scalar arguments: + integer, intent(in) :: total, passing + ! .. + ! Local variables: + character(len=999) :: str, tmp + ! .. + ! Intrinsic functions: + intrinsic adjustl, trim + ! .. + print '(A)', '#' + ! .. + write (str, '(I15)') total ! TAP plan + tmp = adjustl( str ) + print '(A,A)', '1..', trim( tmp ) + ! .. + print '(A,A)', '# total ', trim( tmp ) + ! .. + write (str, '(I15)') passing + tmp = adjustl( str ) + print '(A,A)', '# pass ', trim( tmp ) + ! .. + print '(A)', '#' + print '(A)', '# ok' + end subroutine print_summary + ! .. + ! Prints benchmarks results. + ! + ! @param {integer} iterations - number of iterations + ! @param {double} elapsed - elapsed time in seconds + ! .. + subroutine print_results( iterations, elapsed ) + ! .. + ! Scalar arguments: + double precision, intent(in) :: elapsed + integer, intent(in) :: iterations + ! .. + ! Local variables: + double precision :: rate + character(len=999) :: str, tmp + ! .. + ! Intrinsic functions: + intrinsic dble, adjustl, trim + ! .. + rate = dble( iterations ) / elapsed + ! .. + print '(A)', ' ---' + ! .. + write (str, '(I15)') iterations + tmp = adjustl( str ) + print '(A,A)', ' iterations: ', trim( tmp ) + ! .. + write (str, '(f100.9)') elapsed + tmp = adjustl( str ) + print '(A,A)', ' elapsed: ', trim( tmp ) + ! .. + write( str, '(f100.9)') rate + tmp = adjustl( str ) + print '(A,A)', ' rate: ', trim( tmp ) + ! .. + print '(A)', ' ...' + end subroutine print_results + ! .. + ! Runs a benchmark. + ! + ! @param {integer} iterations - number of iterations + ! @param {integer} N - array dimension size + ! @return {double} elapsed time in seconds + ! .. + double precision function benchmark( iterations, N ) + ! .. + ! External functions: + interface + subroutine dgemm( transA, transB, M, N, K, alpha, A, LDA, B, LDB, beta, C, LDC ) + character(len=1) :: transA, transB + integer :: M, N, K, LDA, LDB, LDC + double precision :: A(LDA,*), B(LDB,*), C(LDC,*) + double precision :: alpha, beta + end subroutine dgemm + end interface + ! .. + ! Scalar arguments: + integer, intent(in) :: iterations, N + ! .. + ! Local scalars: + double precision :: elapsed, r + double precision :: t1, t2 + integer :: i, j + ! .. + ! Local arrays: + double precision, allocatable :: A(:,:), B(:,:), C(:,:) + ! .. + ! Intrinsic functions: + intrinsic random_number, cpu_time, mod + ! .. + ! Allocate arrays: + allocate( A(N,N), B(N,N), C(N,N) ) + ! .. + do i = 1, N + do j = 1, N + call random_number( r ) + A(i, j) = ( r*20.0 ) - 10.0 + call random_number( r ) + B(i, j) = ( r*20.0 ) - 10.0 + call random_number( r ) + C(i, j) = ( r*20.0 ) - 10.0 + end do + end do + ! .. + call cpu_time( t1 ) + ! .. + j = 1 + do i = 1, iterations + call dgemm( 'N', 'N', N, N, N, 1.0d0, A, N, B, N, 0.0d0, C, N ) + j = mod( i, N ) + 1 + if ( C( j, j ) /= C( j, j ) ) then + print '(A)', 'should not return NaN' + exit + end if + end do + ! .. + call cpu_time( t2 ) + ! .. + elapsed = t2 - t1 + ! .. + if ( C( j, j ) /= C( j, j ) ) then + print '(A)', 'should not return NaN' + end if + ! .. + ! Deallocate arrays: + deallocate( A, B, C ) + ! .. + benchmark = elapsed + return + end function benchmark + ! .. + ! Main execution sequence. + ! .. + subroutine main() + ! .. + ! Local variables: + character(len=999) :: str, tmp + double precision :: elapsed + integer :: i, j, N, count, iter + ! .. + ! Intrinsic functions: + intrinsic adjustl, trim, floor, sqrt + ! .. + call print_version() + count = 0 + do i = min, max + N = floor( ( 10**i )**(1.0/2.0) ) + iter = iterations / 10**(i-1) + do j = 1, repeats + count = count + 1 + ! .. + write (str, '(I15)') N*N + tmp = adjustl( str ) + print '(A,A,A,A)', '# fortran::', name, ':size=', trim(tmp) + ! .. + elapsed = benchmark( iter, N ) + ! .. + call print_results( iter, elapsed ) + ! .. + write (str, '(I15)') count + tmp = adjustl( str ) + print '(A,A,A)', 'ok ', trim( tmp ), ' benchmark finished' + end do + end do + call print_summary( count, count ) + end subroutine main +end program bench diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/binding.gyp b/lib/node_modules/@stdlib/blas/base/dgemm/binding.gyp new file mode 100644 index 000000000000..02a2799da097 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/binding.gyp @@ -0,0 +1,265 @@ +# @license Apache-2.0 +# +# Copyright (c) 2024 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. + +# A `.gyp` file for building a Node.js native add-on. +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +{ + # List of files to include in this file: + 'includes': [ + './include.gypi', + ], + + # Define variables to be used throughout the configuration for all targets: + 'variables': { + # Target name should match the add-on export name: + 'addon_target_name%': 'addon', + + # Fortran compiler (to override -Dfortran_compiler=): + 'fortran_compiler%': 'gfortran', + + # Fortran compiler flags: + 'fflags': [ + # Specify the Fortran standard to which a program is expected to conform: + '-std=f95', + + # Indicate that the layout is free-form source code: + '-ffree-form', + + # Aggressive optimization: + '-O3', + + # Enable commonly used warning options: + '-Wall', + + # Warn if source code contains problematic language features: + '-Wextra', + + # Warn if a procedure is called without an explicit interface: + '-Wimplicit-interface', + + # Do not transform names of entities specified in Fortran source files by appending underscores (i.e., don't mangle names, thus allowing easier usage in C wrappers): + '-fno-underscoring', + + # Warn if source code contains Fortran 95 extensions and C-language constructs: + '-pedantic', + + # Compile but do not link (output is an object file): + '-c', + ], + + # Set variables based on the host OS: + 'conditions': [ + [ + 'OS=="win"', + { + # Define the object file suffix: + 'obj': 'obj', + }, + { + # Define the object file suffix: + 'obj': 'o', + } + ], # end condition (OS=="win") + ], # end conditions + }, # end variables + + # Define compile targets: + 'targets': [ + + # Target to generate an add-on: + { + # The target name should match the add-on export name: + 'target_name': '<(addon_target_name)', + + # Define dependencies: + 'dependencies': [], + + # Define directories which contain relevant include headers: + 'include_dirs': [ + # Local include directory: + '<@(include_dirs)', + ], + + # List of source files: + 'sources': [ + '<@(src_files)', + ], + + # Settings which should be applied when a target's object files are used as linker input: + 'link_settings': { + # Define libraries: + 'libraries': [ + '<@(libraries)', + ], + + # Define library directories: + 'library_dirs': [ + '<@(library_dirs)', + ], + }, + + # C/C++ compiler flags: + 'cflags': [ + # Enable commonly used warning options: + '-Wall', + + # Aggressive optimization: + '-O3', + ], + + # C specific compiler flags: + 'cflags_c': [ + # Specify the C standard to which a program is expected to conform: + '-std=c99', + ], + + # C++ specific compiler flags: + 'cflags_cpp': [ + # Specify the C++ standard to which a program is expected to conform: + '-std=c++11', + ], + + # Linker flags: + 'ldflags': [], + + # Apply conditions based on the host OS: + 'conditions': [ + [ + 'OS=="mac"', + { + # Linker flags: + 'ldflags': [ + '-undefined dynamic_lookup', + '-Wl,-no-pie', + '-Wl,-search_paths_first', + ], + }, + ], # end condition (OS=="mac") + [ + 'OS!="win"', + { + # C/C++ flags: + 'cflags': [ + # Generate platform-independent code: + '-fPIC', + ], + }, + ], # end condition (OS!="win") + ], # end conditions + + # Define custom build actions for particular inputs: + 'rules': [ + { + # Define a rule for processing Fortran files: + 'extension': 'f', + + # Define the pathnames to be used as inputs when performing processing: + 'inputs': [ + # Full path of the current input: + '<(RULE_INPUT_PATH)' + ], + + # Define the outputs produced during processing: + 'outputs': [ + # Store an output object file in a directory for placing intermediate results (only accessible within a single target): + '<(INTERMEDIATE_DIR)/<(RULE_INPUT_ROOT).<(obj)' + ], + + # Define the rule for compiling Fortran based on the host OS: + 'conditions': [ + [ + 'OS=="win"', + + # Rule to compile Fortran on Windows: + { + 'rule_name': 'compile_fortran_windows', + 'message': 'Compiling Fortran file <(RULE_INPUT_PATH) on Windows...', + + 'process_outputs_as_sources': 0, + + # Define the command-line invocation: + 'action': [ + '<(fortran_compiler)', + '<@(fflags)', + '<@(_inputs)', + '-o', + '<@(_outputs)', + ], + }, + + # Rule to compile Fortran on non-Windows: + { + 'rule_name': 'compile_fortran_linux', + 'message': 'Compiling Fortran file <(RULE_INPUT_PATH) on Linux...', + + 'process_outputs_as_sources': 1, + + # Define the command-line invocation: + 'action': [ + '<(fortran_compiler)', + '<@(fflags)', + '-fPIC', # generate platform-independent code + '<@(_inputs)', + '-o', + '<@(_outputs)', + ], + } + ], # end condition (OS=="win") + ], # end conditions + }, # end rule (extension=="f") + ], # end rules + }, # end target <(addon_target_name) + + # Target to copy a generated add-on to a standard location: + { + 'target_name': 'copy_addon', + + # Declare that the output of this target is not linked: + 'type': 'none', + + # Define dependencies: + 'dependencies': [ + # Require that the add-on be generated before building this target: + '<(addon_target_name)', + ], + + # Define a list of actions: + 'actions': [ + { + 'action_name': 'copy_addon', + 'message': 'Copying addon...', + + # Explicitly list the inputs in the command-line invocation below: + 'inputs': [], + + # Declare the expected outputs: + 'outputs': [ + '<(addon_output_dir)/<(addon_target_name).node', + ], + + # Define the command-line invocation: + 'action': [ + 'cp', + '<(PRODUCT_DIR)/<(addon_target_name).node', + '<(addon_output_dir)/<(addon_target_name).node', + ], + }, + ], # end actions + }, # end target copy_addon + ], # end targets +} diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/examples/c/Makefile b/lib/node_modules/@stdlib/blas/base/dgemm/examples/c/Makefile new file mode 100644 index 000000000000..6aed70daf167 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/examples/c/Makefile @@ -0,0 +1,146 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2024 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. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + +# Define the program used for compiling C source files: +ifdef C_COMPILER + CC := $(C_COMPILER) +else + CC := gcc +endif + +# Define the command-line options when compiling C files: +CFLAGS ?= \ + -std=c99 \ + -O3 \ + -Wall \ + -pedantic + +# Determine whether to generate position independent code ([1][1], [2][2]). +# +# [1]: https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#Code-Gen-Options +# [2]: http://stackoverflow.com/questions/5311515/gcc-fpic-option +ifeq ($(OS), WINNT) + fPIC ?= +else + fPIC ?= -fPIC +endif + +# List of includes (e.g., `-I /foo/bar -I /beep/boop/include`): +INCLUDE ?= + +# List of source files: +SOURCE_FILES ?= + +# List of libraries (e.g., `-lopenblas -lpthread`): +LIBRARIES ?= + +# List of library paths (e.g., `-L /foo/bar -L /beep/boop`): +LIBPATH ?= + +# List of C targets: +c_targets := example.out + + +# RULES # + +#/ +# Compiles source files. +# +# @param {string} [C_COMPILER] - C compiler (e.g., `gcc`) +# @param {string} [CFLAGS] - C compiler options +# @param {(string|void)} [fPIC] - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} [INCLUDE] - list of includes (e.g., `-I /foo/bar -I /beep/boop/include`) +# @param {string} [SOURCE_FILES] - list of source files +# @param {string} [LIBPATH] - list of library paths (e.g., `-L /foo/bar -L /beep/boop`) +# @param {string} [LIBRARIES] - list of libraries (e.g., `-lopenblas -lpthread`) +# +# @example +# make +# +# @example +# make all +#/ +all: $(c_targets) + +.PHONY: all + +#/ +# Compiles C source files. +# +# @private +# @param {string} CC - C compiler (e.g., `gcc`) +# @param {string} CFLAGS - C compiler options +# @param {(string|void)} fPIC - compiler flag determining whether to generate position independent code (e.g., `-fPIC`) +# @param {string} INCLUDE - list of includes (e.g., `-I /foo/bar`) +# @param {string} SOURCE_FILES - list of source files +# @param {string} LIBPATH - list of library paths (e.g., `-L /foo/bar`) +# @param {string} LIBRARIES - list of libraries (e.g., `-lopenblas`) +#/ +$(c_targets): %.out: %.c + $(QUIET) $(CC) $(CFLAGS) $(fPIC) $(INCLUDE) -o $@ $(SOURCE_FILES) $< $(LIBPATH) -lm $(LIBRARIES) + +#/ +# Runs compiled examples. +# +# @example +# make run +#/ +run: $(c_targets) + $(QUIET) ./$< + +.PHONY: run + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: + $(QUIET) -rm -f *.o *.out + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/examples/c/example.c b/lib/node_modules/@stdlib/blas/base/dgemm/examples/c/example.c new file mode 100644 index 000000000000..da8516abcbed --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/examples/c/example.c @@ -0,0 +1,57 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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/base/dgemm.h" +#include "stdlib/blas/base/shared.h" +#include + +int main( void ) { + // Define a 2x2 output matrix stored in row-major order: + double C[ 2*2 ] = { + 0.0, 0.0, + 0.0, 0.0 + }; + + // Define a 2x3 matrix `A` stored in row-major order: + const double A[ 2*3 ] = { + 1.0, 2.0, 3.0, + 4.0, 5.0, 6.0 + }; + + // Define a 3x2 matrix `B` stored in row-major order: + const double B[ 3*2 ] = { + 7.0, 8.0, + 9.0, 10.0, + 11.0, 12.0 + }; + + // Specify matrix dimensions: + const int M = 2; // rows of op(A) and C + const int N = 2; // columns of op(B) and C + const int K = 3; // columns of op(A) and rows of op(B) + + // Perform operation: C = 1.0*A*B + 0.0*C + c_dgemm( CblasRowMajor, CblasNoTrans, CblasNoTrans, M, N, K, 1.0, A, K, B, N, 0.0, C, N ); + + // Print the result: + for ( int i = 0; i < M; i++ ) { + for ( int j = 0; j < N; j++ ) { + printf( "C[%i,%i] = %lf\n", i, j, C[ (i*N)+j ] ); + } + } +} diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/include.gypi b/lib/node_modules/@stdlib/blas/base/dgemm/include.gypi new file mode 100644 index 000000000000..497aeca15320 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/include.gypi @@ -0,0 +1,70 @@ +# @license Apache-2.0 +# +# Copyright (c) 2024 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. + +# A GYP include file for building a Node.js native add-on. +# +# Note that nesting variables is required due to how GYP processes a configuration. Any variables defined within a nested 'variables' section is defined in the outer scope. Thus, conditions in the outer variable scope are free to use these variables without running into "variable undefined" errors. +# +# Main documentation: +# +# [1]: https://gyp.gsrc.io/docs/InputFormatReference.md +# [2]: https://gyp.gsrc.io/docs/UserDocumentation.md +# +# Variable nesting hacks: +# +# [3]: https://chromium.googlesource.com/external/skia/gyp/+/master/common_variables.gypi +# [4]: https://src.chromium.org/viewvc/chrome/trunk/src/build/common.gypi?revision=127004 +{ + # Define variables to be used throughout the configuration for all targets: + 'variables': { + 'variables': { + # Host BLAS library (to override -Dblas=): + 'blas%': '', + + # Path to BLAS library (to override -Dblas_dir=): + 'blas_dir%': '', + }, # end variables + + # Source directory: + 'src_dir': './src', + + # Include directories: + 'include_dirs': [ + '<@(blas_dir)', + ' [ 2.0, 5.0, 6.0, 11.0 ] +*/ +function dgemm( order, transA, transB, M, N, K, alpha, A, LDA, B, LDB, beta, C, LDC ) { // eslint-disable-line max-params, max-len + var nrowsa; + var nrowsb; + var isrm; + var valc; + if ( !isLayout( order ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); + } + if ( !isMatrixTranspose( transA ) ) { + throw new TypeError( format( 'invalid argument. Second argument must be a valid transpose operation. Value: `%s`.', transA ) ); + } + if ( !isMatrixTranspose( transB ) ) { + throw new TypeError( format( 'invalid argument. Third argument must be a valid transpose operation. Value: `%s`.', transB ) ); + } + if ( M < 0 ) { + throw new RangeError( format( 'invalid argument. Fourth argument must be a nonnegative integer. Value: `%d`.', M ) ); + } + if ( N < 0 ) { + throw new RangeError( format( 'invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.', N ) ); + } + if ( K < 0 ) { + throw new RangeError( format( 'invalid argument. Sixth argument must be a nonnegative integer. Value: `%d`.', K ) ); + } + isrm = isRowMajor( order ); + if ( + ( isrm && transA === 'no-transpose' ) || + ( !isrm && transA !== 'no-transpose' ) + ) { + nrowsa = K; + } else { + nrowsa = M; + } + if ( + ( isrm && transB === 'no-transpose' ) || + ( !isrm && transB !== 'no-transpose' ) + ) { + nrowsb = N; + } else { + nrowsb = K; + } + if ( LDA < max( 1, nrowsa ) ) { + throw new RangeError( format( 'invalid argument. Ninth argument must be greater than or equal to max(1,%d). Value: `%d`.', nrowsa, LDA ) ); + } + if ( LDB < max( 1, nrowsb ) ) { + throw new RangeError( format( 'invalid argument. Eleventh argument must be greater than or equal to max(1,%d). Value: `%d`.', nrowsb, LDB ) ); + } + if ( isrm ) { + valc = N; + } else { + valc = M; + } + if ( LDC < max( 1, valc ) ) { + throw new RangeError( format( 'invalid argument. Fourteenth argument must be greater than or equal to max(1,%d). Value: `%d`.', valc, LDC ) ); + } + addon( resolveOrder( order ), resolveTrans( transA ), resolveTrans( transB ), M, N, K, alpha, A, LDA, B, LDB, beta, C, LDC ); + return C; +} + + +// EXPORTS // + +module.exports = dgemm; diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/lib/native.js b/lib/node_modules/@stdlib/blas/base/dgemm/lib/native.js new file mode 100644 index 000000000000..533eee2b31eb --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/lib/native.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var dgemm = require( './dgemm.native.js' ); +var ndarray = require( './ndarray.native.js' ); + + +// MAIN // + +setReadOnly( dgemm, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = dgemm; diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/lib/ndarray.native.js new file mode 100644 index 000000000000..bda4204b5ac7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/lib/ndarray.native.js @@ -0,0 +1,99 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +'use strict'; + +// MODULES // + +var isMatrixTranspose = require( '@stdlib/blas/base/assert/is-transpose-operation' ); +var resolveTrans = require( '@stdlib/blas/base/transpose-operation-resolve-enum' ); +var format = require( '@stdlib/string/format' ); +var addon = require( './../src/addon.node' ); + + +// MAIN // + +/** +* Performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C`, using alternative indexing semantics and where `op(X)` is either `op(X) = X` or `op(X) = X^T`, `α` and `β` are scalars, and `A`, `B`, and `C` are matrices, with `op(A)` an `M` by `K` matrix, `op(B)` a `K` by `N` matrix, and `C` an `M` by `N` matrix. +* +* @param {string} transA - specifies whether `A` should be transposed, conjugate-transposed, or not transposed +* @param {string} transB - specifies whether `B` should be transposed, conjugate-transposed, or not transposed +* @param {NonNegativeInteger} M - number of rows in `op(A)` and `C` +* @param {NonNegativeInteger} N - number of columns in `op(B)` and `C` +* @param {NonNegativeInteger} K - number of columns in `op(A)` and rows in `op(B)` +* @param {number} alpha - scalar constant +* @param {Float64Array} A - first matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @param {Float64Array} B - second matrix +* @param {integer} strideB1 - stride of the first dimension of `B` +* @param {integer} strideB2 - stride of the second dimension of `B` +* @param {NonNegativeInteger} offsetB - starting index for `B` +* @param {number} beta - scalar constant +* @param {Float64Array} C - result matrix +* @param {integer} strideC1 - stride of the first dimension of `C` +* @param {integer} strideC2 - stride of the second dimension of `C` +* @param {NonNegativeInteger} offsetC - starting index for `C` +* @throws {TypeError} first argument must be a valid transpose operation +* @throws {TypeError} second argument must be a valid transpose operation +* @throws {RangeError} third argument must be a nonnegative integer +* @throws {RangeError} fourth argument must be a nonnegative integer +* @throws {RangeError} fifth argument must be a nonnegative integer +* @returns {Float64Array} `C` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +* var B = new Float64Array( [ 1.0, 1.0, 0.0, 1.0 ] ); +* var C = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); +* +* dgemm( 'no-transpose', 'no-transpose', 2, 2, 2, 1.0, A, 2, 1, 0, B, 2, 1, 0, 1.0, C, 2, 1, 0 ); +* // C => [ 2.0, 5.0, 6.0, 11.0 ] +*/ +function dgemm( transA, transB, M, N, K, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB, beta, C, strideC1, strideC2, offsetC ) { // eslint-disable-line max-params, max-len + if ( !isMatrixTranspose( transA ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a valid transpose operation. Value: `%s`.', transA ) ); + } + if ( !isMatrixTranspose( transB ) ) { + throw new TypeError( format( 'invalid argument. Second argument must be a valid transpose operation. Value: `%s`.', transB ) ); + } + if ( M < 0 ) { + throw new RangeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%d`.', M ) ); + } + if ( N < 0 ) { + throw new RangeError( format( 'invalid argument. Fourth argument must be a nonnegative integer. Value: `%d`.', N ) ); + } + if ( K < 0 ) { + throw new RangeError( format( 'invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.', K ) ); + } + if ( strideC1 === 0 ) { + throw new RangeError( format( 'invalid argument. Seventeenth argument must be nonzero. Value: `%d`.', strideC1 ) ); + } + if ( strideC2 === 0 ) { + throw new RangeError( format( 'invalid argument. Eighteenth argument must be nonzero. Value: `%d`.', strideC2 ) ); + } + addon.ndarray( resolveTrans( transA ), resolveTrans( transB ), M, N, K, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB, beta, C, strideC1, strideC2, offsetC ); // eslint-disable-line max-len + return C; +} + + +// EXPORTS // + +module.exports = dgemm; diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/manifest.json b/lib/node_modules/@stdlib/blas/base/dgemm/manifest.json new file mode 100644 index 000000000000..5dffff776f6c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/manifest.json @@ -0,0 +1,458 @@ +{ + "options": { + "task": "build", + "os": "linux", + "blas": "", + "wasm": false + }, + "fields": [ + { + "field": "src", + "resolve": true, + "relative": true + }, + { + "field": "include", + "resolve": true, + "relative": true + }, + { + "field": "libraries", + "resolve": false, + "relative": false + }, + { + "field": "libpath", + "resolve": true, + "relative": false + } + ], + "confs": [ + { + "task": "build", + "os": "linux", + "blas": "", + "wasm": false, + "src": [ + "./src/dgemm.f", + "./src/dgemm_f.c", + "./src/dgemm_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-int32", + "@stdlib/napi/argv-strided-float64array", + "@stdlib/napi/argv-strided-float64array2d", + "@stdlib/napi/argv-double" + ] + }, + { + "task": "benchmark", + "os": "linux", + "blas": "", + "wasm": false, + "src": [ + "./src/dgemm.c", + "./src/dgemm_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla" + ] + }, + { + "task": "examples", + "os": "linux", + "blas": "", + "wasm": false, + "src": [ + "./src/dgemm.c", + "./src/dgemm_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla" + ] + }, + + { + "task": "build", + "os": "linux", + "blas": "openblas", + "wasm": false, + "src": [ + "./src/dgemm_cblas.c", + "./src/dgemm_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lopenblas", + "-lpthread" + ], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-int32", + "@stdlib/napi/argv-strided-float64array", + "@stdlib/napi/argv-strided-float64array2d", + "@stdlib/napi/argv-double" + ] + }, + { + "task": "benchmark", + "os": "linux", + "blas": "openblas", + "wasm": false, + "src": [ + "./src/dgemm_cblas.c", + "./src/dgemm_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lopenblas", + "-lpthread" + ], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared" + ] + }, + { + "task": "examples", + "os": "linux", + "blas": "openblas", + "wasm": false, + "src": [ + "./src/dgemm_cblas.c", + "./src/dgemm_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lopenblas", + "-lpthread" + ], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared" + ] + }, + + { + "task": "build", + "os": "mac", + "blas": "", + "wasm": false, + "src": [ + "./src/dgemm.f", + "./src/dgemm_f.c", + "./src/dgemm_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-int32", + "@stdlib/napi/argv-strided-float64array", + "@stdlib/napi/argv-strided-float64array2d", + "@stdlib/napi/argv-double" + ] + }, + { + "task": "benchmark", + "os": "mac", + "blas": "", + "wasm": false, + "src": [ + "./src/dgemm.c", + "./src/dgemm_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla" + ] + }, + { + "task": "examples", + "os": "mac", + "blas": "", + "wasm": false, + "src": [ + "./src/dgemm.c", + "./src/dgemm_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla" + ] + }, + + { + "task": "build", + "os": "mac", + "blas": "apple_accelerate_framework", + "wasm": false, + "src": [ + "./src/dgemm_cblas.c", + "./src/dgemm_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lblas" + ], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-int32", + "@stdlib/napi/argv-strided-float64array", + "@stdlib/napi/argv-strided-float64array2d", + "@stdlib/napi/argv-double" + ] + }, + { + "task": "benchmark", + "os": "mac", + "blas": "apple_accelerate_framework", + "wasm": false, + "src": [ + "./src/dgemm_cblas.c", + "./src/dgemm_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lblas" + ], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared" + ] + }, + { + "task": "examples", + "os": "mac", + "blas": "apple_accelerate_framework", + "wasm": false, + "src": [ + "./src/dgemm_cblas.c", + "./src/dgemm_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lblas" + ], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared" + ] + }, + + { + "task": "build", + "os": "mac", + "blas": "openblas", + "wasm": false, + "src": [ + "./src/dgemm_cblas.c", + "./src/dgemm_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lopenblas", + "-lpthread" + ], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-int32", + "@stdlib/napi/argv-strided-float64array", + "@stdlib/napi/argv-strided-float64array2d", + "@stdlib/napi/argv-double" + ] + }, + { + "task": "benchmark", + "os": "mac", + "blas": "openblas", + "wasm": false, + "src": [ + "./src/dgemm_cblas.c", + "./src/dgemm_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lopenblas", + "-lpthread" + ], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared" + ] + }, + { + "task": "examples", + "os": "mac", + "blas": "openblas", + "wasm": false, + "src": [ + "./src/dgemm_cblas.c", + "./src/dgemm_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [ + "-lopenblas", + "-lpthread" + ], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared" + ] + }, + + { + "task": "build", + "os": "win", + "blas": "", + "wasm": false, + "src": [ + "./src/dgemm_f.c", + "./src/dgemm_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla", + "@stdlib/napi/export", + "@stdlib/napi/argv", + "@stdlib/napi/argv-int64", + "@stdlib/napi/argv-int32", + "@stdlib/napi/argv-strided-float64array", + "@stdlib/napi/argv-strided-float64array2d", + "@stdlib/napi/argv-double" + ] + }, + { + "task": "benchmark", + "os": "win", + "blas": "", + "wasm": false, + "src": [ + "./src/dgemm.c", + "./src/dgemm_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla" + ] + }, + { + "task": "examples", + "os": "win", + "blas": "", + "wasm": false, + "src": [ + "./src/dgemm.c", + "./src/dgemm_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla" + ] + }, + + { + "task": "build", + "os": "", + "blas": "", + "wasm": true, + "src": [ + "./src/dgemm.c", + "./src/dgemm_ndarray.c" + ], + "include": [ + "./include" + ], + "libraries": [], + "libpath": [], + "dependencies": [ + "@stdlib/blas/base/shared", + "@stdlib/blas/base/xerbla" + ] + } + ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/src/Makefile b/lib/node_modules/@stdlib/blas/base/dgemm/src/Makefile new file mode 100644 index 000000000000..bcf18aa46655 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/src/Makefile @@ -0,0 +1,70 @@ +#/ +# @license Apache-2.0 +# +# Copyright (c) 2024 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. +#/ + +# VARIABLES # + +ifndef VERBOSE + QUIET := @ +else + QUIET := +endif + +# Determine the OS ([1][1], [2][2]). +# +# [1]: https://en.wikipedia.org/wiki/Uname#Examples +# [2]: http://stackoverflow.com/a/27776822/2225624 +OS ?= $(shell uname) +ifneq (, $(findstring MINGW,$(OS))) + OS := WINNT +else +ifneq (, $(findstring MSYS,$(OS))) + OS := WINNT +else +ifneq (, $(findstring CYGWIN,$(OS))) + OS := WINNT +else +ifneq (, $(findstring Windows_NT,$(OS))) + OS := WINNT +endif +endif +endif +endif + + +# RULES # + +#/ +# Removes generated files for building an add-on. +# +# @example +# make clean-addon +#/ +clean-addon: + $(QUIET) -rm -f *.o *.node + +.PHONY: clean-addon + +#/ +# Removes generated files. +# +# @example +# make clean +#/ +clean: clean-addon + +.PHONY: clean diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/src/addon.c b/lib/node_modules/@stdlib/blas/base/dgemm/src/addon.c new file mode 100644 index 000000000000..d0d321a8c1a0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/src/addon.c @@ -0,0 +1,210 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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/base/dgemm.h" +#include "stdlib/blas/base/shared.h" +#include "stdlib/napi/export.h" +#include "stdlib/napi/argv.h" +#include "stdlib/napi/argv_int64.h" +#include "stdlib/napi/argv_int32.h" +#include "stdlib/napi/argv_double.h" +#include "stdlib/napi/argv_strided_float64array.h" +#include "stdlib/napi/argv_strided_float64array2d.h" +#include + +/** +* Receives JavaScript callback invocation data. +* +* ## Notes +* +* Arguments (14 total): +* +* - argv[0]: layout (int32) +* - argv[1]: transA (int32 enum) +* - argv[2]: transB (int32 enum) +* - argv[3]: M (int64) +* - argv[4]: N (int64) +* - argv[5]: K (int64) +* - argv[6]: alpha (double) +* - argv[7]: A (Float64Array) +* - argv[8]: LDA (int64) +* - argv[9]: B (Float64Array) +* - argv[10]: LDB (int64) +* - argv[11]: beta (double) +* - argv[12]: C (Float64Array) +* - argv[13]: LDC (int64) +* +* @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 ) { + CBLAS_INT sa1; + CBLAS_INT sa2; + CBLAS_INT sb1; + CBLAS_INT sb2; + CBLAS_INT sc1; + CBLAS_INT sc2; + CBLAS_INT nrowa; + CBLAS_INT ncola; + CBLAS_INT nrowb; + CBLAS_INT ncolb; + + STDLIB_NAPI_ARGV( env, info, argv, argc, 14 ); + + STDLIB_NAPI_ARGV_INT32( env, layout, argv, 0 ); + STDLIB_NAPI_ARGV_INT32( env, transA, argv, 1 ); + STDLIB_NAPI_ARGV_INT32( env, transB, argv, 2 ); + + STDLIB_NAPI_ARGV_INT64( env, M, argv, 3 ); + STDLIB_NAPI_ARGV_INT64( env, N, argv, 4 ); + STDLIB_NAPI_ARGV_INT64( env, K, argv, 5 ); + + STDLIB_NAPI_ARGV_DOUBLE( env, alpha, argv, 6 ); + STDLIB_NAPI_ARGV_DOUBLE( env, beta, argv, 11 ); + + STDLIB_NAPI_ARGV_INT64( env, LDA, argv, 8 ); + STDLIB_NAPI_ARGV_INT64( env, LDB, argv, 10 ); + STDLIB_NAPI_ARGV_INT64( env, LDC, argv, 13 ); + + // Compute dimensions of op(A) and op(B) based on transpose flags... + if ( transA == CblasNoTrans ) { + nrowa = M; + ncola = K; + } else { + nrowa = K; + ncola = M; + } + if ( transB == CblasNoTrans ) { + nrowb = K; + ncolb = N; + } else { + nrowb = N; + ncolb = K; + } + // Compute strides for 2D array validation based on layout... + if ( layout == CblasColMajor ) { + sa1 = 1; + sa2 = LDA; + sb1 = 1; + sb2 = LDB; + sc1 = 1; + sc2 = LDC; + } else { // CblasRowMajor + sa1 = LDA; + sa2 = 1; + sb1 = LDB; + sb2 = 1; + sc1 = LDC; + sc2 = 1; + } + STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY2D( env, A, nrowa, ncola, sa1, sa2, argv, 7 ); + STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY2D( env, B, nrowb, ncolb, sb1, sb2, argv, 9 ); + STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY2D( env, C, M, N, sc1, sc2, argv, 12 ); + + API_SUFFIX(c_dgemm)( layout, transA, transB, M, N, K, alpha, A, LDA, B, LDB, beta, C, LDC ); + + return NULL; +} + +/** +* Receives JavaScript callback invocation data. +* +* ## Notes +* +* Arguments (19 total): +* +* - argv[0]: transA (int32 enum) +* - argv[1]: transB (int32 enum) +* - argv[2]: M (int64) +* - argv[3]: N (int64) +* - argv[4]: K (int64) +* - argv[5]: alpha (double) +* - argv[6]: A (Float64Array) +* - argv[7]: strideA1 (int64) +* - argv[8]: strideA2 (int64) +* - argv[9]: offsetA (int64) +* - argv[10]: B (Float64Array) +* - argv[11]: strideB1 (int64) +* - argv[12]: strideB2 (int64) +* - argv[13]: offsetB (int64) +* - argv[14]: beta (double) +* - argv[15]: C (Float64Array) +* - argv[16]: strideC1 (int64) +* - argv[17]: strideC2 (int64) +* - argv[18]: offsetC (int64) +* +* @param env environment under which the function is invoked +* @param info callback data +* @return Node-API value +*/ +static napi_value addon_method( napi_env env, napi_callback_info info ) { + CBLAS_INT nrowa; + CBLAS_INT ncola; + CBLAS_INT nrowb; + CBLAS_INT ncolb; + + STDLIB_NAPI_ARGV( env, info, argv, argc, 19 ); + + STDLIB_NAPI_ARGV_INT32( env, transA, argv, 0 ); + STDLIB_NAPI_ARGV_INT32( env, transB, argv, 1 ); + + STDLIB_NAPI_ARGV_INT64( env, M, argv, 2 ); + STDLIB_NAPI_ARGV_INT64( env, N, argv, 3 ); + STDLIB_NAPI_ARGV_INT64( env, K, argv, 4 ); + + STDLIB_NAPI_ARGV_DOUBLE( env, alpha, argv, 5 ); + STDLIB_NAPI_ARGV_DOUBLE( env, beta, argv, 14 ); + + STDLIB_NAPI_ARGV_INT64( env, strideA1, argv, 7 ); + STDLIB_NAPI_ARGV_INT64( env, strideA2, argv, 8 ); + STDLIB_NAPI_ARGV_INT64( env, offsetA, argv, 9 ); + + STDLIB_NAPI_ARGV_INT64( env, strideB1, argv, 11 ); + STDLIB_NAPI_ARGV_INT64( env, strideB2, argv, 12 ); + STDLIB_NAPI_ARGV_INT64( env, offsetB, argv, 13 ); + + STDLIB_NAPI_ARGV_INT64( env, strideC1, argv, 16 ); + STDLIB_NAPI_ARGV_INT64( env, strideC2, argv, 17 ); + STDLIB_NAPI_ARGV_INT64( env, offsetC, argv, 18 ); + + // Compute dimensions of op(A) and op(B) for array length validation... + if ( transA == CblasNoTrans ) { + nrowa = M; + ncola = K; + } else { + nrowa = K; + ncola = M; + } + if ( transB == CblasNoTrans ) { + nrowb = K; + ncolb = N; + } else { + nrowb = N; + ncolb = K; + } + STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY2D( env, A, nrowa, ncola, strideA1, strideA2, argv, 6 ); + STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY2D( env, B, nrowb, ncolb, strideB1, strideB2, argv, 10 ); + STDLIB_NAPI_ARGV_STRIDED_FLOAT64ARRAY2D( env, C, M, N, strideC1, strideC2, argv, 15 ); + + API_SUFFIX(c_dgemm_ndarray)( transA, transB, M, N, K, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB, beta, C, strideC1, strideC2, offsetC ); + + return NULL; +} + +STDLIB_NAPI_MODULE_EXPORT_FCN_WITH_METHOD( addon, "ndarray", addon_method ) diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm.c b/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm.c new file mode 100644 index 000000000000..a1723df97d96 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm.c @@ -0,0 +1,132 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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/base/dgemm.h" +#include "stdlib/blas/base/shared.h" +#include "stdlib/blas/base/xerbla.h" + +/** +* Performs the matrix-matrix operation `C = alpha*op(A)*op(B) + beta*C`, where `op(X)` is either `op(X) = X` or `op(X) = X^T`, `alpha` and `beta` are scalars, and `A`, `B`, and `C` are matrices, with `op(A)` an `M`-by-`K` matrix, `op(B)` a `K`-by-`N` matrix, and `C` an `M`-by-`N` matrix. +* +* @param layout storage layout +* @param transA specifies whether `A` should be transposed, conjugate-transposed, or not transposed +* @param transB specifies whether `B` should be transposed, conjugate-transposed, or not transposed +* @param M number of rows in `op(A)` and `C` +* @param N number of columns in `op(B)` and `C` +* @param K number of columns in `op(A)` and rows in `op(B)` +* @param alpha scalar constant +* @param A first matrix +* @param LDA leading dimension of `A` +* @param B second matrix +* @param LDB leading dimension of `B` +* @param beta scalar constant +* @param C result matrix +* @param LDC leading dimension of `C` +*/ +void API_SUFFIX(c_dgemm)( const CBLAS_LAYOUT layout, const CBLAS_TRANSPOSE transA, const CBLAS_TRANSPOSE transB, const CBLAS_INT M, const CBLAS_INT N, const CBLAS_INT K, const double alpha, const double *A, const CBLAS_INT LDA, const double *B, const CBLAS_INT LDB, const double beta, double *C, const CBLAS_INT LDC ) { + CBLAS_INT strideA1; + CBLAS_INT strideA2; + CBLAS_INT strideB1; + CBLAS_INT strideB2; + CBLAS_INT strideC1; + CBLAS_INT strideC2; + CBLAS_INT minLDA; + CBLAS_INT minLDB; + CBLAS_INT minLDC; + + // Perform input argument validation... + if ( layout != CblasRowMajor && layout != CblasColMajor ) { + c_xerbla( 1, "c_dgemm", "Error: invalid argument. First argument must be a valid storage layout. Value: `%d`.", layout ); + return; + } + if ( transA != CblasNoTrans && transA != CblasTrans && transA != CblasConjTrans ) { + c_xerbla( 2, "c_dgemm", "Error: invalid argument. Second argument must be a valid transpose operation. Value: `%d`.", transA ); + return; + } + if ( transB != CblasNoTrans && transB != CblasTrans && transB != CblasConjTrans ) { + c_xerbla( 3, "c_dgemm", "Error: invalid argument. Third argument must be a valid transpose operation. Value: `%d`.", transB ); + return; + } + if ( M < 0 ) { + c_xerbla( 4, "c_dgemm", "Error: invalid argument. Fourth argument must be a nonnegative integer. Value: `%d`.", M ); + return; + } + if ( N < 0 ) { + c_xerbla( 5, "c_dgemm", "Error: invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.", N ); + return; + } + if ( K < 0 ) { + c_xerbla( 6, "c_dgemm", "Error: invalid argument. Sixth argument must be a nonnegative integer. Value: `%d`.", K ); + return; + } + // Compute the minimum required leading dimensions based on storage layout... + if ( layout == CblasColMajor ) { + // For column-major, the leading dimension equals the number of rows of the stored matrix: + minLDA = ( transA == CblasNoTrans ) ? M : K; + minLDB = ( transB == CblasNoTrans ) ? K : N; + minLDC = M; + } else { + // For row-major, the leading dimension equals the number of columns of the stored matrix: + minLDA = ( transA == CblasNoTrans ) ? K : M; + minLDB = ( transB == CblasNoTrans ) ? N : K; + minLDC = N; + } + if ( minLDA < 1 ) { + minLDA = 1; + } + if ( LDA < minLDA ) { + c_xerbla( 9, "c_dgemm", "Error: invalid argument. Ninth argument must be greater than or equal to max(1,%d). Value: `%d`.", minLDA, LDA ); + return; + } + if ( minLDB < 1 ) { + minLDB = 1; + } + if ( LDB < minLDB ) { + c_xerbla( 11, "c_dgemm", "Error: invalid argument. Eleventh argument must be greater than or equal to max(1,%d). Value: `%d`.", minLDB, LDB ); + return; + } + if ( minLDC < 1 ) { + minLDC = 1; + } + if ( LDC < minLDC ) { + c_xerbla( 14, "c_dgemm", "Error: invalid argument. Fourteenth argument must be greater than or equal to max(1,%d). Value: `%d`.", minLDC, LDC ); + return; + } + // Check whether we can avoid computation altogether... + if ( M == 0 || N == 0 || ( ( alpha == 0.0 || K == 0 ) && beta == 1.0 ) ) { + return; + } + // Compute strides based on storage layout... + if ( layout == CblasColMajor ) { + strideA1 = 1; + strideA2 = LDA; + strideB1 = 1; + strideB2 = LDB; + strideC1 = 1; + strideC2 = LDC; + } else { // layout == CblasRowMajor + strideA1 = LDA; + strideA2 = 1; + strideB1 = LDB; + strideB2 = 1; + strideC1 = LDC; + strideC2 = 1; + } + API_SUFFIX(c_dgemm_ndarray)( transA, transB, M, N, K, alpha, A, strideA1, strideA2, 0, B, strideB1, strideB2, 0, beta, C, strideC1, strideC2, 0 ); + return; +} diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm.f b/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm.f new file mode 100644 index 000000000000..f64939a7c750 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm.f @@ -0,0 +1,239 @@ +!> +! @license Apache-2.0 +! +! Copyright (c) 2024 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. +!< + +!> Performs the matrix-matrix operation `C = alpha*op(A)*op(B) + beta*C`, where `op(X)` is either `op(X) = X` or `op(X) = X^T`, `alpha` and `beta` are scalars, `A`, `B`, and `C` are matrices, with `op(A)` an `M`-by-`K` matrix, `op(B)` a `K`-by-`N` matrix, and `C` an `M`-by-`N` matrix. +! +! ## Notes +! +! * Modified version of reference BLAS routine (version 3.12.0). Updated to "free form" Fortran 95. +! +! ## Authors +! +! * Univ. of Tennessee +! * Univ. of California Berkeley +! * Univ. of Colorado Denver +! * NAG Ltd. +! +! ## History +! +! * Written on 8-February-1989. +! +! - Jack Dongarra, Argonne National Lab. +! - Iain Duff, AERE Harwell. +! - Jeremy Du Croz, Numerical Algorithms Group Ltd. +! - Sven Hammarling, Numerical Algorithms Group Ltd. +! +! ## License +! +! From : +! +! > The reference BLAS is a freely-available software package. It is available from netlib via anonymous ftp and the World Wide Web. Thus, it can be included in commercial software packages (and has been). We only ask that proper credit be given to the authors. +! > +! > Like all software, it is copyrighted. It is not trademarked, but we do ask the following: +! > +! > * If you modify the source for these routines we ask that you change the name of the routine and comment the changes made to the original. +! > +! > * We will gladly answer any questions regarding the software. If a modification is done, however, it is the responsibility of the person who modified the routine to provide support. +! +! @param {character} transA - specifies whether `A` is transposed (`T` or `C`) or not transposed (`N`) +! @param {character} transB - specifies whether `B` is transposed (`T` or `C`) or not transposed (`N`) +! @param {integer} M - number of rows in `op(A)` and `C` +! @param {integer} N - number of columns in `op(B)` and `C` +! @param {integer} K - number of columns in `op(A)` and rows in `op(B)` +! @param {double} alpha - scalar constant +! @param {Array} A - first matrix +! @param {integer} LDA - leading dimension of `A` +! @param {Array} B - second matrix +! @param {integer} LDB - leading dimension of `B` +! @param {double} beta - scalar constant +! @param {Array} C - result matrix +! @param {integer} LDC - leading dimension of `C` +!< +subroutine dgemm( transA, transB, M, N, K, alpha, A, LDA, B, LDB, beta, C, LDC ) + implicit none + ! .. + ! Internal parameters: + integer, parameter :: dp = kind(0.0d0) ! double-precision + ! .. + ! Scalar arguments: + character(len=1) :: transA, transB + real(dp) :: alpha, beta + integer :: M, N, K, LDA, LDB, LDC + ! .. + ! Array arguments: + real(dp) :: A(LDA,*), B(LDB,*), C(LDC,*) + ! .. + ! Local scalars: + real(dp) :: temp + integer :: i, info, j, l, nrowa, nrowb + logical :: nota, notb + ! .. + ! External functions: + interface + subroutine xerbla( srname, info ) + character*(*) :: srname + integer :: info + end subroutine xerbla + end interface + ! .. + ! Intrinsic functions: + intrinsic max + ! .. + ! Test whether `op(A)` is transposed... + nota = ( transA == 'N' .OR. transA == 'n' ) + ! .. + ! Test whether `op(B)` is transposed... + notb = ( transB == 'N' .OR. transB == 'n' ) + ! .. + ! Set `nrowa` to the number of rows of `A` as stored (before transposing)... + if ( nota ) then + nrowa = M + else + nrowa = K + end if + ! .. + ! Set `nrowb` to the number of rows of `B` as stored (before transposing)... + if ( notb ) then + nrowb = K + else + nrowb = N + end if + ! .. + ! Validate input arguments... + info = 0 + if ( .NOT. nota .AND. transA /= 'T' .AND. transA /= 't' .AND. transA /= 'C' .AND. transA /= 'c' ) then + info = 1 + else if ( .NOT. notb .AND. transB /= 'T' .AND. transB /= 't' .AND. transB /= 'C' .AND. transB /= 'c' ) then + info = 2 + else if ( M < 0 ) then + info = 3 + else if ( N < 0 ) then + info = 4 + else if ( K < 0 ) then + info = 5 + else if ( LDA < max( 1, nrowa ) ) then + info = 8 + else if ( LDB < max( 1, nrowb ) ) then + info = 10 + else if ( LDC < max( 1, M ) ) then + info = 13 + end if + if ( info /= 0 ) then + call xerbla( 'dgemm ', info ) + return + end if + ! .. + ! Quick return if possible... + if ( M == 0 .OR. N == 0 .OR. ( ( alpha == 0.0d0 .OR. K == 0 ) .AND. beta == 1.0d0 ) ) then + return + end if + ! .. + ! Handle the case where `alpha` is zero... + if ( alpha == 0.0d0 ) then + if ( beta == 0.0d0 ) then + do j = 1, N + do i = 1, M + C( i, j ) = 0.0d0 + end do + end do + else + do j = 1, N + do i = 1, M + C( i, j ) = beta * C( i, j ) + end do + end do + end if + return + end if + ! .. + ! Perform matrix multiplication... + if ( notb ) then + if ( nota ) then + ! Form C = alpha*A*B + beta*C + do j = 1, N + if ( beta == 0.0d0 ) then + do i = 1, M + C( i, j ) = 0.0d0 + end do + else if ( beta /= 1.0d0 ) then + do i = 1, M + C( i, j ) = beta * C( i, j ) + end do + end if + do l = 1, K + temp = alpha * B( l, j ) + do i = 1, M + C( i, j ) = C( i, j ) + temp * A( i, l ) + end do + end do + end do + else + ! Form C = alpha*A^T*B + beta*C + do j = 1, N + do i = 1, M + temp = 0.0d0 + do l = 1, K + temp = temp + A( l, i ) * B( l, j ) + end do + if ( beta == 0.0d0 ) then + C( i, j ) = alpha * temp + else + C( i, j ) = alpha * temp + beta * C( i, j ) + end if + end do + end do + end if + else + if ( nota ) then + ! Form C = alpha*A*B^T + beta*C + do j = 1, N + if ( beta == 0.0d0 ) then + do i = 1, M + C( i, j ) = 0.0d0 + end do + else if ( beta /= 1.0d0 ) then + do i = 1, M + C( i, j ) = beta * C( i, j ) + end do + end if + do l = 1, K + temp = alpha * B( j, l ) + do i = 1, M + C( i, j ) = C( i, j ) + temp * A( i, l ) + end do + end do + end do + else + ! Form C = alpha*A^T*B^T + beta*C + do j = 1, N + do i = 1, M + temp = 0.0d0 + do l = 1, K + temp = temp + A( l, i ) * B( j, l ) + end do + if ( beta == 0.0d0 ) then + C( i, j ) = alpha * temp + else + C( i, j ) = alpha * temp + beta * C( i, j ) + end if + end do + end do + end if + end if + return +end subroutine dgemm diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm_cblas.c b/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm_cblas.c new file mode 100644 index 000000000000..08a990f0902b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm_cblas.c @@ -0,0 +1,43 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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/base/dgemm.h" +#include "stdlib/blas/base/dgemm_cblas.h" +#include "stdlib/blas/base/shared.h" + +/** +* Performs the matrix-matrix operation `C = alpha*op(A)*op(B) + beta*C`, where `op(X)` is either `op(X) = X` or `op(X) = X^T`, `alpha` and `beta` are scalars, and `A`, `B`, and `C` are matrices, with `op(A)` an `M`-by-`K` matrix, `op(B)` a `K`-by-`N` matrix, and `C` an `M`-by-`N` matrix. +* +* @param layout storage layout +* @param transA specifies whether `A` should be transposed, conjugate-transposed, or not transposed +* @param transB specifies whether `B` should be transposed, conjugate-transposed, or not transposed +* @param M number of rows in `op(A)` and `C` +* @param N number of columns in `op(B)` and `C` +* @param K number of columns in `op(A)` and rows in `op(B)` +* @param alpha scalar constant +* @param A first matrix +* @param LDA leading dimension of `A` +* @param B second matrix +* @param LDB leading dimension of `B` +* @param beta scalar constant +* @param C result matrix +* @param LDC leading dimension of `C` +*/ +void API_SUFFIX(c_dgemm)( const CBLAS_LAYOUT layout, const CBLAS_TRANSPOSE transA, const CBLAS_TRANSPOSE transB, const CBLAS_INT M, const CBLAS_INT N, const CBLAS_INT K, const double alpha, const double *A, const CBLAS_INT LDA, const double *B, const CBLAS_INT LDB, const double beta, double *C, const CBLAS_INT LDC ) { + API_SUFFIX(cblas_dgemm)( layout, transA, transB, M, N, K, alpha, A, LDA, B, LDB, beta, C, LDC ); +} diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm_f.c b/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm_f.c new file mode 100644 index 000000000000..191f1cc8d6ee --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm_f.c @@ -0,0 +1,74 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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/base/dgemm.h" +#include "stdlib/blas/base/dgemm_fortran.h" +#include "stdlib/blas/base/shared.h" +#include "stdlib/blas/base/xerbla.h" + +/** +* Performs the matrix-matrix operation `C = alpha*op(A)*op(B) + beta*C`, where `op(X)` is either `op(X) = X` or `op(X) = X^T`, `alpha` and `beta` are scalars, and `A`, `B`, and `C` are matrices, with `op(A)` an `M`-by-`K` matrix, `op(B)` a `K`-by-`N` matrix, and `C` an `M`-by-`N` matrix. +* +* @param layout storage layout +* @param transA specifies whether `A` should be transposed, conjugate-transposed, or not transposed +* @param transB specifies whether `B` should be transposed, conjugate-transposed, or not transposed +* @param M number of rows in `op(A)` and `C` +* @param N number of columns in `op(B)` and `C` +* @param K number of columns in `op(A)` and rows in `op(B)` +* @param alpha scalar constant +* @param A first matrix +* @param LDA leading dimension of `A` +* @param B second matrix +* @param LDB leading dimension of `B` +* @param beta scalar constant +* @param C result matrix +* @param LDC leading dimension of `C` +*/ +void API_SUFFIX(c_dgemm)( const CBLAS_LAYOUT layout, const CBLAS_TRANSPOSE transA, const CBLAS_TRANSPOSE transB, const CBLAS_INT M, const CBLAS_INT N, const CBLAS_INT K, const double alpha, const double *A, const CBLAS_INT LDA, const double *B, const CBLAS_INT LDB, const double beta, double *C, const CBLAS_INT LDC ) { + char ta; + char tb; + char ta_swap; + char tb_swap; + + if ( layout == CblasColMajor ) { + // Map CBLAS transpose enums to Fortran characters... + ta = ( transA == CblasNoTrans ) ? 'N' : 'T'; + tb = ( transB == CblasNoTrans ) ? 'N' : 'T'; + dgemm( &ta, &tb, &M, &N, &K, &alpha, A, &LDA, B, &LDB, &beta, C, &LDC ); + return; + } + if ( layout == CblasRowMajor ) { + /* + * For row-major layout, use the transpose equivalence: + * + * C(row) = α * op(A)(row) * op(B)(row) + β*C(row) + * + * is equivalent to (in column-major): + * + * C^T = α * op(B)^T * op(A)^T + β*C^T + * + * which means swapping A↔B, M↔N, and flipping transpose flags. + */ + ta_swap = ( transB == CblasNoTrans ) ? 'N' : 'T'; + tb_swap = ( transA == CblasNoTrans ) ? 'N' : 'T'; + dgemm( &ta_swap, &tb_swap, &N, &M, &K, &alpha, B, &LDB, A, &LDA, &beta, C, &LDC ); + return; + } + c_xerbla( 1, "c_dgemm", "Error: invalid argument. First argument must be a valid storage layout. Value: `%d`.", layout ); + return; +} diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm_ndarray.c b/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm_ndarray.c new file mode 100644 index 000000000000..c1896cdb4460 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm_ndarray.c @@ -0,0 +1,141 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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/base/dgemm.h" +#include "stdlib/blas/base/shared.h" +#include "stdlib/blas/base/xerbla.h" + +/** +* Performs the matrix-matrix operation `C = alpha*op(A)*op(B) + beta*C`, using alternative indexing semantics and where `op(X)` is either `op(X) = X` or `op(X) = X^T`, `alpha` and `beta` are scalars, and `A`, `B`, and `C` are matrices, with `op(A)` an `M`-by-`K` matrix, `op(B)` a `K`-by-`N` matrix, and `C` an `M`-by-`N` matrix. +* +* @param transA specifies whether `A` should be transposed, conjugate-transposed, or not transposed +* @param transB specifies whether `B` should be transposed, conjugate-transposed, or not transposed +* @param M number of rows in `op(A)` and `C` +* @param N number of columns in `op(B)` and `C` +* @param K number of columns in `op(A)` and rows in `op(B)` +* @param alpha scalar constant +* @param A first matrix +* @param strideA1 stride of the first dimension of `A` +* @param strideA2 stride of the second dimension of `A` +* @param offsetA starting index for `A` +* @param B second matrix +* @param strideB1 stride of the first dimension of `B` +* @param strideB2 stride of the second dimension of `B` +* @param offsetB starting index for `B` +* @param beta scalar constant +* @param C result matrix +* @param strideC1 stride of the first dimension of `C` +* @param strideC2 stride of the second dimension of `C` +* @param offsetC starting index for `C` +*/ +void API_SUFFIX(c_dgemm_ndarray)( const CBLAS_TRANSPOSE transA, const CBLAS_TRANSPOSE transB, const CBLAS_INT M, const CBLAS_INT N, const CBLAS_INT K, const double alpha, const double *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA, const double *B, const CBLAS_INT strideB1, const CBLAS_INT strideB2, const CBLAS_INT offsetB, const double beta, double *C, const CBLAS_INT strideC1, const CBLAS_INT strideC2, const CBLAS_INT offsetC ) { + CBLAS_INT da_row; // stride along rows of op(A), i.e., iterates over M + CBLAS_INT da_col; // stride along cols of op(A), i.e., iterates over K + CBLAS_INT db_row; // stride along rows of op(B), i.e., iterates over K + CBLAS_INT db_col; // stride along cols of op(B), i.e., iterates over N + CBLAS_INT ia; + CBLAS_INT ib; + CBLAS_INT ic; + CBLAS_INT i; + CBLAS_INT j; + CBLAS_INT l; + double temp; + + // Validate input arguments... + if ( M < 0 ) { + c_xerbla( 3, "c_dgemm_ndarray", "Error: invalid argument. Third argument must be a nonnegative integer. Value: `%d`.", M ); + return; + } + if ( N < 0 ) { + c_xerbla( 4, "c_dgemm_ndarray", "Error: invalid argument. Fourth argument must be a nonnegative integer. Value: `%d`.", N ); + return; + } + if ( K < 0 ) { + c_xerbla( 5, "c_dgemm_ndarray", "Error: invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.", K ); + return; + } + // Quick return if possible... + if ( M == 0 || N == 0 || ( ( alpha == 0.0 || K == 0 ) && beta == 1.0 ) ) { + return; + } + // Scale C by beta (handle beta == 0 and beta == 1 as special cases)... + if ( beta == 0.0 ) { + ic = offsetC; + for ( i = 0; i < M; i++ ) { + for ( j = 0; j < N; j++ ) { + C[ ic + (j * strideC2) ] = 0.0; + } + ic += strideC1; + } + } else if ( beta != 1.0 ) { + ic = offsetC; + for ( i = 0; i < M; i++ ) { + for ( j = 0; j < N; j++ ) { + C[ ic + (j * strideC2) ] *= beta; + } + ic += strideC1; + } + } + // Check whether we can early return after scaling... + if ( alpha == 0.0 || K == 0 ) { + return; + } + /* + * Resolve strides for op(A) and op(B). + * + * If transA == CblasNoTrans: op(A)[i,l] = A[offsetA + i*strideA1 + l*strideA2] + * → da_row = strideA1 (iterate over rows i = 0..M-1) + * → da_col = strideA2 (iterate over cols l = 0..K-1) + * + * If transA == CblasTrans: op(A)[i,l] = A[offsetA + l*strideA1 + i*strideA2] + * → da_row = strideA2 (iterate over rows i = 0..M-1) + * → da_col = strideA1 (iterate over cols l = 0..K-1) + */ + if ( transA == CblasNoTrans ) { + da_row = strideA1; + da_col = strideA2; + } else { + da_row = strideA2; + da_col = strideA1; + } + if ( transB == CblasNoTrans ) { + db_row = strideB1; + db_col = strideB2; + } else { + db_row = strideB2; + db_col = strideB1; + } + // Compute C += alpha * op(A) * op(B)... + ic = offsetC; + for ( i = 0; i < M; i++ ) { + for ( j = 0; j < N; j++ ) { + // Compute dot product of row i of op(A) with col j of op(B)... + ia = offsetA + ( i * da_row ); + ib = offsetB + ( j * db_col ); + temp = 0.0; + for ( l = 0; l < K; l++ ) { + temp += A[ ia ] * B[ ib ]; + ia += da_col; + ib += db_row; + } + C[ ic + (j * strideC2) ] += alpha * temp; + } + ic += strideC1; + } + return; +} diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/test/test.dgemm.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/test/test.dgemm.native.js new file mode 100644 index 000000000000..c7e046092294 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/test/test.dgemm.native.js @@ -0,0 +1,714 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var dscal = require( '@stdlib/blas/base/dscal' ); + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/dgemm.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; + + +// FIXTURES // + +var cntantb = require( './fixtures/column_major_nta_ntb.json' ); +var ctantb = require( './fixtures/column_major_ta_ntb.json' ); +var cntatb = require( './fixtures/column_major_nta_tb.json' ); +var ctatb = require( './fixtures/column_major_ta_tb.json' ); +var rntantb = require( './fixtures/row_major_nta_ntb.json' ); +var rtantb = require( './fixtures/row_major_ta_ntb.json' ); +var rntatb = require( './fixtures/row_major_nta_tb.json' ); +var rtatb = require( './fixtures/row_major_ta_tb.json' ); + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dgemm, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 14', opts, function test( t ) { + t.strictEqual( dgemm.length, 14, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided an invalid first argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rntantb; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dgemm( value, data.transA, data.transB, data.M, data.N, data.K, data.alpha, new Float64Array( data.A ), data.lda, new Float64Array( data.B ), data.ldb, data.beta, new Float64Array( data.C ), data.ldc ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid second argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rntantb; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dgemm( data.order, value, data.transB, data.M, data.N, data.K, data.alpha, new Float64Array( data.A ), data.lda, new Float64Array( data.B ), data.ldb, data.beta, new Float64Array( data.C ), data.ldc ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid third argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rntantb; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dgemm( data.order, data.transA, value, data.M, data.N, data.K, data.alpha, new Float64Array( data.A ), data.lda, new Float64Array( data.B ), data.ldb, data.beta, new Float64Array( data.C ), data.ldc ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fourth argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rntantb; + + values = [ + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dgemm( data.order, data.transA, data.transB, value, data.N, data.K, data.alpha, new Float64Array( data.A ), data.lda, new Float64Array( data.B ), data.ldb, data.beta, new Float64Array( data.C ), data.ldc ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fifth argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rntantb; + + values = [ + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dgemm( data.order, data.transA, data.transB, data.M, value, data.K, data.alpha, new Float64Array( data.A ), data.lda, new Float64Array( data.B ), data.ldb, data.beta, new Float64Array( data.C ), data.ldc ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid sixth argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rntantb; + + values = [ + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dgemm( data.order, data.transA, data.transB, data.M, data.N, value, data.alpha, new Float64Array( data.A ), data.lda, new Float64Array( data.B ), data.ldb, data.beta, new Float64Array( data.C ), data.ldc ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid ninth argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rntantb; + + values = [ + 2, + 1, + 0, + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dgemm( data.order, data.transA, data.transB, data.M, data.N, data.K, data.alpha, new Float64Array( data.A ), value, new Float64Array( data.B ), data.ldb, data.beta, new Float64Array( data.C ), data.ldc ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid eleventh argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rntantb; + + values = [ + 3, + 2, + 1, + 0, + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dgemm( data.order, data.transA, data.transB, data.M, data.N, data.K, data.alpha, new Float64Array( data.A ), data.lda, new Float64Array( data.B ), value, data.beta, new Float64Array( data.C ), data.ldc ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fourteenth argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rntantb; + + values = [ + 3, + 2, + 1, + 0, + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dgemm( data.order, data.transA, data.transB, data.M, data.N, data.K, data.alpha, new Float64Array( data.A ), data.lda, new Float64Array( data.B ), data.ldb, data.beta, new Float64Array( data.C ), value ); + }; + } +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (row-major, no-transpose, no-transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = rntantb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.order, data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.lda, b, data.ldb, data.beta, c, data.ldc ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (column-major, no-transpose, no-transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = cntantb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.order, data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.lda, b, data.ldb, data.beta, c, data.ldc ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (row-major, transpose, no-transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = rtantb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.order, data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.lda, b, data.ldb, data.beta, c, data.ldc ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (column-major, transpose, no-transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = ctantb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.order, data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.lda, b, data.ldb, data.beta, c, data.ldc ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (row-major, no-transpose, transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = rntatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.order, data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.lda, b, data.ldb, data.beta, c, data.ldc ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (column-major, no-transpose, transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = cntatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.order, data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.lda, b, data.ldb, data.beta, c, data.ldc ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (row-major, transpose, transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = rtatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.order, data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.lda, b, data.ldb, data.beta, c, data.ldc ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (column-major, transpose, transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = ctatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.order, data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.lda, b, data.ldb, data.beta, c, data.ldc ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a reference to the third input matrix (row-major)', opts, function test( t ) { + var data; + var out; + var a; + var b; + var c; + + data = rtatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + out = dgemm( data.order, data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.lda, b, data.ldb, data.beta, c, data.ldc ); + t.strictEqual( out, c, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a reference to the third input matrix (column-major)', opts, function test( t ) { + var data; + var out; + var a; + var b; + var c; + + data = ctatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + out = dgemm( data.order, data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.lda, b, data.ldb, data.beta, c, data.ldc ); + t.strictEqual( out, c, 'returns expected value' ); + t.end(); +}); + +tape( 'if either `M` or `N` is `0`, the function returns the third input matrix unchanged (row-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = rtatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C ); + + out = dgemm( data.order, data.transA, data.transB, 0, data.N, data.K, data.alpha, a, data.lda, b, data.ldb, data.beta, c, data.ldc ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + out = dgemm( data.order, data.transA, data.transB, data.M, 0, data.K, data.alpha, a, data.lda, b, data.ldb, data.beta, c, data.ldc ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if either `M` or `N` is `0`, the function returns the third input matrix unchanged (column-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = ctatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C ); + + out = dgemm( data.order, data.transA, data.transB, 0, data.N, data.K, data.alpha, a, data.lda, b, data.ldb, data.beta, c, data.ldc ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + out = dgemm( data.order, data.transA, data.transB, data.M, 0, data.K, data.alpha, a, data.lda, b, data.ldb, data.beta, c, data.ldc ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` or `K` is `0` and `β` is `1`, the function returns the third input matrix unchanged (row-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = rtatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C ); + + out = dgemm( data.order, data.transA, data.transB, data.M, data.N, data.K, 0.0, a, data.lda, b, data.ldb, 1.0, c, data.ldc ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + out = dgemm( data.order, data.transA, data.transB, data.M, data.N, 0, data.alpha, a, data.lda, b, data.ldb, 1.0, c, data.ldc ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` or `K` is `0` and `β` is `1`, the function returns the third input matrix unchanged (column-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = ctatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C ); + + out = dgemm( data.order, data.transA, data.transB, data.M, data.N, data.K, 0.0, a, data.lda, b, data.ldb, 1.0, c, data.ldc ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + out = dgemm( data.order, data.transA, data.transB, data.M, data.N, 0, data.alpha, a, data.lda, b, data.ldb, 1.0, c, data.ldc ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is `0`, the function returns the third input matrix filled with zeros (row-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = rtatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( c.length ); + + out = dgemm( data.order, data.transA, data.transB, data.M, data.N, data.K, 0.0, a, data.lda, b, data.ldb, 0.0, c, data.ldc ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is `0`, the function returns the third input matrix filled with zeros (column-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = ctatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( c.length ); + + out = dgemm( data.order, data.transA, data.transB, data.M, data.N, data.K, 0.0, a, data.lda, b, data.ldb, 0.0, c, data.ldc ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is neither `0` nor `1`, the function returns the third input matrix scaled by `β` (row-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = rtatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = dscal( c.length, 10.0, new Float64Array( c ), 1 ); + + out = dgemm( data.order, data.transA, data.transB, data.M, data.N, data.K, 0.0, a, data.lda, b, data.ldb, 10.0, c, data.ldc ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is neither `0` nor `1`, the function returns the third input matrix scaled by `β` (column-major)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = ctatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = dscal( c.length, 10.0, new Float64Array( c ), 1 ); + + out = dgemm( data.order, data.transA, data.transB, data.M, data.N, data.K, 0.0, a, data.lda, b, data.ldb, 10.0, c, data.ldc ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/test/test.ndarray.native.js new file mode 100644 index 000000000000..3d6033cc866b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dgemm/test/test.ndarray.native.js @@ -0,0 +1,1496 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var resolve = require( 'path' ).resolve; +var tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var ones = require( '@stdlib/array/ones' ); +var filled = require( '@stdlib/array/filled' ); +var tryRequire = require( '@stdlib/utils/try-require' ); +var dscal = require( '@stdlib/blas/base/dscal' ); + + +// VARIABLES // + +var dgemm = tryRequire( resolve( __dirname, './../lib/ndarray.native.js' ) ); +var opts = { + 'skip': ( dgemm instanceof Error ) +}; + + +// FIXTURES // + +var cacbccntantb = require( './fixtures/ca_cb_cc_nta_ntb.json' ); +var cacbccntatb = require( './fixtures/ca_cb_cc_nta_tb.json' ); +var cacbcctantb = require( './fixtures/ca_cb_cc_ta_ntb.json' ); +var cacbcctatb = require( './fixtures/ca_cb_cc_ta_tb.json' ); +var cacbrcntantb = require( './fixtures/ca_cb_rc_nta_ntb.json' ); +var cacbrcntatb = require( './fixtures/ca_cb_rc_nta_tb.json' ); +var cacbrctantb = require( './fixtures/ca_cb_rc_ta_ntb.json' ); +var cacbrctatb = require( './fixtures/ca_cb_rc_ta_tb.json' ); +var carbccntantb = require( './fixtures/ca_rb_cc_nta_ntb.json' ); +var carbccntatb = require( './fixtures/ca_rb_cc_nta_tb.json' ); +var carbcctantb = require( './fixtures/ca_rb_cc_ta_ntb.json' ); +var carbcctatb = require( './fixtures/ca_rb_cc_ta_tb.json' ); +var carbrcntantb = require( './fixtures/ca_rb_rc_nta_ntb.json' ); +var carbrcntatb = require( './fixtures/ca_rb_rc_nta_tb.json' ); +var carbrctantb = require( './fixtures/ca_rb_rc_ta_ntb.json' ); +var carbrctatb = require( './fixtures/ca_rb_rc_ta_tb.json' ); +var racbccntantb = require( './fixtures/ra_cb_cc_nta_ntb.json' ); +var racbccntatb = require( './fixtures/ra_cb_cc_nta_tb.json' ); +var racbcctantb = require( './fixtures/ra_cb_cc_ta_ntb.json' ); +var racbcctatb = require( './fixtures/ra_cb_cc_ta_tb.json' ); +var racbrcntantb = require( './fixtures/ra_cb_rc_nta_ntb.json' ); +var racbrcntatb = require( './fixtures/ra_cb_rc_nta_tb.json' ); +var racbrctantb = require( './fixtures/ra_cb_rc_ta_ntb.json' ); +var racbrctatb = require( './fixtures/ra_cb_rc_ta_tb.json' ); +var rarbccntantb = require( './fixtures/ra_rb_cc_nta_ntb.json' ); +var rarbccntatb = require( './fixtures/ra_rb_cc_nta_tb.json' ); +var rarbcctantb = require( './fixtures/ra_rb_cc_ta_ntb.json' ); +var rarbcctatb = require( './fixtures/ra_rb_cc_ta_tb.json' ); +var rarbrcntantb = require( './fixtures/ra_rb_rc_nta_ntb.json' ); +var rarbrcntatb = require( './fixtures/ra_rb_rc_nta_tb.json' ); +var rarbrctantb = require( './fixtures/ra_rb_rc_ta_ntb.json' ); +var rarbrctatb = require( './fixtures/ra_rb_rc_ta_tb.json' ); +var carbcctantbsa1sa2 = require( './fixtures/ca_rb_cc_ta_ntb_sa1_sa2.json' ); +var carbcctantbsa1nsa2 = require( './fixtures/ca_rb_cc_ta_ntb_sa1n_sa2.json' ); +var carbcctantbsa1sa2n = require( './fixtures/ca_rb_cc_ta_ntb_sa1_sa2n.json' ); +var carbcctantbsa1nsa2n = require( './fixtures/ca_rb_cc_ta_ntb_sa1n_sa2n.json' ); +var rarbcctantbsb1sb2 = require( './fixtures/ra_rb_cc_ta_ntb_sb1_sb2.json' ); +var rarbcctantbsb1nsb2 = require( './fixtures/ra_rb_cc_ta_ntb_sb1n_sb2.json' ); +var rarbcctantbsb1sb2n = require( './fixtures/ra_rb_cc_ta_ntb_sb1_sb2n.json' ); +var rarbcctantbsb1nsb2n = require( './fixtures/ra_rb_cc_ta_ntb_sb1n_sb2n.json' ); +var racbrcntatbsc1sc2 = require( './fixtures/ra_cb_rc_nta_tb_sc1_sc2.json' ); +var racbrcntatbsc1nsc2 = require( './fixtures/ra_cb_rc_nta_tb_sc1n_sc2.json' ); +var racbrcntatbsc1sc2n = require( './fixtures/ra_cb_rc_nta_tb_sc1_sc2n.json' ); +var racbrcntatbsc1nsc2n = require( './fixtures/ra_cb_rc_nta_tb_sc1n_sc2n.json' ); +var rarbrcntantboa = require( './fixtures/ra_rb_rc_nta_ntb_oa.json' ); +var rarbrcntantbob = require( './fixtures/ra_rb_rc_nta_ntb_ob.json' ); +var rarbrcntantboc = require( './fixtures/ra_rb_rc_nta_ntb_oc.json' ); +var cap = require( './fixtures/ra_rb_rc_nta_ntb_complex_access_pattern.json' ); + + +// TESTS // + +tape( 'main export is a function', opts, function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dgemm, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 19', opts, function test( t ) { + t.strictEqual( dgemm.length, 19, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided an invalid first argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rarbrcntantb; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dgemm( value, data.transB, data.M, data.N, data.K, data.alpha, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.B ), data.strideB1, data.strideB2, data.offsetB, data.beta, new Float64Array( data.C ), data.strideC1, data.strideC2, data.offsetC ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid second argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rarbrcntantb; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dgemm( data.transA, value, data.M, data.N, data.K, data.alpha, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.B ), data.strideB1, data.strideB2, data.offsetB, data.beta, new Float64Array( data.C ), data.strideC1, data.strideC2, data.offsetC ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid third argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rarbrcntantb; + + values = [ + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dgemm( data.transA, data.transB, value, data.N, data.K, data.alpha, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.B ), data.strideB1, data.strideB2, data.offsetB, data.beta, new Float64Array( data.C ), data.strideC1, data.strideC2, data.offsetC ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fourth argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rarbrcntantb; + + values = [ + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dgemm( data.transA, data.transB, data.M, value, data.K, data.alpha, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.B ), data.strideB1, data.strideB2, data.offsetB, data.beta, new Float64Array( data.C ), data.strideC1, data.strideC2, data.offsetC ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fifth argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rarbrcntantb; + + values = [ + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dgemm( data.transA, data.transB, data.M, data.N, value, data.alpha, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.B ), data.strideB1, data.strideB2, data.offsetB, data.beta, new Float64Array( data.C ), data.strideC1, data.strideC2, data.offsetC ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid seventeenth argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rarbrcntantb; + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.B ), data.strideB1, data.strideB2, data.offsetB, data.beta, new Float64Array( data.C ), value, data.strideC2, data.offsetC ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid eighteenth argument', opts, function test( t ) { + var values; + var data; + var i; + + data = rarbrcntantb; + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.B ), data.strideB1, data.strideB2, data.offsetB, data.beta, new Float64Array( data.C ), data.strideC1, value, data.offsetC ); + }; + } +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (column_major, column_major, column_major, no-transpose, no-transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = cacbccntantb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (column_major, column_major, column_major, transpose, no-transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = cacbcctantb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (column_major, column_major, column_major, no-transpose, transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = cacbccntatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (column_major, column_major, column_major, transpose, transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = cacbcctatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (column_major, column_major, row_major, no-transpose, no-transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = cacbrcntantb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (column_major, column_major, row_major, transpose, no-transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = cacbrctantb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (column_major, column_major, row_major, no-transpose, transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = cacbrcntatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (column_major, column_major, row_major, transpose, transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = cacbrctatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (column_major, row_major, column_major, no-transpose, no-transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = carbccntantb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (column_major, row_major, column_major, transpose, no-transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = carbcctantb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (column_major, row_major, column_major, no-transpose, transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = carbccntatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (column_major, row_major, column_major, transpose, transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = carbcctatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (column_major, row_major, row_major, no-transpose, no-transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = carbrcntantb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (column_major, row_major, row_major, transpose, no-transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = carbrctantb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (column_major, row_major, row_major, no-transpose, transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = carbrcntatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (column_major, row_major, row_major, transpose, transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = carbrctatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (row_major, column_major, column_major, no-transpose, no-transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = racbccntantb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (row_major, column_major, column_major, transpose, no-transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = racbcctantb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (row_major, column_major, column_major, no-transpose, transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = racbccntatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (row_major, column_major, column_major, transpose, transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = racbcctatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (row_major, column_major, row_major, no-transpose, no-transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = racbrcntantb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (row_major, column_major, row_major, transpose, no-transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = racbrctantb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (row_major, column_major, row_major, no-transpose, transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = racbrcntatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (row_major, column_major, row_major, transpose, transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = racbrctatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (row_major, row_major, column_major, no-transpose, no-transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = rarbccntantb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (row_major, row_major, column_major, transpose, no-transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = rarbcctantb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (row_major, row_major, column_major, no-transpose, transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = rarbccntatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (row_major, row_major, column_major, transpose, transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = rarbcctatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (row_major, row_major, row_major, no-transpose, no-transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = rarbrcntantb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (row_major, row_major, row_major, transpose, no-transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = rarbrctantb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (row_major, row_major, row_major, no-transpose, transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = rarbrcntatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function performs the matrix-matrix operation `C = α*op(A)*op(B) + β*C` (row_major, row_major, row_major, transpose, transpose)', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = rarbrctatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns a reference to the third input matrix', opts, function test( t ) { + var data; + var out; + var a; + var b; + var c; + + data = rarbrcntantb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.end(); +}); + +tape( 'if either `M` or `N` is `0`, the function returns the third input matrix unchanged', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = rarbrctatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C ); + + out = dgemm( data.transA, data.transB, 0, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + out = dgemm( data.transA, data.transB, data.M, 0, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` or `K` is `0` and `β` is `1`, the function returns the third input matrix unchanged', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = rarbrctatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, 0.0, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, 1.0, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + out = dgemm( data.transA, data.transB, data.M, data.N, 0, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, 1.0, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is `0`, the function returns the third input matrix filled with zeros', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = rarbrctatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( c.length ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, 0.0, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, 0.0, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `α` is `0` and `β` is neither `0` nor `1`, the function returns the third input matrix scaled by `β`', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = rarbrctatb; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = dscal( c.length, 10.0, new Float64Array( c ), 1 ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, 0.0, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, 10.0, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying the strides of the first and second dimensions of `A`', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = carbcctantbsa1sa2; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports a negative stride for the first dimension of `A`', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = carbcctantbsa1nsa2; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports a negative stride for the second dimension of `A`', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = carbcctantbsa1sa2n; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports negative strides for `A`', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = carbcctantbsa1nsa2n; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying an offset parameter for `A`', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = rarbrcntantboa; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying the strides of the first and second dimensions of `B`', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = rarbcctantbsb1sb2; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports a negative stride for the first dimension of `B`', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = rarbcctantbsb1nsb2; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports a negative stride for the second dimension of `B`', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = rarbcctantbsb1sb2n; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports negative strides for `B`', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = rarbcctantbsb1nsb2n; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying an offset parameter for `B`', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = rarbrcntantbob; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying the strides of the first and second dimensions of `C`', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = racbrcntatbsc1sc2; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports a negative stride for the first dimension of `C`', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = racbrcntatbsc1nsc2; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports a negative stride for the second dimension of `C`', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = racbrcntatbsc1sc2n; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports negative strides for `C`', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = racbrcntatbsc1nsc2n; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying an offset parameter for `C`', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = rarbrcntantboc; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports complex access patterns', opts, function test( t ) { + var expected; + var data; + var out; + var a; + var b; + var c; + + data = cap; + + a = new Float64Array( data.A ); + b = new Float64Array( data.B ); + c = new Float64Array( data.C ); + + expected = new Float64Array( data.C_out ); + + out = dgemm( data.transA, data.transB, data.M, data.N, data.K, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, b, data.strideB1, data.strideB2, data.offsetB, data.beta, c, data.strideC1, data.strideC2, data.offsetC ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports computation over large arrays (row-major, row-major, row-major)', opts, function test( t ) { + var expected; + var out; + var N; + var a; + var b; + var c; + + N = 100; + + a = ones( N*N, 'float64' ); + b = ones( a.length, 'float64' ); + c = new Float64Array( a.length ); + + expected = filled( N, a.length, 'float64' ); + + out = dgemm( 'no-transpose', 'no-transpose', N, N, N, 1.0, a, N, 1, 0, b, N, 1, 0, 1.0, c, N, 1, 0 ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports computation over large arrays (column-major, column-major, column-major)', opts, function test( t ) { + var expected; + var out; + var N; + var a; + var b; + var c; + + N = 100; + + a = ones( N*N, 'float64' ); + b = ones( a.length, 'float64' ); + c = new Float64Array( a.length ); + + expected = filled( N, a.length, 'float64' ); + + out = dgemm( 'no-transpose', 'no-transpose', N, N, N, 1.0, a, 1, N, 0, b, 1, N, 0, 1.0, c, 1, N, 0 ); + t.strictEqual( out, c, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + t.end(); +}); From 971488297a04c0938ea1f2f625d143bb63075d32 Mon Sep 17 00:00:00 2001 From: DhruvArvindSingh Date: Wed, 8 Apr 2026 19:22:35 +0530 Subject: [PATCH 2/6] chore: Updated copyright years --- lib/node_modules/@stdlib/blas/base/dgemm/README.md | 2 +- .../benchmark/benchmark_ca_cb_cc_nta_ntb.ndarray.native.js | 2 +- .../dgemm/benchmark/benchmark_ca_cb_cc_nta_tb.ndarray.native.js | 2 +- .../dgemm/benchmark/benchmark_ca_cb_cc_ta_ntb.ndarray.native.js | 2 +- .../dgemm/benchmark/benchmark_ca_cb_cc_ta_tb.ndarray.native.js | 2 +- .../benchmark/benchmark_ca_cb_rc_nta_ntb.ndarray.native.js | 2 +- .../dgemm/benchmark/benchmark_ca_cb_rc_nta_tb.ndarray.native.js | 2 +- .../dgemm/benchmark/benchmark_ca_cb_rc_ta_ntb.ndarray.native.js | 2 +- .../dgemm/benchmark/benchmark_ca_cb_rc_ta_tb.ndarray.native.js | 2 +- .../benchmark/benchmark_ca_rb_cc_nta_ntb.ndarray.native.js | 2 +- .../dgemm/benchmark/benchmark_ca_rb_cc_nta_tb.ndarray.native.js | 2 +- .../dgemm/benchmark/benchmark_ca_rb_cc_ta_ntb.ndarray.native.js | 2 +- .../dgemm/benchmark/benchmark_ca_rb_cc_ta_tb.ndarray.native.js | 2 +- .../benchmark/benchmark_ca_rb_rc_nta_ntb.ndarray.native.js | 2 +- .../dgemm/benchmark/benchmark_ca_rb_rc_nta_tb.ndarray.native.js | 2 +- .../dgemm/benchmark/benchmark_ca_rb_rc_ta_ntb.ndarray.native.js | 2 +- .../dgemm/benchmark/benchmark_ca_rb_rc_ta_tb.ndarray.native.js | 2 +- .../dgemm/benchmark/benchmark_column_major_nta_ntb.native.js | 2 +- .../dgemm/benchmark/benchmark_column_major_nta_tb.native.js | 2 +- .../dgemm/benchmark/benchmark_column_major_ta_ntb.native.js | 2 +- .../base/dgemm/benchmark/benchmark_column_major_ta_tb.native.js | 2 +- .../benchmark/benchmark_ra_cb_cc_nta_ntb.ndarray.native.js | 2 +- .../dgemm/benchmark/benchmark_ra_cb_cc_nta_tb.ndarray.native.js | 2 +- .../dgemm/benchmark/benchmark_ra_cb_cc_ta_ntb.ndarray.native.js | 2 +- .../dgemm/benchmark/benchmark_ra_cb_cc_ta_tb.ndarray.native.js | 2 +- .../benchmark/benchmark_ra_cb_rc_nta_ntb.ndarray.native.js | 2 +- .../dgemm/benchmark/benchmark_ra_cb_rc_nta_tb.ndarray.native.js | 2 +- .../dgemm/benchmark/benchmark_ra_cb_rc_ta_ntb.ndarray.native.js | 2 +- .../dgemm/benchmark/benchmark_ra_cb_rc_ta_tb.ndarray.native.js | 2 +- .../benchmark/benchmark_ra_rb_cc_nta_ntb.ndarray.native.js | 2 +- .../dgemm/benchmark/benchmark_ra_rb_cc_nta_tb.ndarray.native.js | 2 +- .../dgemm/benchmark/benchmark_ra_rb_cc_ta_ntb.ndarray.native.js | 2 +- .../dgemm/benchmark/benchmark_ra_rb_cc_ta_tb.ndarray.native.js | 2 +- .../benchmark/benchmark_ra_rb_rc_nta_ntb.ndarray.native.js | 2 +- .../dgemm/benchmark/benchmark_ra_rb_rc_nta_tb.ndarray.native.js | 2 +- .../dgemm/benchmark/benchmark_ra_rb_rc_ta_ntb.ndarray.native.js | 2 +- .../dgemm/benchmark/benchmark_ra_rb_rc_ta_tb.ndarray.native.js | 2 +- .../base/dgemm/benchmark/benchmark_row_major_nta_ntb.native.js | 2 +- .../base/dgemm/benchmark/benchmark_row_major_nta_tb.native.js | 2 +- .../base/dgemm/benchmark/benchmark_row_major_ta_ntb.native.js | 2 +- .../base/dgemm/benchmark/benchmark_row_major_ta_tb.native.js | 2 +- lib/node_modules/@stdlib/blas/base/dgemm/benchmark/c/Makefile | 2 +- .../@stdlib/blas/base/dgemm/benchmark/c/benchmark.length.c | 2 +- .../@stdlib/blas/base/dgemm/benchmark/fortran/Makefile | 2 +- .../blas/base/dgemm/benchmark/fortran/benchmark.length.f | 2 +- lib/node_modules/@stdlib/blas/base/dgemm/binding.gyp | 2 +- lib/node_modules/@stdlib/blas/base/dgemm/examples/c/Makefile | 2 +- lib/node_modules/@stdlib/blas/base/dgemm/examples/c/example.c | 2 +- lib/node_modules/@stdlib/blas/base/dgemm/include.gypi | 2 +- .../blas/base/dgemm/include/stdlib/blas/base/dgemm_cblas.h | 2 +- .../blas/base/dgemm/include/stdlib/blas/base/dgemm_fortran.h | 2 +- lib/node_modules/@stdlib/blas/base/dgemm/lib/dgemm.native.js | 2 +- lib/node_modules/@stdlib/blas/base/dgemm/lib/native.js | 2 +- lib/node_modules/@stdlib/blas/base/dgemm/lib/ndarray.native.js | 2 +- lib/node_modules/@stdlib/blas/base/dgemm/src/Makefile | 2 +- lib/node_modules/@stdlib/blas/base/dgemm/src/addon.c | 2 +- lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm.c | 2 +- lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm.f | 2 +- lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm_cblas.c | 2 +- lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm_f.c | 2 +- lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm_ndarray.c | 2 +- .../@stdlib/blas/base/dgemm/test/test.dgemm.native.js | 2 +- .../@stdlib/blas/base/dgemm/test/test.ndarray.native.js | 2 +- 63 files changed, 63 insertions(+), 63 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/README.md b/lib/node_modules/@stdlib/blas/base/dgemm/README.md index 40a2a189d108..c3f5d62eb58c 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/README.md +++ b/lib/node_modules/@stdlib/blas/base/dgemm/README.md @@ -2,7 +2,7 @@ @license Apache-2.0 -Copyright (c) 2024 The Stdlib Authors. +Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_nta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_nta_ntb.ndarray.native.js index d686324717fe..76cc3869c595 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_nta_ntb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_nta_ntb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_nta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_nta_tb.ndarray.native.js index 9a3110d30015..0eee113b8ebf 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_nta_tb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_nta_tb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_ta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_ta_ntb.ndarray.native.js index 57c9a0e4940c..69a5bc634913 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_ta_ntb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_ta_ntb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_ta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_ta_tb.ndarray.native.js index 19d10c8d825d..e0777cb6fb73 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_ta_tb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_cc_ta_tb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_nta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_nta_ntb.ndarray.native.js index 202284030852..548b7c0d631b 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_nta_ntb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_nta_ntb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_nta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_nta_tb.ndarray.native.js index 51d42aa60ad5..07b81cbe2d61 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_nta_tb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_nta_tb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_ta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_ta_ntb.ndarray.native.js index 901bccd61428..abd836a75c2a 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_ta_ntb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_ta_ntb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_ta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_ta_tb.ndarray.native.js index 958c8bc99649..567a7c4f224e 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_ta_tb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_cb_rc_ta_tb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_nta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_nta_ntb.ndarray.native.js index c828ceb822e4..24cd48c90e16 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_nta_ntb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_nta_ntb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_nta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_nta_tb.ndarray.native.js index ce8ffc2c17b8..699506839f1c 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_nta_tb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_nta_tb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_ta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_ta_ntb.ndarray.native.js index 380875aedb6e..b935b7ac64f6 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_ta_ntb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_ta_ntb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_ta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_ta_tb.ndarray.native.js index bd46ee277d9a..dad1016bb6a7 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_ta_tb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_cc_ta_tb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_nta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_nta_ntb.ndarray.native.js index c81205da27b2..544c846fa0df 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_nta_ntb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_nta_ntb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_nta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_nta_tb.ndarray.native.js index c90d6e3d02a2..ca346a94530e 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_nta_tb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_nta_tb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_ta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_ta_ntb.ndarray.native.js index 22e7793acef9..4853d412ca64 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_ta_ntb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_ta_ntb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_ta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_ta_tb.ndarray.native.js index 232696a256f4..51cc412d1ab4 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_ta_tb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ca_rb_rc_ta_tb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_nta_ntb.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_nta_ntb.native.js index 3a740487aff4..06a072b05bd0 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_nta_ntb.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_nta_ntb.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_nta_tb.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_nta_tb.native.js index 3faaff190ecf..450976cd5587 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_nta_tb.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_nta_tb.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_ta_ntb.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_ta_ntb.native.js index ca62b8ac60b0..67c53cca1674 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_ta_ntb.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_ta_ntb.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_ta_tb.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_ta_tb.native.js index 0c6f98f26c64..b68ac65b5947 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_ta_tb.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_column_major_ta_tb.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_nta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_nta_ntb.ndarray.native.js index ed7bf39ebfdc..0fe637304cca 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_nta_ntb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_nta_ntb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_nta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_nta_tb.ndarray.native.js index d84f17f7c6c6..6f8852fad924 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_nta_tb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_nta_tb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_ta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_ta_ntb.ndarray.native.js index 60dafb61ad42..1317ec58d647 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_ta_ntb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_ta_ntb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_ta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_ta_tb.ndarray.native.js index 331545908197..0ebc1ab30ed2 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_ta_tb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_cc_ta_tb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_nta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_nta_ntb.ndarray.native.js index 2d89a6b65e44..91197d2f6915 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_nta_ntb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_nta_ntb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_nta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_nta_tb.ndarray.native.js index 4fea0108bef3..becda939b3e6 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_nta_tb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_nta_tb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_ta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_ta_ntb.ndarray.native.js index 87a9b3a428d2..733f29338034 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_ta_ntb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_ta_ntb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_ta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_ta_tb.ndarray.native.js index 7ac2118773c3..3fef53a74c19 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_ta_tb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_cb_rc_ta_tb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_nta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_nta_ntb.ndarray.native.js index 96de8fdc143a..6a7ef24f8123 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_nta_ntb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_nta_ntb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_nta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_nta_tb.ndarray.native.js index 60b4c7dd7be7..a87458bd51c0 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_nta_tb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_nta_tb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_ta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_ta_ntb.ndarray.native.js index a13ad99e3b90..ba99fff9084b 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_ta_ntb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_ta_ntb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_ta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_ta_tb.ndarray.native.js index cd9656f1fa9e..c06b0f843acb 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_ta_tb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_cc_ta_tb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_nta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_nta_ntb.ndarray.native.js index ca81a7d38cc5..105fea33e2f9 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_nta_ntb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_nta_ntb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_nta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_nta_tb.ndarray.native.js index 0848ee30df88..629249c03e7f 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_nta_tb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_nta_tb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_ta_ntb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_ta_ntb.ndarray.native.js index 83ecff3dbc5d..dd85fa72158b 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_ta_ntb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_ta_ntb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_ta_tb.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_ta_tb.ndarray.native.js index c0b8873a100a..c65989099807 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_ta_tb.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_ra_rb_rc_ta_tb.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_nta_ntb.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_nta_ntb.native.js index 9d48589b450c..a76531379bbe 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_nta_ntb.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_nta_ntb.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_nta_tb.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_nta_tb.native.js index fe6253d8a18e..360fd5aee84d 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_nta_tb.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_nta_tb.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_ta_ntb.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_ta_ntb.native.js index a5a2165226c7..e2f059d53987 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_ta_ntb.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_ta_ntb.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_ta_tb.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_ta_tb.native.js index 2d6102a14a38..cfe6e1031d04 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_ta_tb.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/benchmark_row_major_ta_tb.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/c/Makefile b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/c/Makefile index 9f97140e7cb0..0756dc7da20a 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/c/Makefile +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/c/Makefile @@ -1,7 +1,7 @@ #/ # @license Apache-2.0 # -# Copyright (c) 2024 The Stdlib Authors. +# Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/c/benchmark.length.c index 42af1fc0b577..73184931b9dd 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/c/benchmark.length.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/fortran/Makefile b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/fortran/Makefile index aa5cade65e05..092d0884fbf7 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/fortran/Makefile +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/fortran/Makefile @@ -1,7 +1,7 @@ #/ # @license Apache-2.0 # -# Copyright (c) 2024 The Stdlib Authors. +# Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/fortran/benchmark.length.f b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/fortran/benchmark.length.f index 4c721a74e804..974123696c2a 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/fortran/benchmark.length.f +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/fortran/benchmark.length.f @@ -1,7 +1,7 @@ !> ! @license Apache-2.0 ! -! Copyright (c) 2024 The Stdlib Authors. +! Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/binding.gyp b/lib/node_modules/@stdlib/blas/base/dgemm/binding.gyp index 02a2799da097..60dce9d0b31a 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/binding.gyp +++ b/lib/node_modules/@stdlib/blas/base/dgemm/binding.gyp @@ -1,6 +1,6 @@ # @license Apache-2.0 # -# Copyright (c) 2024 The Stdlib Authors. +# Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/examples/c/Makefile b/lib/node_modules/@stdlib/blas/base/dgemm/examples/c/Makefile index 6aed70daf167..c8f8e9a1517b 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/examples/c/Makefile +++ b/lib/node_modules/@stdlib/blas/base/dgemm/examples/c/Makefile @@ -1,7 +1,7 @@ #/ # @license Apache-2.0 # -# Copyright (c) 2024 The Stdlib Authors. +# Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/examples/c/example.c b/lib/node_modules/@stdlib/blas/base/dgemm/examples/c/example.c index da8516abcbed..9067b950779a 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/examples/c/example.c +++ b/lib/node_modules/@stdlib/blas/base/dgemm/examples/c/example.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/include.gypi b/lib/node_modules/@stdlib/blas/base/dgemm/include.gypi index 497aeca15320..dcb556d250e8 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/include.gypi +++ b/lib/node_modules/@stdlib/blas/base/dgemm/include.gypi @@ -1,6 +1,6 @@ # @license Apache-2.0 # -# Copyright (c) 2024 The Stdlib Authors. +# Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/include/stdlib/blas/base/dgemm_cblas.h b/lib/node_modules/@stdlib/blas/base/dgemm/include/stdlib/blas/base/dgemm_cblas.h index 8ebbda9884e1..0d21782561f3 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/include/stdlib/blas/base/dgemm_cblas.h +++ b/lib/node_modules/@stdlib/blas/base/dgemm/include/stdlib/blas/base/dgemm_cblas.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/include/stdlib/blas/base/dgemm_fortran.h b/lib/node_modules/@stdlib/blas/base/dgemm/include/stdlib/blas/base/dgemm_fortran.h index 60da6a5ccc89..e3a2a3ef82ab 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/include/stdlib/blas/base/dgemm_fortran.h +++ b/lib/node_modules/@stdlib/blas/base/dgemm/include/stdlib/blas/base/dgemm_fortran.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/lib/dgemm.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/lib/dgemm.native.js index 0ff15ebbbaca..a807b64c6243 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/lib/dgemm.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/lib/dgemm.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/lib/native.js b/lib/node_modules/@stdlib/blas/base/dgemm/lib/native.js index 533eee2b31eb..19e46d42238e 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/lib/native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/lib/native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/lib/ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/lib/ndarray.native.js index bda4204b5ac7..ce8b6a6907ae 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/lib/ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/lib/ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/src/Makefile b/lib/node_modules/@stdlib/blas/base/dgemm/src/Makefile index bcf18aa46655..2caf905cedbe 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/src/Makefile +++ b/lib/node_modules/@stdlib/blas/base/dgemm/src/Makefile @@ -1,7 +1,7 @@ #/ # @license Apache-2.0 # -# Copyright (c) 2024 The Stdlib Authors. +# Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/src/addon.c b/lib/node_modules/@stdlib/blas/base/dgemm/src/addon.c index d0d321a8c1a0..aca42632a8c8 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/src/addon.c +++ b/lib/node_modules/@stdlib/blas/base/dgemm/src/addon.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm.c b/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm.c index a1723df97d96..8126b1ca4498 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm.c +++ b/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm.f b/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm.f index f64939a7c750..062e56ef1551 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm.f +++ b/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm.f @@ -1,7 +1,7 @@ !> ! @license Apache-2.0 ! -! Copyright (c) 2024 The Stdlib Authors. +! Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm_cblas.c b/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm_cblas.c index 08a990f0902b..e707a32ecb2e 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm_cblas.c +++ b/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm_cblas.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm_f.c b/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm_f.c index 191f1cc8d6ee..14fc2fe3dc6b 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm_f.c +++ b/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm_f.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm_ndarray.c b/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm_ndarray.c index c1896cdb4460..8b7cdebcc7bc 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm_ndarray.c +++ b/lib/node_modules/@stdlib/blas/base/dgemm/src/dgemm_ndarray.c @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/test/test.dgemm.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/test/test.dgemm.native.js index c7e046092294..4d37264eef20 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/test/test.dgemm.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/test/test.dgemm.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/test/test.ndarray.native.js b/lib/node_modules/@stdlib/blas/base/dgemm/test/test.ndarray.native.js index 3d6033cc866b..dcf04c8b4a53 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/test/test.ndarray.native.js +++ b/lib/node_modules/@stdlib/blas/base/dgemm/test/test.ndarray.native.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. From a27cf6df8118d71f3e8aac7d29676a3ed46a5b95 Mon Sep 17 00:00:00 2001 From: DhruvArvindSingh Date: Wed, 8 Apr 2026 19:36:28 +0530 Subject: [PATCH 3/6] chore: fortran benchmark --- .../base/dgemm/benchmark/c/benchmark.length.c | 38 ++++++++++++++++--- .../base/dgemm/benchmark/fortran/Makefile | 2 +- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/c/benchmark.length.c b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/c/benchmark.length.c index 73184931b9dd..7b7602ea7132 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/c/benchmark.length.c +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/c/benchmark.length.c @@ -97,13 +97,23 @@ static double rand_double( void ) { */ static double benchmark1( int iterations, int N ) { double elapsed; - double A[ N*N ]; - double B[ N*N ]; - double C[ N*N ]; + double *A; + double *B; + double *C; double t; int i; int j; + A = (double *)malloc( N*N * sizeof(double) ); + B = (double *)malloc( N*N * sizeof(double) ); + C = (double *)malloc( N*N * sizeof(double) ); + if ( A == NULL || B == NULL || C == NULL ) { + printf( "# Error: failed to allocate memory\n" ); + free( A ); + free( B ); + free( C ); + return 0.0; + } for ( i = 0; i < N; i++ ) { for ( j = 0; j < N; j++ ) { A[ (i*N)+j ] = ( rand_double()*20.0 ) - 10.0; @@ -124,6 +134,9 @@ static double benchmark1( int iterations, int N ) { if ( C[ i%(N*2) ] != C[ i%(N*2) ] ) { printf( "should not return NaN\n" ); } + free( A ); + free( B ); + free( C ); return elapsed; } @@ -136,13 +149,23 @@ static double benchmark1( int iterations, int N ) { */ static double benchmark2( int iterations, int N ) { double elapsed; - double A[ N*N ]; - double B[ N*N ]; - double C[ N*N ]; + double *A; + double *B; + double *C; double t; int i; int j; + A = (double *)malloc( N*N * sizeof(double) ); + B = (double *)malloc( N*N * sizeof(double) ); + C = (double *)malloc( N*N * sizeof(double) ); + if ( A == NULL || B == NULL || C == NULL ) { + printf( "# Error: failed to allocate memory\n" ); + free( A ); + free( B ); + free( C ); + return 0.0; + } for ( i = 0; i < N; i++ ) { for ( j = 0; j < N; j++ ) { A[ (i*N)+j ] = ( rand_double()*20.0 ) - 10.0; @@ -163,6 +186,9 @@ static double benchmark2( int iterations, int N ) { if ( C[ i%(N*2) ] != C[ i%(N*2) ] ) { printf( "should not return NaN\n" ); } + free( A ); + free( B ); + free( C ); return elapsed; } diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/fortran/Makefile b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/fortran/Makefile index 092d0884fbf7..c004ec67dc9c 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/fortran/Makefile +++ b/lib/node_modules/@stdlib/blas/base/dgemm/benchmark/fortran/Makefile @@ -78,7 +78,7 @@ endif INCLUDE ?= # List of Fortran source files: -SOURCE_FILES ?= ../../src/dgemm.f +SOURCE_FILES ?= ../../src/dgemm.f ../../../xerbla/src/xerbla.f # List of Fortran targets: f_targets := benchmark.length.out From cfe98ab42eef580e68bfa3e2eed63fcb1197ff20 Mon Sep 17 00:00:00 2001 From: DhruvArvindSingh Date: Wed, 8 Apr 2026 19:49:43 +0530 Subject: [PATCH 4/6] chore: updated copyright years --- .../@stdlib/blas/base/dgemm/include/stdlib/blas/base/dgemm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/include/stdlib/blas/base/dgemm.h b/lib/node_modules/@stdlib/blas/base/dgemm/include/stdlib/blas/base/dgemm.h index 77498da6149c..b6fe10c971df 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/include/stdlib/blas/base/dgemm.h +++ b/lib/node_modules/@stdlib/blas/base/dgemm/include/stdlib/blas/base/dgemm.h @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2024 The Stdlib Authors. +* Copyright (c) 2026 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. From 8ac3ea619509bb4b3b78124b68b5358f7019e4fb Mon Sep 17 00:00:00 2001 From: DhruvArvindSingh Date: Wed, 8 Apr 2026 20:06:51 +0530 Subject: [PATCH 5/6] chore: package.json --- lib/node_modules/@stdlib/blas/base/dgemm/package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/package.json b/lib/node_modules/@stdlib/blas/base/dgemm/package.json index af13a574a7be..3529e520038e 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/package.json +++ b/lib/node_modules/@stdlib/blas/base/dgemm/package.json @@ -18,7 +18,9 @@ "benchmark": "./benchmark", "doc": "./docs", "example": "./examples", + "include": "./include", "lib": "./lib", + "src": "./src", "test": "./test" }, "types": "./docs/types", From 304acac2e23d356eba06bfc615d029e4c20c63f9 Mon Sep 17 00:00:00 2001 From: DhruvArvindSingh Date: Wed, 8 Apr 2026 20:19:43 +0530 Subject: [PATCH 6/6] chore: package.json --- lib/node_modules/@stdlib/blas/base/dgemm/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/node_modules/@stdlib/blas/base/dgemm/package.json b/lib/node_modules/@stdlib/blas/base/dgemm/package.json index 3529e520038e..8deecae50c78 100644 --- a/lib/node_modules/@stdlib/blas/base/dgemm/package.json +++ b/lib/node_modules/@stdlib/blas/base/dgemm/package.json @@ -14,6 +14,7 @@ } ], "main": "./lib", + "gypfile": true, "directories": { "benchmark": "./benchmark", "doc": "./docs",