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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ]
}
23 changes: 23 additions & 0 deletions lib/node_modules/@stdlib/blas/base/dgemm/test/test.dgemm.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ 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 +705,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();
});
23 changes: 23 additions & 0 deletions lib/node_modules/@stdlib/blas/base/dgemm/test/test.ndarray.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ 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' );
var rarbrcntantbAlpha2Beta3 = require( './fixtures/ra_rb_rc_nta_ntb_alpha2_beta3.json' );


// TESTS //
Expand Down Expand Up @@ -1487,3 +1488,25 @@ tape( 'the function supports computation over large arrays (column-major, column
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