Skip to content

Commit 0a29a80

Browse files
committed
Auto-generated commit
1 parent 549203b commit 0a29a80

File tree

38 files changed

+850
-372
lines changed

38 files changed

+850
-372
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010

1111
### Features
1212

13+
- [`1e5789c`](https://github.com/stdlib-js/stdlib/commit/1e5789c70b7400b0ff1cd71d06798c1e5b26f16b) - add `blockSize` to namespace
14+
- [`a6117b1`](https://github.com/stdlib-js/stdlib/commit/a6117b1bd697083439d740567d41cbfa754f68ab) - add `quinaryBlockSize` to namespace
15+
- [`c6dca39`](https://github.com/stdlib-js/stdlib/commit/c6dca39c634f8c016dc6fa4d0330a47bba977eaf) - add `quaternaryBlockSize` to namespace
16+
- [`2d51ff6`](https://github.com/stdlib-js/stdlib/commit/2d51ff6a1af79d361401ff928fb755bfaa1170f7) - add `ndarray/base/tiling-block-size`
1317
- [`9c75b30`](https://github.com/stdlib-js/stdlib/commit/9c75b302a82df9b6c580b9f8afc647773e5684a3) - add `ndarray/base/quinary-tiling-block-size` [(#9871)](https://github.com/stdlib-js/stdlib/pull/9871)
1418
- [`d84de96`](https://github.com/stdlib-js/stdlib/commit/d84de9698683c20fa3b67eb9d2a615a403f6b707) - add `ndarray/base/quaternary-tiling-block-size` [(#9838)](https://github.com/stdlib-js/stdlib/pull/9838)
1519
- [`8f8998f`](https://github.com/stdlib-js/stdlib/commit/8f8998f02831c2db69698a26769916d68acfe54f) - update `ndarray/base` TypeScript declarations [(#9913)](https://github.com/stdlib-js/stdlib/pull/9913)
@@ -723,6 +727,18 @@ A total of 43 issues were closed in this release:
723727

724728
<details>
725729

730+
- [`46c8d0e`](https://github.com/stdlib-js/stdlib/commit/46c8d0eb953a8bd39e4486a93d65aca6c45af934) - **docs:** fix examples _(by Athan Reines)_
731+
- [`9d7f220`](https://github.com/stdlib-js/stdlib/commit/9d7f220eca1b55eb1c59b1f31efd91f66a450af2) - **refactor:** use generalized utility _(by Athan Reines)_
732+
- [`7f54590`](https://github.com/stdlib-js/stdlib/commit/7f54590d0556e5c8b13d8bc2c527dbfc90e55201) - **refactor:** use generalized utility _(by Athan Reines)_
733+
- [`45ee3d6`](https://github.com/stdlib-js/stdlib/commit/45ee3d69be75dcd538d8fde2f2b23ac100995c4b) - **refactor:** use generalized utility _(by Athan Reines)_
734+
- [`51e9e67`](https://github.com/stdlib-js/stdlib/commit/51e9e67bf770b750204cb4f97b0420faa06191ce) - **refactor:** use generalized utility _(by Athan Reines)_
735+
- [`6ebb5c9`](https://github.com/stdlib-js/stdlib/commit/6ebb5c96300bde3f75f7cbae57fdecf8c5a08f93) - **refactor:** use generalized utility _(by Athan Reines)_
736+
- [`24cd22d`](https://github.com/stdlib-js/stdlib/commit/24cd22d47029be52bb7992bcdb839edb7711b68f) - **refactor:** call into generalized utility _(by Athan Reines)_
737+
- [`622fb73`](https://github.com/stdlib-js/stdlib/commit/622fb73db38259c72bcbf0d10afa063400914f24) - **test:** fix condition _(by Athan Reines)_
738+
- [`1e5789c`](https://github.com/stdlib-js/stdlib/commit/1e5789c70b7400b0ff1cd71d06798c1e5b26f16b) - **feat:** add `blockSize` to namespace _(by Athan Reines)_
739+
- [`a6117b1`](https://github.com/stdlib-js/stdlib/commit/a6117b1bd697083439d740567d41cbfa754f68ab) - **feat:** add `quinaryBlockSize` to namespace _(by Athan Reines)_
740+
- [`c6dca39`](https://github.com/stdlib-js/stdlib/commit/c6dca39c634f8c016dc6fa4d0330a47bba977eaf) - **feat:** add `quaternaryBlockSize` to namespace _(by Athan Reines)_
741+
- [`2d51ff6`](https://github.com/stdlib-js/stdlib/commit/2d51ff6a1af79d361401ff928fb755bfaa1170f7) - **feat:** add `ndarray/base/tiling-block-size` _(by Athan Reines)_
726742
- [`9c75b30`](https://github.com/stdlib-js/stdlib/commit/9c75b302a82df9b6c580b9f8afc647773e5684a3) - **feat:** add `ndarray/base/quinary-tiling-block-size` [(#9871)](https://github.com/stdlib-js/stdlib/pull/9871) _(by Muhammad Haris, Athan Reines)_
727743
- [`d84de96`](https://github.com/stdlib-js/stdlib/commit/d84de9698683c20fa3b67eb9d2a615a403f6b707) - **feat:** add `ndarray/base/quaternary-tiling-block-size` [(#9838)](https://github.com/stdlib-js/stdlib/pull/9838) _(by Muhammad Haris, Athan Reines)_
728744
- [`8f8998f`](https://github.com/stdlib-js/stdlib/commit/8f8998f02831c2db69698a26769916d68acfe54f) - **feat:** update `ndarray/base` TypeScript declarations [(#9913)](https://github.com/stdlib-js/stdlib/pull/9913) _(by stdlib-bot)_

base/binary-tiling-block-size/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ var bsize = binaryBlockSize( 'float64', 'float64', 'float64' );
7676
```javascript
7777
var dtypes = require( '@stdlib/ndarray/dtypes' );
7878
var cartesianSquare = require( '@stdlib/array/base/cartesian-square' );
79-
var promotionRules = require( '@stdlib/ndarray/promotion-rules' );
79+
var promoteDataTypes = require( '@stdlib/ndarray/base/promote-dtypes' );
8080
var binaryBlockSize = require( '@stdlib/ndarray/base/binary-tiling-block-size' );
8181

8282
// Generate a list of input ndarray dtype pairs:
@@ -88,8 +88,8 @@ var b;
8888
var i;
8989
console.log( 'block_size, xdtype, ydtype, zdtype' );
9090
for ( i = 0; i < dt.length; i++ ) {
91-
t = promotionRules.apply( null, dt[ i ] );
92-
dt[ i ].push( ( t === -1 ) ? 'generic' : t );
91+
t = promoteDataTypes( dt[ i ] );
92+
dt[ i ].push( ( t === null ) ? 'generic' : t );
9393
b = binaryBlockSize.apply( null, dt[ i ] );
9494
console.log( '%d, %s, %s, %s', b, dt[i][0], dt[i][1], dt[i][2] );
9595
}

base/binary-tiling-block-size/examples/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
var dtypes = require( './../../../dtypes' );
2222
var cartesianSquare = require( '@stdlib/array/base/cartesian-square' );
23-
var promotionRules = require( './../../../promotion-rules' );
23+
var promoteDataTypes = require( './../../../base/promote-dtypes' );
2424
var binaryBlockSize = require( './../lib' );
2525

2626
// Generate a list of input ndarray dtype pairs:
@@ -32,8 +32,8 @@ var b;
3232
var i;
3333
console.log( 'block_size, xdtype, ydtype, zdtype' );
3434
for ( i = 0; i < dt.length; i++ ) {
35-
t = promotionRules.apply( null, dt[ i ] );
36-
dt[ i ].push( ( t === -1 ) ? 'generic' : t );
35+
t = promoteDataTypes( dt[ i ] );
36+
dt[ i ].push( ( t === null ) ? 'generic' : t );
3737
b = binaryBlockSize.apply( null, dt[ i ] );
3838
console.log( '%d, %s, %s, %s', b, dt[i][0], dt[i][1], dt[i][2] );
3939
}

base/binary-tiling-block-size/lib/defaults.js

Lines changed: 0 additions & 34 deletions
This file was deleted.

base/binary-tiling-block-size/lib/main.js

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020

2121
// MODULES //
2222

23-
var bytesPerElement = require( './../../../base/bytes-per-element' );
24-
var defaults = require( './defaults.js' );
23+
var blockSize = require( './../../../base/tiling-block-size' );
2524

2625

2726
// MAIN //
@@ -39,23 +38,7 @@ var defaults = require( './defaults.js' );
3938
* // returns <number>
4039
*/
4140
function binaryBlockSize( dtypeX, dtypeY, dtypeZ ) {
42-
var nbx;
43-
var nby;
44-
var nbz;
45-
46-
nbx = bytesPerElement( dtypeX );
47-
nby = bytesPerElement( dtypeY );
48-
nbz = bytesPerElement( dtypeZ );
49-
if ( nbx === null || nby === null || nbz === null ) { // e.g., "generic" arrays
50-
return defaults.BLOCK_SIZE_IN_ELEMENTS;
51-
}
52-
if ( nbx > nby && nbx > nbz ) {
53-
return ( defaults.BLOCK_SIZE_IN_BYTES/nbx )|0; // asm type annotation
54-
}
55-
if ( nby > nbz ) {
56-
return ( defaults.BLOCK_SIZE_IN_BYTES/nby )|0; // asm type annotation
57-
}
58-
return ( defaults.BLOCK_SIZE_IN_BYTES/nbz )|0; // asm type annotation
41+
return blockSize( [ dtypeX, dtypeY, dtypeZ ] );
5942
}
6043

6144

base/binary-tiling-block-size/test/test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var tape = require( 'tape' );
2424
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
2525
var dtypes = require( './../../../dtypes' );
2626
var cartesianSquare = require( '@stdlib/array/base/cartesian-square' );
27-
var promotionRules = require( './../../../promotion-rules' );
27+
var promoteDataTypes = require( './../../../base/promote-dtypes' );
2828
var binaryBlockSize = require( './../lib' );
2929

3030

@@ -48,8 +48,8 @@ tape( 'the function returns a block size', function test( t ) {
4848
dt = cartesianSquare( dtypes() );
4949

5050
for ( i = 0; i < dt.length; i++ ) {
51-
pt = promotionRules.apply( null, dt[ i ] );
52-
dt[ i ].push( ( pt === -1 ) ? 'generic' : pt );
51+
pt = promoteDataTypes( dt[ i ] );
52+
dt[ i ].push( ( pt === null ) ? 'generic' : pt );
5353
v = binaryBlockSize( dt[ i ][ 0 ], dt[ i ][ 1 ], dt[ i ][ 2 ] );
5454
t.strictEqual( isPositiveInteger( v ), true, 'returns a positive integer when provided ('+dt[ i ].join( ', ' )+')' );
5555
}

base/lib/index.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,15 @@ setReadOnly( ns, 'promoteDataTypes', require( './../../base/promote-dtypes' ) );
10121012
*/
10131013
setReadOnly( ns, 'quaternaryLoopOrder', require( './../../base/quaternary-loop-interchange-order' ) );
10141014

1015+
/**
1016+
* @name quaternaryBlockSize
1017+
* @memberof ns
1018+
* @readonly
1019+
* @type {Function}
1020+
* @see {@link module:@stdlib/ndarray/base/quaternary-tiling-block-size}
1021+
*/
1022+
setReadOnly( ns, 'quaternaryBlockSize', require( './../../base/quaternary-tiling-block-size' ) );
1023+
10151024
/**
10161025
* @name quinaryLoopOrder
10171026
* @memberof ns
@@ -1021,6 +1030,15 @@ setReadOnly( ns, 'quaternaryLoopOrder', require( './../../base/quaternary-loop-i
10211030
*/
10221031
setReadOnly( ns, 'quinaryLoopOrder', require( './../../base/quinary-loop-interchange-order' ) );
10231032

1033+
/**
1034+
* @name quinaryBlockSize
1035+
* @memberof ns
1036+
* @readonly
1037+
* @type {Function}
1038+
* @see {@link module:@stdlib/ndarray/base/quinary-tiling-block-size}
1039+
*/
1040+
setReadOnly( ns, 'quinaryBlockSize', require( './../../base/quinary-tiling-block-size' ) );
1041+
10241042
/**
10251043
* @name removeSingletonDimensions
10261044
* @memberof ns
@@ -1264,6 +1282,15 @@ setReadOnly( ns, 'ternaryOutputDataType', require( './../../base/ternary-output-
12641282
*/
12651283
setReadOnly( ns, 'ternaryBlockSize', require( './../../base/ternary-tiling-block-size' ) );
12661284

1285+
/**
1286+
* @name blockSize
1287+
* @memberof ns
1288+
* @readonly
1289+
* @type {Function}
1290+
* @see {@link module:@stdlib/ndarray/base/tiling-block-size}
1291+
*/
1292+
setReadOnly( ns, 'blockSize', require( './../../base/tiling-block-size' ) );
1293+
12671294
/**
12681295
* @name ndarray2array
12691296
* @memberof ns

base/nullary-tiling-block-size/README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,15 @@ var bsize = nullaryBlockSize( 'float64' );
7575

7676
```javascript
7777
var dtypes = require( '@stdlib/ndarray/dtypes' );
78+
var logEachMap = require( '@stdlib/console/log-each-map' );
7879
var nullaryBlockSize = require( '@stdlib/ndarray/base/nullary-tiling-block-size' );
7980

8081
// Get the list of ndarray dtypes:
8182
var dt = dtypes();
8283

83-
// Resolve the block size for each dtype...
84-
var b;
85-
var i;
86-
console.log( 'block_size, xdtype' );
87-
for ( i = 0; i < dt.length; i++ ) {
88-
b = nullaryBlockSize( dt[ i ] );
89-
console.log( '%d, %s', b, dt[ i ] );
90-
}
84+
// Resolve the block size for each dtype:
85+
console.log( 'xdtype, block_size' );
86+
logEachMap( '%s, %d', dt, nullaryBlockSize );
9187
```
9288

9389
</section>

base/nullary-tiling-block-size/examples/index.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,12 @@
1919
'use strict';
2020

2121
var dtypes = require( './../../../dtypes' );
22+
var logEachMap = require( '@stdlib/console/log-each-map' );
2223
var nullaryBlockSize = require( './../lib' );
2324

2425
// Get the list of ndarray dtypes:
2526
var dt = dtypes();
2627

27-
// Resolve the block size for each dtype...
28-
var b;
29-
var i;
30-
console.log( 'block_size, xdtype' );
31-
for ( i = 0; i < dt.length; i++ ) {
32-
b = nullaryBlockSize( dt[ i ] );
33-
console.log( '%d, %s', b, dt[ i ] );
34-
}
28+
// Resolve the block size for each dtype:
29+
console.log( 'xdtype, block_size' );
30+
logEachMap( '%s, %d', dt, nullaryBlockSize );

base/nullary-tiling-block-size/lib/defaults.js

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)