Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"transA": "no-transpose",
"transB": "no-transpose",
"M": 2,
"N": 4,
"K": 3,
"alpha": 2.0,
"A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ],
"strideA1": 3,
"strideA2": 1,
"offsetA": 0,
"B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ],
"strideB1": 4,
"strideB2": 1,
"offsetB": 0,
"beta": 3.0,
"C": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ],
"strideC1": 4,
"strideC2": 1,
"offsetC": 0,
"C_out": [ 15.0, 18.0, 21.0, 24.0, 45.0, 48.0, 51.0, 54.0 ]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"order": "row-major",
"transA": "no-transpose",
"transB": "no-transpose",
"M": 2,
"N": 4,
"K": 3,
"alpha": 2.0,
"A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ],
"lda": 3,
"B": [ 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 ],
"ldb": 4,
"beta": 3.0,
"C": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 ],
"ldc": 4,
"C_out": [ 15.0, 18.0, 21.0, 24.0, 45.0, 48.0, 51.0, 54.0 ]
}
24 changes: 23 additions & 1 deletion lib/node_modules/@stdlib/blas/base/dgemm/test/test.dgemm.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ 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' );
var rntantbAlpha2Beta3 = require( './fixtures/row_major_nta_ntb_alpha2_beta3.json' );


// TESTS //
Expand Down Expand Up @@ -704,3 +704,25 @@ tape( 'if `α` is `0` and `β` is neither `0` nor `1`, the function returns the

t.end();
});

tape( 'the function correctly applies both `α` and `β` scalars (row-major, no-transpose, no-transpose, α=2, β=3)', function test( t ) {
var expected;
var data;
var out;
var a;
var b;
var c;

data = rntantbAlpha2Beta3;

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();
});
25 changes: 23 additions & 2 deletions lib/node_modules/@stdlib/blas/base/dgemm/test/test.ndarray.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
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' );
Expand All @@ -65,7 +64,6 @@
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' );
Expand All @@ -82,6 +80,7 @@
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' );
var rarbrcntantbAlpha2Beta3 = require( './fixtures/ra_rb_rc_nta_ntb_alpha2_beta3.json' );


// TESTS //
Expand Down Expand Up @@ -1306,7 +1305,7 @@

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 );

Check warning on line 1308 in lib/node_modules/@stdlib/blas/base/dgemm/test/test.ndarray.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

File has too many lines (1158). Maximum allowed is 1000
t.strictEqual( out, c, 'returns expected value' );
t.deepEqual( out, expected, 'returns expected value' );
t.end();
Expand Down Expand Up @@ -1487,3 +1486,25 @@
t.deepEqual( out, expected, 'returns expected value' );
t.end();
});

tape( 'the function correctly applies both `α` and `β` scalars (row_major, row_major, row_major, no-transpose, no-transpose, α=2, β=3)', function test( t ) {
var expected;
var data;
var out;
var a;
var b;
var c;

data = rarbrcntantbAlpha2Beta3;

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();
});
Loading