@stdlib/ndarray-base-binary-tiling-block-size 0.0.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/NOTICE CHANGED
@@ -1 +1 @@
1
- Copyright (c) 2016-2023 The Stdlib Authors.
1
+ Copyright (c) 2016-2024 The Stdlib Authors.
package/README.md CHANGED
@@ -18,6 +18,17 @@ limitations under the License.
18
18
 
19
19
  -->
20
20
 
21
+
22
+ <details>
23
+ <summary>
24
+ About stdlib...
25
+ </summary>
26
+ <p>We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.</p>
27
+ <p>The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.</p>
28
+ <p>When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.</p>
29
+ <p>To join us in bringing numerical computing to the web, get started by checking us out on <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p>
30
+ </details>
31
+
21
32
  # binaryBlockSize
22
33
 
23
34
  [![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->
@@ -146,9 +157,14 @@ For more information on the project, filing bug reports and feature requests, an
146
157
 
147
158
  ---
148
159
 
160
+ ## License
161
+
162
+ See [LICENSE][stdlib-license].
163
+
164
+
149
165
  ## Copyright
150
166
 
151
- Copyright &copy; 2016-2023. The Stdlib [Authors][stdlib-authors].
167
+ Copyright &copy; 2016-2024. The Stdlib [Authors][stdlib-authors].
152
168
 
153
169
  </section>
154
170
 
@@ -161,8 +177,8 @@ Copyright &copy; 2016-2023. The Stdlib [Authors][stdlib-authors].
161
177
  [npm-image]: http://img.shields.io/npm/v/@stdlib/ndarray-base-binary-tiling-block-size.svg
162
178
  [npm-url]: https://npmjs.org/package/@stdlib/ndarray-base-binary-tiling-block-size
163
179
 
164
- [test-image]: https://github.com/stdlib-js/ndarray-base-binary-tiling-block-size/actions/workflows/test.yml/badge.svg?branch=v0.0.2
165
- [test-url]: https://github.com/stdlib-js/ndarray-base-binary-tiling-block-size/actions/workflows/test.yml?query=branch:v0.0.2
180
+ [test-image]: https://github.com/stdlib-js/ndarray-base-binary-tiling-block-size/actions/workflows/test.yml/badge.svg?branch=v0.2.0
181
+ [test-url]: https://github.com/stdlib-js/ndarray-base-binary-tiling-block-size/actions/workflows/test.yml?query=branch:v0.2.0
166
182
 
167
183
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/ndarray-base-binary-tiling-block-size/main.svg
168
184
  [coverage-url]: https://codecov.io/github/stdlib-js/ndarray-base-binary-tiling-block-size?branch=main
@@ -185,10 +201,15 @@ Copyright &copy; 2016-2023. The Stdlib [Authors][stdlib-authors].
185
201
  [es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
186
202
 
187
203
  [deno-url]: https://github.com/stdlib-js/ndarray-base-binary-tiling-block-size/tree/deno
204
+ [deno-readme]: https://github.com/stdlib-js/ndarray-base-binary-tiling-block-size/blob/deno/README.md
188
205
  [umd-url]: https://github.com/stdlib-js/ndarray-base-binary-tiling-block-size/tree/umd
206
+ [umd-readme]: https://github.com/stdlib-js/ndarray-base-binary-tiling-block-size/blob/umd/README.md
189
207
  [esm-url]: https://github.com/stdlib-js/ndarray-base-binary-tiling-block-size/tree/esm
208
+ [esm-readme]: https://github.com/stdlib-js/ndarray-base-binary-tiling-block-size/blob/esm/README.md
190
209
  [branches-url]: https://github.com/stdlib-js/ndarray-base-binary-tiling-block-size/blob/main/branches.md
191
210
 
211
+ [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/ndarray-base-binary-tiling-block-size/main/LICENSE
212
+
192
213
  [@stdlib/ndarray/dtypes]: https://www.npmjs.com/package/@stdlib/ndarray-dtypes
193
214
 
194
215
  </section>
package/SECURITY.md ADDED
@@ -0,0 +1,5 @@
1
+ # Security
2
+
3
+ > Policy for reporting security vulnerabilities.
4
+
5
+ See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security).
@@ -0,0 +1,3 @@
1
+ /// <reference path="../docs/types/index.d.ts" />
2
+ import binaryBlockSize from '../docs/types/index';
3
+ export = binaryBlockSize;
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ "use strict";var i=function(u,r){return function(){return r||u((r={exports:{}}).exports,r),r.exports}};var s=i(function(f,S){
2
+ var l={BLOCK_SIZE_IN_BYTES:64,BLOCK_SIZE_IN_ELEMENTS:8};S.exports=l
3
+ });var a=i(function(C,I){
4
+ var n=require('@stdlib/ndarray-base-bytes-per-element/dist'),E=s();function L(u,r,B){var e,t,_;return e=n(u),t=n(r),_=n(B),e===null||t===null||_===null?E.BLOCK_SIZE_IN_ELEMENTS:e>t&&e>_?E.BLOCK_SIZE_IN_BYTES/e|0:t>_?E.BLOCK_SIZE_IN_BYTES/t|0:E.BLOCK_SIZE_IN_BYTES/_|0}I.exports=L
5
+ });var N=a();module.exports=N;
6
+ /** @license Apache-2.0 */
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../lib/defaults.js", "../lib/main.js", "../lib/index.js"],
4
+ "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MAIN //\n\nvar defaults = {\n\t// Define a default block size (in bytes):\n\t'BLOCK_SIZE_IN_BYTES': 64|0, // 64b is a common cache line size. How applicable the common cache line size is here is debatable, given that, depending on the associated stride(s), the innermost loop may not iterate over adjacent elements. The primary goal is to have a block size in which all data within a block can always fit in (L1) cache, regardless of cache size (i.e., cache-oblivious). For reference, a common L1 cache size is 32kB per core. For best performance, block sizes should be tuned based on system hardware; however, such tuning is not readily available to us here. Without obvious better alternatives, 64b has some theoretical (and practical) underpinning, and it should be good enough for most inputs, especially for ndarrays with near contiguity.\n\n\t// Define a default block size (in elements):\n\t'BLOCK_SIZE_IN_ELEMENTS': 8|0 // 64 bytes / 8 bytes per element (i.e., default element size is same as a double)\n};\n\n\n// EXPORTS //\n\nmodule.exports = defaults;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar bytesPerElement = require( '@stdlib/ndarray-base-bytes-per-element' );\nvar defaults = require( './defaults.js' );\n\n\n// MAIN //\n\n/**\n* Returns a loop block size for multi-dimensional array tiled loops.\n*\n* @param {string} dtypeX - first input array data type\n* @param {string} dtypeY - second input array data type\n* @param {string} dtypeZ - output array data type\n* @returns {integer} block size (in units of elements)\n*\n* @example\n* var bsize = binaryBlockSize( 'float64', 'float64', 'float64' );\n* // returns <number>\n*/\nfunction binaryBlockSize( dtypeX, dtypeY, dtypeZ ) {\n\tvar nbx;\n\tvar nby;\n\tvar nbz;\n\n\tnbx = bytesPerElement( dtypeX );\n\tnby = bytesPerElement( dtypeY );\n\tnbz = bytesPerElement( dtypeZ );\n\tif ( nbx === null || nby === null || nbz === null ) { // e.g., \"generic\" arrays\n\t\treturn defaults.BLOCK_SIZE_IN_ELEMENTS;\n\t}\n\tif ( nbx > nby && nbx > nbz ) {\n\t\treturn ( defaults.BLOCK_SIZE_IN_BYTES/nbx )|0; // asm type annotation\n\t}\n\tif ( nby > nbz ) {\n\t\treturn ( defaults.BLOCK_SIZE_IN_BYTES/nby )|0; // asm type annotation\n\t}\n\treturn ( defaults.BLOCK_SIZE_IN_BYTES/nbz )|0; // asm type annotation\n}\n\n\n// EXPORTS //\n\nmodule.exports = binaryBlockSize;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2023 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Resolve a loop block size for multi-dimensional array tiled loops.\n*\n* @module @stdlib/ndarray-base-binary-tiling-block-size\n*\n* @example\n* var binaryBlockSize = require( '@stdlib/ndarray-base-binary-tiling-block-size' );\n*\n* var bsize = binaryBlockSize( 'float64', 'float64', 'float64' );\n* // returns <number>\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
5
+ "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAW,CAEd,oBAAuB,GAGvB,uBAA0B,CAC3B,EAKAD,EAAO,QAAUC,ICjCjB,IAAAC,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAkB,QAAS,wCAAyC,EACpEC,EAAW,IAiBf,SAASC,EAAiBC,EAAQC,EAAQC,EAAS,CAClD,IAAIC,EACAC,EACAC,EAKJ,OAHAF,EAAMN,EAAiBG,CAAO,EAC9BI,EAAMP,EAAiBI,CAAO,EAC9BI,EAAMR,EAAiBK,CAAO,EACzBC,IAAQ,MAAQC,IAAQ,MAAQC,IAAQ,KACrCP,EAAS,uBAEZK,EAAMC,GAAOD,EAAME,EACdP,EAAS,oBAAoBK,EAAM,EAExCC,EAAMC,EACDP,EAAS,oBAAoBM,EAAM,EAEpCN,EAAS,oBAAoBO,EAAM,CAC7C,CAKAT,EAAO,QAAUG,IC7BjB,IAAIO,EAAO,IAKX,OAAO,QAAUA",
6
+ "names": ["require_defaults", "__commonJSMin", "exports", "module", "defaults", "require_main", "__commonJSMin", "exports", "module", "bytesPerElement", "defaults", "binaryBlockSize", "dtypeX", "dtypeY", "dtypeZ", "nbx", "nby", "nbz", "main"]
7
+ }
@@ -16,7 +16,7 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- // TypeScript Version: 2.0
19
+ // TypeScript Version: 4.1
20
20
 
21
21
  /**
22
22
  * Returns a loop block size for multi-dimensional array tiled loops.
@@ -30,7 +30,7 @@
30
30
  * var bsize = binaryBlockSize( 'float64', 'float64', 'float64' );
31
31
  * // returns <number>
32
32
  */
33
- declare function binaryBlockSize( dtypeX: string, dtypeY: string, dtypeZ: string ): number; // tslint-disable-line max-line-length
33
+ declare function binaryBlockSize( dtypeX: string, dtypeY: string, dtypeZ: string ): number;
34
34
 
35
35
 
36
36
  // EXPORTS //
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stdlib/ndarray-base-binary-tiling-block-size",
3
- "version": "0.0.2",
3
+ "version": "0.2.0",
4
4
  "description": "Resolve a loop block size for multi-dimensional array tiled loops.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -37,17 +37,18 @@
37
37
  "url": "https://github.com/stdlib-js/stdlib/issues"
38
38
  },
39
39
  "dependencies": {
40
- "@stdlib/ndarray-base-bytes-per-element": "^0.0.8"
40
+ "@stdlib/ndarray-base-bytes-per-element": "^0.2.0"
41
41
  },
42
42
  "devDependencies": {
43
- "@stdlib/array-base-cartesian-square": "^0.0.3",
44
- "@stdlib/assert-is-positive-integer": "^0.0.7",
45
- "@stdlib/bench": "^0.0.12",
46
- "@stdlib/ndarray-dtypes": "^0.0.9",
47
- "@stdlib/ndarray-promotion-rules": "^0.0.8",
43
+ "@stdlib/array-base-cartesian-square": "^0.1.0",
44
+ "@stdlib/assert-is-positive-integer": "^0.1.0",
45
+ "@stdlib/ndarray-dtypes": "^0.2.0",
46
+ "@stdlib/ndarray-promotion-rules": "^0.2.0",
48
47
  "tape": "git+https://github.com/kgryte/tape.git#fix/globby",
49
48
  "istanbul": "^0.4.1",
50
- "tap-min": "git+https://github.com/Planeshifter/tap-min.git"
49
+ "tap-min": "git+https://github.com/Planeshifter/tap-min.git",
50
+ "@stdlib/bench-harness": "^0.2.0",
51
+ "@stdlib/bench": "^0.3.1"
51
52
  },
52
53
  "engines": {
53
54
  "node": ">=0.10.0",