Skip to content

Commit 549203b

Browse files
committed
Auto-generated commit
1 parent db54547 commit 549203b

File tree

12 files changed

+731
-0
lines changed

12 files changed

+731
-0
lines changed

CHANGELOG.md

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

1111
### Features
1212

13+
- [`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)
1314
- [`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)
1415
- [`8f8998f`](https://github.com/stdlib-js/stdlib/commit/8f8998f02831c2db69698a26769916d68acfe54f) - update `ndarray/base` TypeScript declarations [(#9913)](https://github.com/stdlib-js/stdlib/pull/9913)
1516
- [`b6d8bcc`](https://github.com/stdlib-js/stdlib/commit/b6d8bcc8e3a285d4f874748191904580321aa0e8) - add `quinaryLoopOrder` to namespace
@@ -722,6 +723,7 @@ A total of 43 issues were closed in this release:
722723

723724
<details>
724725

726+
- [`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)_
725727
- [`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)_
726728
- [`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)_
727729
- [`196734e`](https://github.com/stdlib-js/stdlib/commit/196734eccb0d43439332b2a275fb3a50cb73df67) - **docs:** update namespace table of contents [(#9915)](https://github.com/stdlib-js/stdlib/pull/9915) _(by stdlib-bot)_
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
<!--
2+
3+
@license Apache-2.0
4+
5+
Copyright (c) 2026 The Stdlib Authors.
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
19+
-->
20+
21+
# quinaryBlockSize
22+
23+
> Resolve a loop block size for multi-dimensional array tiled loops.
24+
25+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
26+
27+
<section class="intro">
28+
29+
</section>
30+
31+
<!-- /.intro -->
32+
33+
<!-- Package usage documentation. -->
34+
35+
<section class="usage">
36+
37+
## Usage
38+
39+
```javascript
40+
var quinaryBlockSize = require( '@stdlib/ndarray/base/quinary-tiling-block-size' );
41+
```
42+
43+
#### quinaryBlockSize( dtypeX, dtypeY, dtypeZ, dtypeW, dtypeU, dtypeV )
44+
45+
Resolves a loop block size according to provided ndarray [dtypes][@stdlib/ndarray/dtypes] for multi-dimensional array tiled loops applying a quinary function.
46+
47+
```javascript
48+
var bsize = quinaryBlockSize( 'float64', 'float64', 'float64', 'float64', 'float64', 'float64' );
49+
// returns <number>
50+
```
51+
52+
The function supports the following arguments:
53+
54+
- **dtypeX**: first input array data type.
55+
- **dtypeY**: second input array data type.
56+
- **dtypeZ**: third input array data type.
57+
- **dtypeW**: fourth input array data type.
58+
- **dtypeU**: fifth input array data type.
59+
- **dtypeV**: output array data type.
60+
61+
</section>
62+
63+
<!-- /.usage -->
64+
65+
<!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
66+
67+
<section class="notes">
68+
69+
## Notes
70+
71+
- The returned loop tiling block size is in units of elements.
72+
73+
</section>
74+
75+
<!-- /.notes -->
76+
77+
<!-- Package usage examples. -->
78+
79+
<section class="examples">
80+
81+
## Examples
82+
83+
<!-- eslint no-undef: "error" -->
84+
85+
```javascript
86+
var dtypes = require( '@stdlib/ndarray/dtypes' );
87+
var cartesianPower = require( '@stdlib/array/base/cartesian-power' );
88+
var promotionRules = require( '@stdlib/ndarray/promotion-rules' );
89+
var quinaryBlockSize = require( '@stdlib/ndarray/base/quinary-tiling-block-size' );
90+
91+
// Generate a list of input ndarray dtype quintuplets:
92+
var dt = cartesianPower( dtypes(), 5 );
93+
94+
// Resolve the block size for each dtype quintuplet and its promoted dtype...
95+
var t;
96+
var b;
97+
var i;
98+
console.log( 'block_size, xdtype, ydtype, zdtype, wdtype, udtype, vdtype' );
99+
for ( i = 0; i < dt.length; i++ ) {
100+
t = promotionRules.apply( null, dt[ i ] );
101+
dt[ i ].push( ( t === -1 ) ? 'generic' : t );
102+
b = quinaryBlockSize.apply( null, dt[ i ] );
103+
console.log( '%d, %s, %s, %s, %s, %s, %s', b, dt[i][0], dt[i][1], dt[i][2], dt[i][3], dt[i][4], dt[i][5] );
104+
}
105+
```
106+
107+
</section>
108+
109+
<!-- /.examples -->
110+
111+
<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
112+
113+
<section class="references">
114+
115+
</section>
116+
117+
<!-- /.references -->
118+
119+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
120+
121+
<section class="related">
122+
123+
</section>
124+
125+
<!-- /.related -->
126+
127+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
128+
129+
<section class="links">
130+
131+
[@stdlib/ndarray/dtypes]: https://github.com/stdlib-js/ndarray/tree/main/dtypes
132+
133+
</section>
134+
135+
<!-- /.links -->
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2026 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var bench = require( '@stdlib/bench' );
24+
var isPositiveInteger = require( '@stdlib/assert/is-positive-integer' ).isPrimitive;
25+
var pkg = require( './../package.json' ).name;
26+
var blockSize = require( './../lib' );
27+
28+
29+
// MAIN //
30+
31+
bench( pkg, function benchmark( b ) {
32+
var dx;
33+
var dy;
34+
var dz;
35+
var dw;
36+
var du;
37+
var dv;
38+
var s;
39+
var i;
40+
41+
dx = [
42+
'float64',
43+
'float32',
44+
'int8',
45+
'uint8',
46+
'uint8c',
47+
'int16',
48+
'uint16',
49+
'int32',
50+
'uint32',
51+
'binary',
52+
'generic',
53+
'foobar'
54+
];
55+
dy = [
56+
'float64',
57+
'float32',
58+
'int8',
59+
'uint8',
60+
'uint8c',
61+
'int16',
62+
'uint16',
63+
'int32',
64+
'uint32',
65+
'binary',
66+
'generic',
67+
'foobar'
68+
];
69+
dz = [
70+
'float64',
71+
'float32',
72+
'int8',
73+
'uint8',
74+
'uint8c',
75+
'int16',
76+
'uint16',
77+
'int32',
78+
'uint32',
79+
'binary',
80+
'generic',
81+
'foobar'
82+
];
83+
dw = [
84+
'float64',
85+
'float32',
86+
'int8',
87+
'uint8',
88+
'uint8c',
89+
'int16',
90+
'uint16',
91+
'int32',
92+
'uint32',
93+
'binary',
94+
'generic',
95+
'foobar'
96+
];
97+
du = [
98+
'float64',
99+
'float32',
100+
'int8',
101+
'uint8',
102+
'uint8c',
103+
'int16',
104+
'uint16',
105+
'int32',
106+
'uint32',
107+
'binary',
108+
'generic',
109+
'foobar'
110+
];
111+
dv = [
112+
'float64',
113+
'generic',
114+
'int32',
115+
'int16',
116+
'int8'
117+
];
118+
119+
b.tic();
120+
for ( i = 0; i < b.iterations; i++ ) {
121+
s = blockSize( dx[ i%dx.length ], dy[ i%dy.length ], dz[ i%dz.length ], dw[ i%dw.length ], du[ i%du.length ], dv[ i%dv.length ] ); // eslint-disable-line max-len
122+
if ( typeof s !== 'number' ) {
123+
b.fail( 'should return a number' );
124+
}
125+
}
126+
b.toc();
127+
if ( !isPositiveInteger( s ) ) {
128+
b.fail( 'should return a positive integer' );
129+
}
130+
b.pass( 'benchmark finished' );
131+
b.end();
132+
});
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
{{alias}}( dtypeX, dtypeY, dtypeZ, dtypeW, dtypeU, dtypeV )
3+
Returns a loop block size for multi-dimensional array tiled loops.
4+
5+
Parameters
6+
----------
7+
dtypeX: string|DataType
8+
First input array data type.
9+
10+
dtypeY: string|DataType
11+
Second input array data type.
12+
13+
dtypeZ: string|DataType
14+
Third input array data type.
15+
16+
dtypeW: string|DataType
17+
Fourth input array data type.
18+
19+
dtypeU: string|DataType
20+
Fifth input array data type.
21+
22+
dtypeV: string|DataType
23+
Output array data type.
24+
25+
Returns
26+
-------
27+
out: integer
28+
Block size.
29+
30+
Examples
31+
--------
32+
> out = {{alias}}( 'float64', 'int32', 'uint8', 'int8', 'int16', 'float64' )
33+
<number>
34+
35+
See Also
36+
--------
37+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2026 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
// TypeScript Version: 4.1
20+
21+
/// <reference types="@stdlib/types"/>
22+
23+
import { DataType } from '@stdlib/types/ndarray';
24+
25+
/**
26+
* Returns a loop block size for multi-dimensional array tiled loops.
27+
*
28+
* @param dtypeX - first input array data type
29+
* @param dtypeY - second input array data type
30+
* @param dtypeZ - third input array data type
31+
* @param dtypeW - fourth input array data type
32+
* @param dtypeU - fifth input array data type
33+
* @param dtypeV - output array data type
34+
* @returns block size (in units of elements)
35+
*
36+
* @example
37+
* var bsize = quinaryBlockSize( 'float64', 'float64', 'float64', 'float64', 'float64', 'float64' );
38+
* // returns <number>
39+
*/
40+
declare function quinaryBlockSize( dtypeX: DataType, dtypeY: DataType, dtypeZ: DataType, dtypeW: DataType, dtypeU: DataType, dtypeV: DataType ): number;
41+
42+
43+
// EXPORTS //
44+
45+
export = quinaryBlockSize;

0 commit comments

Comments
 (0)