Full Code of gpujs/gpu.js for AI

develop f66631c4fc1b cached
432 files
2.9 MB
790.0k tokens
3246 symbols
1 requests
Download .txt
Showing preview only (3,152K chars total). Download the full file or copy to clipboard to get everything.
Repository: gpujs/gpu.js
Branch: develop
Commit: f66631c4fc1b
Files: 432
Total size: 2.9 MB

Directory structure:
gitextract_g_im5cfv/

├── .gitignore
├── CONTRIBUTING.md
├── ISSUE_TEMPLATE.md
├── LICENSE
├── README.md
├── dist/
│   ├── gpu-browser-core.js
│   └── gpu-browser.js
├── examples/
│   ├── advanced-typescript.ts
│   ├── cat-image/
│   │   └── index.html
│   ├── fluid.html
│   ├── internal-variable-precision.html
│   ├── json-saving.js
│   ├── mandelbrot-set.html
│   ├── mandelbulb.html
│   ├── parallel-raytracer.html
│   ├── random.html
│   ├── raster-globe/
│   │   └── index.html
│   ├── raytracer.html
│   ├── simple-javascript.js
│   ├── simple-typescript.ts
│   ├── slow-fade.html
│   └── video/
│       └── index.html
├── gulpfile.js
├── package.json
├── src/
│   ├── alias.js
│   ├── backend/
│   │   ├── cpu/
│   │   │   ├── function-node.js
│   │   │   ├── kernel-string.js
│   │   │   └── kernel.js
│   │   ├── function-builder.js
│   │   ├── function-node.js
│   │   ├── function-tracer.js
│   │   ├── gl/
│   │   │   ├── kernel-string.js
│   │   │   ├── kernel.js
│   │   │   └── texture/
│   │   │       ├── array-2-float-2d.js
│   │   │       ├── array-2-float-3d.js
│   │   │       ├── array-2-float.js
│   │   │       ├── array-3-float-2d.js
│   │   │       ├── array-3-float-3d.js
│   │   │       ├── array-3-float.js
│   │   │       ├── array-4-float-2d.js
│   │   │       ├── array-4-float-3d.js
│   │   │       ├── array-4-float.js
│   │   │       ├── float-2d.js
│   │   │       ├── float-3d.js
│   │   │       ├── float.js
│   │   │       ├── graphical.js
│   │   │       ├── index.js
│   │   │       ├── memory-optimized-2d.js
│   │   │       ├── memory-optimized-3d.js
│   │   │       ├── memory-optimized.js
│   │   │       ├── unsigned-2d.js
│   │   │       ├── unsigned-3d.js
│   │   │       └── unsigned.js
│   │   ├── headless-gl/
│   │   │   └── kernel.js
│   │   ├── kernel-value.js
│   │   ├── kernel.js
│   │   ├── web-gl/
│   │   │   ├── fragment-shader.js
│   │   │   ├── function-node.js
│   │   │   ├── kernel-value/
│   │   │   │   ├── array.js
│   │   │   │   ├── array2.js
│   │   │   │   ├── array3.js
│   │   │   │   ├── array4.js
│   │   │   │   ├── boolean.js
│   │   │   │   ├── dynamic-html-image.js
│   │   │   │   ├── dynamic-html-video.js
│   │   │   │   ├── dynamic-memory-optimized-number-texture.js
│   │   │   │   ├── dynamic-number-texture.js
│   │   │   │   ├── dynamic-single-array.js
│   │   │   │   ├── dynamic-single-array1d-i.js
│   │   │   │   ├── dynamic-single-array2d-i.js
│   │   │   │   ├── dynamic-single-array3d-i.js
│   │   │   │   ├── dynamic-single-input.js
│   │   │   │   ├── dynamic-unsigned-array.js
│   │   │   │   ├── dynamic-unsigned-input.js
│   │   │   │   ├── float.js
│   │   │   │   ├── html-image.js
│   │   │   │   ├── html-video.js
│   │   │   │   ├── index.js
│   │   │   │   ├── integer.js
│   │   │   │   ├── memory-optimized-number-texture.js
│   │   │   │   ├── number-texture.js
│   │   │   │   ├── single-array.js
│   │   │   │   ├── single-array1d-i.js
│   │   │   │   ├── single-array2d-i.js
│   │   │   │   ├── single-array3d-i.js
│   │   │   │   ├── single-input.js
│   │   │   │   ├── unsigned-array.js
│   │   │   │   └── unsigned-input.js
│   │   │   ├── kernel-value-maps.js
│   │   │   ├── kernel.js
│   │   │   └── vertex-shader.js
│   │   └── web-gl2/
│   │       ├── fragment-shader.js
│   │       ├── function-node.js
│   │       ├── kernel-value/
│   │       │   ├── array2.js
│   │       │   ├── array3.js
│   │       │   ├── array4.js
│   │       │   ├── boolean.js
│   │       │   ├── dynamic-html-image-array.js
│   │       │   ├── dynamic-html-image.js
│   │       │   ├── dynamic-html-video.js
│   │       │   ├── dynamic-memory-optimized-number-texture.js
│   │       │   ├── dynamic-number-texture.js
│   │       │   ├── dynamic-single-array.js
│   │       │   ├── dynamic-single-array1d-i.js
│   │       │   ├── dynamic-single-array2d-i.js
│   │       │   ├── dynamic-single-array3d-i.js
│   │       │   ├── dynamic-single-input.js
│   │       │   ├── dynamic-unsigned-array.js
│   │       │   ├── dynamic-unsigned-input.js
│   │       │   ├── float.js
│   │       │   ├── html-image-array.js
│   │       │   ├── html-image.js
│   │       │   ├── html-video.js
│   │       │   ├── integer.js
│   │       │   ├── memory-optimized-number-texture.js
│   │       │   ├── number-texture.js
│   │       │   ├── single-array.js
│   │       │   ├── single-array1d-i.js
│   │       │   ├── single-array2d-i.js
│   │       │   ├── single-array3d-i.js
│   │       │   ├── single-input.js
│   │       │   ├── unsigned-array.js
│   │       │   └── unsigned-input.js
│   │       ├── kernel-value-maps.js
│   │       ├── kernel.js
│   │       └── vertex-shader.js
│   ├── browser-header.txt
│   ├── browser.js
│   ├── gpu.js
│   ├── index.d.ts
│   ├── index.js
│   ├── input.js
│   ├── kernel-run-shortcut.js
│   ├── plugins/
│   │   ├── math-random-triangle-noise.js
│   │   └── math-random-uniformly-distributed.js
│   ├── texture.js
│   └── utils.js
└── test/
    ├── all-template.html
    ├── all.html
    ├── benchmark-faster.js
    ├── benchmark.js
    ├── browser-test-utils.js
    ├── features/
    │   ├── add-custom-function.js
    │   ├── add-custom-native-function.js
    │   ├── add-typed-functions.js
    │   ├── argument-array-types.js
    │   ├── argument-array1d-types.js
    │   ├── argument-array2d-types.js
    │   ├── argument-array3d-types.js
    │   ├── arithmetic-operators.js
    │   ├── assignment-operators.js
    │   ├── basic-math.js
    │   ├── bitwise-operators.js
    │   ├── boolean-from-expression.js
    │   ├── canvas.js
    │   ├── clear-textures.js
    │   ├── clone-textures.js
    │   ├── combine-kernels.js
    │   ├── constants-array.js
    │   ├── constants-bool.js
    │   ├── constants-canvas.js
    │   ├── constants-float.js
    │   ├── constants-image-array.js
    │   ├── constants-image.js
    │   ├── constants-integer.js
    │   ├── constants-texture.js
    │   ├── cpu-with-textures.js
    │   ├── create-kernel-map.js
    │   ├── demo.js
    │   ├── destroy.js
    │   ├── destructured-assignment.js
    │   ├── dev-mode.js
    │   ├── dynamic-arguments.js
    │   ├── dynamic-output.js
    │   ├── function-return.js
    │   ├── get-canvas.js
    │   ├── get-pixels.js
    │   ├── if-else.js
    │   ├── image-array.js
    │   ├── image.js
    │   ├── infinity.js
    │   ├── inject-native.js
    │   ├── input.js
    │   ├── internally-defined-matrices.js
    │   ├── json.js
    │   ├── legacy-encoder.js
    │   ├── loops.js
    │   ├── math-object.js
    │   ├── nested-function.js
    │   ├── offscreen-canvas.js
    │   ├── optimize-float-memory.js
    │   ├── output.js
    │   ├── promise-api.js
    │   ├── raw-output.js
    │   ├── read-color-texture.js
    │   ├── read-from-texture.js
    │   ├── read-image-bitmap.js
    │   ├── read-image-data.js
    │   ├── read-offscreen-canvas.js
    │   ├── return-arrays.js
    │   ├── single-precision-textures.js
    │   ├── single-precision.js
    │   ├── switches.js
    │   ├── tactic.js
    │   ├── ternary.js
    │   ├── to-string/
    │   │   ├── as-file.js
    │   │   └── precision/
    │   │       ├── single/
    │   │       │   ├── arguments/
    │   │       │   │   ├── array.js
    │   │       │   │   ├── array2.js
    │   │       │   │   ├── array2d.js
    │   │       │   │   ├── array2d2.js
    │   │       │   │   ├── array2d3.js
    │   │       │   │   ├── array3.js
    │   │       │   │   ├── array3d.js
    │   │       │   │   ├── array4.js
    │   │       │   │   ├── boolean.js
    │   │       │   │   ├── float.js
    │   │       │   │   ├── html-canvas.js
    │   │       │   │   ├── html-image-array.js
    │   │       │   │   ├── html-image.js
    │   │       │   │   ├── html-video.js
    │   │       │   │   ├── input.js
    │   │       │   │   ├── integer.js
    │   │       │   │   ├── memory-optimized-number-texture.js
    │   │       │   │   └── number-texture.js
    │   │       │   ├── constants/
    │   │       │   │   ├── array.js
    │   │       │   │   ├── array2.js
    │   │       │   │   ├── array2d.js
    │   │       │   │   ├── array3.js
    │   │       │   │   ├── array3d.js
    │   │       │   │   ├── array4.js
    │   │       │   │   ├── boolean.js
    │   │       │   │   ├── float.js
    │   │       │   │   ├── html-canvas.js
    │   │       │   │   ├── html-image-array.js
    │   │       │   │   ├── html-image.js
    │   │       │   │   ├── input.js
    │   │       │   │   ├── integer.js
    │   │       │   │   ├── memory-optimized-number-texture.js
    │   │       │   │   └── number-texture.js
    │   │       │   ├── graphical.js
    │   │       │   ├── kernel-map/
    │   │       │   │   ├── array/
    │   │       │   │   │   ├── array.js
    │   │       │   │   │   ├── array2d.js
    │   │       │   │   │   ├── array3d.js
    │   │       │   │   │   ├── memory-optimized-number-texture.js
    │   │       │   │   │   └── number-texture.js
    │   │       │   │   └── object/
    │   │       │   │       ├── array.js
    │   │       │   │       ├── array2d.js
    │   │       │   │       ├── array3d.js
    │   │       │   │       ├── memory-optimized-number-texture.js
    │   │       │   │       └── number-texture.js
    │   │       │   └── returns/
    │   │       │       ├── array.js
    │   │       │       ├── array2d.js
    │   │       │       ├── array3d.js
    │   │       │       └── texture.js
    │   │       └── unsigned/
    │   │           ├── arguments/
    │   │           │   ├── array.js
    │   │           │   ├── array2.js
    │   │           │   ├── array2d.js
    │   │           │   ├── array3.js
    │   │           │   ├── array3d.js
    │   │           │   ├── array4.js
    │   │           │   ├── boolean.js
    │   │           │   ├── float.js
    │   │           │   ├── html-canvas.js
    │   │           │   ├── html-image-array.js
    │   │           │   ├── html-image.js
    │   │           │   ├── html-video.js
    │   │           │   ├── input.js
    │   │           │   ├── integer.js
    │   │           │   ├── memory-optimized-number-texture.js
    │   │           │   └── number-texture.js
    │   │           ├── constants/
    │   │           │   ├── array.js
    │   │           │   ├── array2.js
    │   │           │   ├── array2d.js
    │   │           │   ├── array3.js
    │   │           │   ├── array3d.js
    │   │           │   ├── array4.js
    │   │           │   ├── boolean.js
    │   │           │   ├── float.js
    │   │           │   ├── html-canvas.js
    │   │           │   ├── html-image-array.js
    │   │           │   ├── html-image.js
    │   │           │   ├── input.js
    │   │           │   ├── integer.js
    │   │           │   ├── memory-optimized-number-texture.js
    │   │           │   └── number-texture.js
    │   │           ├── graphical.js
    │   │           ├── kernel-map/
    │   │           │   ├── array/
    │   │           │   │   ├── array.js
    │   │           │   │   ├── array2d.js
    │   │           │   │   ├── array3d.js
    │   │           │   │   ├── memory-optimized-number-texture.js
    │   │           │   │   └── number-texture.js
    │   │           │   └── object/
    │   │           │       ├── array.js
    │   │           │       ├── array2d.js
    │   │           │       ├── array3d.js
    │   │           │       ├── memory-optimized-number-texture.js
    │   │           │       └── number-texture.js
    │   │           └── returns/
    │   │               ├── array.js
    │   │               ├── array2d.js
    │   │               ├── array3d.js
    │   │               └── texture.js
    │   ├── type-management.js
    │   ├── unsigned-precision-textures.js
    │   └── video.js
    ├── index.js
    ├── internal/
    │   ├── argument-texture-switching.js
    │   ├── backend/
    │   │   ├── cpu-kernel.js
    │   │   ├── function-node/
    │   │   │   ├── isSafe.js
    │   │   │   └── isSafeDependencies.js
    │   │   ├── gl-kernel.js
    │   │   ├── headless-gl/
    │   │   │   └── kernel/
    │   │   │       └── index.js
    │   │   ├── web-gl/
    │   │   │   ├── function-node/
    │   │   │   │   ├── astBinaryExpression.js
    │   │   │   │   ├── astCallExpression.js
    │   │   │   │   ├── astForStatement.js
    │   │   │   │   ├── astVariableDeclaration.js
    │   │   │   │   ├── contexts.js
    │   │   │   │   ├── firstAvailableTypeFromAst.js
    │   │   │   │   ├── getVariableSignature.js
    │   │   │   │   └── getVariableType.js
    │   │   │   ├── kernel/
    │   │   │   │   ├── index.js
    │   │   │   │   ├── setupArguments.js
    │   │   │   │   └── setupConstants.js
    │   │   │   └── kernel-value/
    │   │   │       ├── dynamic-html-image.js
    │   │   │       ├── dynamic-memory-optimized-number-texture.js
    │   │   │       ├── dynamic-number-texture.js
    │   │   │       ├── dynamic-single-array.js
    │   │   │       ├── dynamic-single-array1d-i.js
    │   │   │       ├── dynamic-single-array2d-i.js
    │   │   │       ├── dynamic-single-array3d-i.js
    │   │   │       ├── dynamic-single-input.js
    │   │   │       ├── dynamic-unsigned-array.js
    │   │   │       ├── dynamic-unsigned-input.js
    │   │   │       ├── html-image.js
    │   │   │       ├── memory-optimized-number-texture.js
    │   │   │       ├── number-texture.js
    │   │   │       ├── single-array.js
    │   │   │       ├── single-array1d-i.js
    │   │   │       ├── single-array2d-i.js
    │   │   │       ├── single-array3d-i.js
    │   │   │       ├── single-input.js
    │   │   │       ├── unsigned-array.js
    │   │   │       └── unsigned-input.js
    │   │   └── web-gl2/
    │   │       ├── kernel/
    │   │       │   ├── index.js
    │   │       │   ├── setupArguments.js
    │   │       │   └── setupConstants.js
    │   │       └── kernel-value/
    │   │           ├── dynamic-html-image-array.js
    │   │           ├── dynamic-single-array.js
    │   │           ├── dynamic-single-input.js
    │   │           ├── html-image-array.js
    │   │           └── single-input.js
    │   ├── boolean.js
    │   ├── casting.js
    │   ├── constants-texture-switching.js
    │   ├── constructor-features.js
    │   ├── context-inheritance.js
    │   ├── deep-types.js
    │   ├── deprecated.js
    │   ├── different-texture-cloning.js
    │   ├── function-builder.js
    │   ├── function-composition.js
    │   ├── function-node.js
    │   ├── function-return-type-detection.js
    │   ├── function-tracer.js
    │   ├── gpu-methods.js
    │   ├── implied-else.js
    │   ├── kernel-run-shortcut.js
    │   ├── kernel.js
    │   ├── loop-int.js
    │   ├── loop-max.js
    │   ├── math.random.js
    │   ├── matrix-multiply-precision.js
    │   ├── mixed-memory-optimize.js
    │   ├── modes.js
    │   ├── overloading.js
    │   ├── precision.js
    │   ├── recycling.js
    │   ├── texture-index.js
    │   ├── underscores.js
    │   └── utils.js
    ├── issues/
    │   ├── 114-create-kernel-map-run-second-time.js
    │   ├── 116-multiple-kernels-run-again.js
    │   ├── 130-typed-array.js
    │   ├── 147-missing-constant.js
    │   ├── 152-for-vars.js
    │   ├── 159-3d.js
    │   ├── 174-webgl-context-warning.js
    │   ├── 195-read-from-texture2d.js
    │   ├── 207-same-function-reuse.js
    │   ├── 212-funky-function-support.js
    │   ├── 233-kernel-map-single-precision.js
    │   ├── 241-CPU-vs-GPU-maps-output-differently.js
    │   ├── 259-atan2.js
    │   ├── 263-to-string.js
    │   ├── 267-immutable-sub-kernels.js
    │   ├── 270-cache.js
    │   ├── 279-wrong-canvas-size.js
    │   ├── 300-nested-array-index.js
    │   ├── 31-nested-var-declare-test.js
    │   ├── 313-variable-lookup.js
    │   ├── 314-large-input-array-addressing.js
    │   ├── 335-missing-z-index-issue.js
    │   ├── 346-uint8array-converted.js
    │   ├── 349-division-by-factors-of-3.js
    │   ├── 357-modulus-issue.js
    │   ├── 359-addfunction-params-wrong.js
    │   ├── 378-only-first-iteration.js
    │   ├── 382-bad-constant.js
    │   ├── 390-thread-assignment.js
    │   ├── 396-combine-kernels-example.js
    │   ├── 399-double-definition.js
    │   ├── 401-cpu-canvas-check.js
    │   ├── 410-if-statement.js
    │   ├── 422-warnings.js
    │   ├── 470-modulus-wrong.js
    │   ├── 471-canvas-issue.js
    │   ├── 472-compilation-issue.js
    │   ├── 473-4-pixels.js
    │   ├── 487-dynamic-arguments.js
    │   ├── 493-strange-literal.js
    │   ├── 500-sticky-arrays.js
    │   ├── 519-sanitize-names.js
    │   ├── 553-permanent-flip.js
    │   ├── 556-minify-for-loop.js
    │   ├── 560-minification-madness.js
    │   ├── 564-boolean.js
    │   ├── 567-wrong-modulus.js
    │   ├── 585-inaccurate-lookups.js
    │   ├── 586-unable-to-resize.js
    │   ├── 608-rewritten-arrays.js
    │   ├── 91-create-kernel-map-array.js
    │   └── 96-param-names.js
    ├── jellyfish.webm
    └── test-utils.js

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# node-waf configuration
.lock-wscript

# Dependency directory
node_modules

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history

# intellij
.idea

#yarn
yarn.lock

# OSX .DS_Store
.DS_Store


================================================
FILE: CONTRIBUTING.md
================================================
Thanks for taking the time to contribute to gpu.js. Follow these guidelines to make the process smoother:

1. One feature per pull request. Each PR should have one focus, and all the code changes should be supporting that one feature or bug fix. Using a [separate branch](https://guides.github.com/introduction/flow/index.html) for each feature should help you manage developing multiple features at once.

2. Follow the style of the file when it comes to syntax like curly braces and indents.

3. Add a test for the feature or fix, if possible. See the `test` directory for existing tests and README describing how to run these tests.


================================================
FILE: ISSUE_TEMPLATE.md
================================================
<!-- If you don't mind add a fun gif or meme, but no pressure -->
![A GIF or MEME to give some spice of the internet](url)

## *What* is wrong?
<!-- Ex. run takes really long -->

## *Where* does it happen?
<!-- Ex. In GPU.js when trying to run a math function in node.js on my mac -->

## *How* do we replicate the issue?
<!-- Please be specific as possible. Use dashes (-) or numbers (1.) to create a list of steps -->

## *How* important is this (1-5)?
<!-- On a scale from 1-5 where 5 is the most important how would you rate it? -->

## Expected behavior (i.e. solution)
<!-- What do you think should have happened? -->


## Other Comments


================================================
FILE: LICENSE
================================================
The MIT License

Copyright (c) 2019 gpu.js Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


================================================
FILE: README.md
================================================
[<img width="100" alt="Logo" src="http://gpu.rocks/static/media/jelly.3587de60.png">](http://gpu.rocks/)
# GPU.js
GPU.js is a JavaScript Acceleration library for GPGPU (General purpose computing on GPUs) in JavaScript for Web and Node.
GPU.js automatically transpiles simple JavaScript functions into shader language and compiles them so they run on your GPU.
In case a GPU is not available, the functions will still run in regular JavaScript.
For some more quick concepts, see [Quick Concepts](https://github.com/gpujs/gpu.js/wiki/Quick-Concepts) on the wiki.


[![Join the chat at https://gitter.im/gpujs/gpu.js](https://badges.gitter.im/gpujs/gpu.js.svg)](https://gitter.im/gpujs/gpu.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Slack](https://slack.bri.im/badge.svg)](https://slack.bri.im)

# What is this sorcery?

Creates a GPU accelerated kernel transpiled from a javascript function that computes a single element in the 512 x 512 matrix (2D array).
The kernel functions are ran in tandem on the GPU often resulting in very fast computations!
You can run a benchmark of this [here](http://gpu.rocks). Typically, it will run 1-15x faster depending on your hardware.
Matrix multiplication (perform matrix multiplication on 2 matrices of size 512 x 512) written in GPU.js:

## Browser
```html
<script src="dist/gpu-browser.min.js"></script>
<script>
    // GPU is a constructor and namespace for browser
    const gpu = new GPU();
    const multiplyMatrix = gpu.createKernel(function(a, b) {
        let sum = 0;
        for (let i = 0; i < 512; i++) {
            sum += a[this.thread.y][i] * b[i][this.thread.x];
        }
        return sum;
    }).setOutput([512, 512]);

    const c = multiplyMatrix(a, b);
</script>
```

## CDN
``` 
https://unpkg.com/gpu.js@latest/dist/gpu-browser.min.js
https://cdn.jsdelivr.net/npm/gpu.js@latest/dist/gpu-browser.min.js
```

## Node
```js
const { GPU } = require('gpu.js');
const gpu = new GPU();
const multiplyMatrix = gpu.createKernel(function(a, b) {
    let sum = 0;
    for (let i = 0; i < 512; i++) {
        sum += a[this.thread.y][i] * b[i][this.thread.x];
    }
    return sum;
}).setOutput([512, 512]);

const c = multiplyMatrix(a, b);
```

## Typescript
```typescript
import { GPU } from 'gpu.js';
const gpu = new GPU();
const multiplyMatrix = gpu.createKernel(function(a: number[][], b: number[][]) {
  let sum = 0;
  for (let i = 0; i < 512; i++) {
    sum += a[this.thread.y][i] * b[i][this.thread.x];
  }
  return sum;
}).setOutput([512, 512]);

const c = multiplyMatrix(a, b) as number[][];
```

[Click here](/examples) for more typescript examples.

# Table of Contents

Notice documentation is off?  We do try our hardest, but if you find something,
  [please bring it to our attention](https://github.com/gpujs/gpu.js/issues), or _[become a contributor](#contributors)_!

* [Demos](#demos)
* [Installation](#installation)
* [`GPU` Settings](#gpu-settings)
* [`gpu.createKernel` Settings](#gpucreatekernel-settings)
  * [Declaring variables/functions within kernels](#declaring-variablesfunctions-within-kernels)
* [Creating and Running Functions](#creating-and-running-functions)
* [Debugging](#debugging)
* [Accepting Input](#accepting-input)
* [Graphical Output](#graphical-output)
* [Combining Kernels](#combining-kernels)
* [Create Kernel Map](#create-kernel-map)
* [Adding Custom Functions](#adding-custom-functions)
* [Adding Custom Functions Directly to Kernel](#adding-custom-functions-directly-to-kernel)
* [Types](#types)
* [Loops](#loops)
* [Pipelining](#pipelining)
  * [Cloning Textures](#cloning-textures-new-in-v2)
  * [Cleanup pipeline texture memory](#cleanup-pipeline-texture-memory-new-in-v24)
* [Offscreen Canvas](#offscreen-canvas)
* [Cleanup](#cleanup)
* [Flattened typed array support](#flattened-typed-array-support)
* [Precompiled and Lighter Weight Kernels](#precompiled-and-lighter-weight-kernels)
  * [using JSON](#using-json)
  * [Exporting kernel](#exporting-kernel)
* [Supported Math functions](#supported-math-functions)
* [How to check what is supported](#how-to-check-what-is-supported)
* [Typescript Typings](#typescript-typings)
* [Destructured Assignments](#destructured-assignments-new-in-v2)
* [Dealing With Transpilation](#dealing-with-transpilation)
* [Full API reference](#full-api-reference)
* [How possible in node](#how-possible-in-node)
* [Testing](#testing)
* [Building](#building)
* [Contributors](#contributors)
* [Contributing](#contributing)
* [Terms Explained](#terms-explained)
* [License](#license)

## Demos
GPU.js in the wild, all around the net.  Add yours here!
* [Temperature interpolation using GPU.js](https://observablehq.com/@rveciana/temperature-interpolation-using-gpu-js)
* [Julia Set Fractal using GPU.js](https://observablehq.com/@ukabuer/julia-set-fractal-using-gpu-js)
* [Hello, gpu.js v2](https://observablehq.com/@fil/hello-gpu-js-v2)
* [Basic gpu.js canvas example](https://observablehq.com/@rveciana/basic-gpu-js-canvas-example)
* [Raster projection with GPU.js](https://observablehq.com/@fil/raster-projection-with-gpu-js)
* [GPU.js Example: Slow Fade](https://observablehq.com/@robertleeplummerjr/gpu-js-example-slow-fade)
* [GPU.JS CA Proof of Concept](https://observablehq.com/@alexlamb/gpu-js-ca-proof-of-concept)
* [Image Convolution using GPU.js](https://observablehq.com/@ukabuer/image-convolution-using-gpu-js)
* [Leaflet + gpu.js canvas](https://observablehq.com/@rveciana/leaflet-gpu-js-canvas)
* [Image to GPU.js](https://observablehq.com/@fil/image-to-gpu)
* [GPU Accelerated Heatmap using gpu.js](https://observablehq.com/@tracyhenry/gpu-accelerated-heatmap-using-gpu-js)
* [Dijkstra’s algorithm in gpu.js](https://observablehq.com/@fil/dijkstras-algorithm-in-gpu-js)
* [Voronoi with gpu.js](https://observablehq.com/@fil/voronoi-with-gpu-js)
* [The gpu.js loop](https://observablehq.com/@fil/the-gpu-js-loop)
* [GPU.js Example: Mandelbrot Set](https://observablehq.com/@robertleeplummerjr/gpu-js-example-mandelbrot-set)
* [GPU.js Example: Mandelbulb](https://observablehq.com/@robertleeplummerjr/gpu-js-example-mandelbulb)
* [Inverse of the distance with gpu.js](https://observablehq.com/@rveciana/inverse-of-the-distance-with-gpu-js)
* [gpu.js laser detection v2](https://observablehq.com/@robertleeplummerjr/gpu-js-laser-detection-v2)
* [GPU.js Canvas](https://observablehq.com/@hubgit/gpu-js-canvas)
* [Video Convolution using GPU.js](https://observablehq.com/@robertleeplummerjr/video-convolution-using-gpu-js)
* [GPU Rock Paper Scissors](https://observablehq.com/@alexlamb/gpu-rock-paper-scissors)
* [Shaded relief with gpujs and d3js](https://observablehq.com/@rveciana/shaded-relief-with-gpujs-and-d3js/2)
* [Caesar Cipher GPU.js Example](https://observablehq.com/@robertleeplummerjr/caesar-cipher-gpu-js-example)
* [Matrix Multiplication GPU.js + Angular Example](https://ng-gpu.surge.sh/)
* [Conway's game of life](https://observablehq.com/@brakdag/conway-game-of-life-gpu-js)

## Installation
On Linux, ensure you have the correct header files installed: `sudo apt install mesa-common-dev libxi-dev` (adjust for your distribution)

### npm

```bash
npm install gpu.js --save
```

### yarn

```bash
yarn add gpu.js
```

[npm package](https://www.npmjs.com/package/gpu.js)
### Node
```js
const { GPU } = require('gpu.js');
const gpu = new GPU();
```

### Node Typescript **New in V2!**
```js
import { GPU } from 'gpu.js';
const gpu = new GPU();
```

### Browser

Download the latest version of GPU.js and include the files in your HTML page using the following tags:

```html
<script src="dist/gpu-browser.min.js"></script>
<script>
    const gpu = new GPU();
</script>
```

## `GPU` Settings
Settings are an object used to create an instance of `GPU`.  Example: `new GPU(settings)`
* `canvas`: `HTMLCanvasElement`.  Optional.  For sharing canvas.  Example: use THREE.js and GPU.js on same canvas.
* `context`: `WebGL2RenderingContext` or `WebGLRenderingContext`.  For sharing rendering context.  Example: use THREE.js and GPU.js on same rendering context.
* `mode`: Defaults to 'gpu', other values generally for debugging:
  * 'dev' **New in V2!**: VERY IMPORTANT!  Use this so you can breakpoint and debug your kernel!  This wraps your javascript in loops but DOES NOT transpile your code, so debugging is much easier.
  * 'webgl': Use the `WebGLKernel` for transpiling a kernel
  * 'webgl2': Use the `WebGL2Kernel` for transpiling a kernel
  * 'headlessgl' **New in V2!**: Use the `HeadlessGLKernel` for transpiling a kernel
  * 'cpu': Use the `CPUKernel` for transpiling a kernel
* `onIstanbulCoverageVariable`: Removed in v2.11.0, use v8 coverage
* `removeIstanbulCoverage`: Removed in v2.11.0, use v8 coverage

## `gpu.createKernel` Settings
Settings are an object used to create a `kernel` or `kernelMap`.  Example: `gpu.createKernel(settings)`
* `output` or `kernel.setOutput(output)`: `array` or `object` that describes the output of kernel.  When using `kernel.setOutput()` you _can_ call it after the kernel has compiled if `kernel.dynamicOutput` is `true`, to resize your output.  Example:
  * as array: `[width]`, `[width, height]`, or `[width, height, depth]`
  * as object: `{ x: width, y: height, z: depth }`
* `pipeline` or `kernel.setPipeline(true)` **New in V2!**: boolean, default = `false`
  * Causes `kernel()` calls to output a `Texture`.  To get array's from a `Texture`, use:
  ```js
  const result = kernel();
  result.toArray();
  ```
  * Can be passed _directly_ into kernels, and is preferred:
  ```js
  kernel(texture);
  ```
* `graphical` or `kernel.setGraphical(boolean)`: boolean, default = `false`
* `loopMaxIterations` or `kernel.setLoopMaxIterations(number)`: number, default = 1000
* `constants` or `kernel.setConstants(object)`: object, default = null
* `dynamicOutput` or `kernel.setDynamicOutput(boolean)`: boolean, default = false - turns dynamic output on or off
* `dynamicArguments` or `kernel.setDynamicArguments(boolean)`: boolean, default = false - turns dynamic arguments (use different size arrays and textures) on or off
* `optimizeFloatMemory` or `kernel.setOptimizeFloatMemory(boolean)` **New in V2!**: boolean - causes a float32 texture to use all 4 channels rather than 1, using less memory, but consuming more GPU.
* `precision` or `kernel.setPrecision('unsigned' | 'single')` **New in V2!**: 'single' or 'unsigned' - if 'single' output texture uses float32 for each colour channel rather than 8
* `fixIntegerDivisionAccuracy` or `kernel.setFixIntegerDivisionAccuracy(boolean)` : boolean - some cards have accuracy issues dividing by factors of three and some other primes (most apple kit?). Default on for affected cards, disable if accuracy not required.
* `functions` or `kernel.setFunctions(array)`: array, array of functions to be used inside kernel.  If undefined, inherits from `GPU` instance. Can also be an array of `{ source: function, argumentTypes: object, returnType: string }`.
* `nativeFunctions` or `kernel.setNativeFunctions(array)`: object, defined as: `{ name: string, source: string, settings: object }`.  This is generally set via using GPU.addNativeFunction()
  * VERY IMPORTANT! - Use this to add special native functions to your environment when you need specific functionality is needed.
* `injectedNative` or `kernel.setInjectedNative(string)` **New in V2!**: string, defined as: `{ functionName: functionSource }`.  This is for injecting native code before translated kernel functions.
* `subKernels` or `kernel.setSubKernels(array)`: array, generally inherited from `GPU` instance.
* `immutable` or `kernel.setImmutable(boolean)`: boolean, default = `false`
  * VERY IMPORTANT! - This was removed in v2.4.0 - v2.7.0, and brought back in v2.8.0 [by popular demand](https://github.com/gpujs/gpu.js/issues/572), please upgrade to get the feature
* `strictIntegers` or `kernel.setStrictIntegers(boolean)`: boolean, default = `false` - allows undefined argumentTypes and function return values to use strict integer declarations.
* `useLegacyEncoder` or `kernel.setUseLegacyEncoder(boolean)`: boolean, default `false` - more info [here](https://github.com/gpujs/gpu.js/wiki/Encoder-details).
* `tactic` or `kernel.setTactic('speed' | 'balanced' | 'precision')` **New in V2!**: Set the kernel's tactic for compilation.  Allows for compilation to better fit how GPU.js is being used (internally uses `lowp` for 'speed', `mediump` for 'balanced', and `highp` for 'precision').  Default is lowest resolution supported for output.


## Creating and Running Functions
Depending on your output type, specify the intended size of your output.
You cannot have an accelerated function that does not specify any output size.

Output size   |  How to specify output size   |  How to reference in kernel
--------------|-------------------------------|--------------------------------
 1D           | `[length]`                    |  `value[this.thread.x]`
 2D           | `[width, height]`             |  `value[this.thread.y][this.thread.x]`
 3D           | `[width, height, depth]`      |  `value[this.thread.z][this.thread.y][this.thread.x]`

```js
const settings = {
    output: [100]
};
```

or

```js
// You can also use x, y, and z
const settings = {
    output: { x: 100 }
};
```

Create the function you want to run on the GPU. The first input parameter to `createKernel` is a kernel function which will compute a single number in the output. The thread identifiers, `this.thread.x`, `this.thread.y` or `this.thread.z` will allow you to specify the appropriate behavior of the kernel function at specific positions of the output.

```js
const kernel = gpu.createKernel(function() {
    return this.thread.x;
}, settings);
```

The created function is a regular JavaScript function, and you can use it like one.

```js
kernel();
// Result: Float32Array[0, 1, 2, 3, ... 99]
```

Note: Instead of creating an object, you can use the chainable shortcut methods as a neater way of specifying settings.

```js
const kernel = gpu.createKernel(function() {
    return this.thread.x;
}).setOutput([100]);

kernel();
// Result: Float32Array[0, 1, 2, 3, ... 99]
```

### Declaring variables/functions within kernels

GPU.js makes variable declaration inside kernel functions easy.  Variable types supported are:
* `Number` (Integer or Number), example: `let value = 1` or `let value = 1.1` 
* `Boolean`, example: `let value = true`
* `Array(2)`, example: `let value = [1, 1]`
* `Array(3)`, example: `let value = [1, 1, 1]`
* `Array(4)`, example: `let value = [1, 1, 1, 1]`
* `private Function`, example: `function myFunction(value) { return value + 1; }`

`Number` kernel example:
```js
const kernel = gpu.createKernel(function() {
 const i = 1;
 const j = 0.89;
 return i + j;
}).setOutput([100]);
```

`Boolean` kernel example:
```js
const kernel = gpu.createKernel(function() {
  const i = true;
  if (i) return 1;
  return 0;
}).setOutput([100]);
```

`Array(2)` kernel examples:
Using declaration
```js
const kernel = gpu.createKernel(function() {
 const array2 = [0.08, 2];
 return array2;
}).setOutput([100]);
```

Directly returned
```js
const kernel = gpu.createKernel(function() {
 return [0.08, 2];
}).setOutput([100]);
```

`Array(3)` kernel example:
Using declaration
```js
const kernel = gpu.createKernel(function() {
 const array2 = [0.08, 2, 0.1];
 return array2;
}).setOutput([100]);
```

Directly returned
```js
const kernel = gpu.createKernel(function() {
 return [0.08, 2, 0.1];
}).setOutput([100]);
```

`Array(4)` kernel example:
Using declaration
```js
const kernel = gpu.createKernel(function() {
 const array2 = [0.08, 2, 0.1, 3];
 return array2;
}).setOutput([100]);
```

Directly returned
```js
const kernel = gpu.createKernel(function() {
 return [0.08, 2, 0.1, 3];
}).setOutput([100]);
```

`private Function` kernel example:
```js
const kernel = gpu.createKernel(function() {
  function myPrivateFunction() {
    return [0.08, 2, 0.1, 3];
  }
  
  return myPrivateFunction(); // <-- type inherited here
}).setOutput([100]);
```

## Debugging
Debugging can be done in a variety of ways, and there are different levels of debugging.
* Debugging kernels with breakpoints can be done with `new GPU({ mode: 'dev' })`
  * This puts `GPU.js` into development mode.  Here you can insert breakpoints, and be somewhat liberal in how your kernel is developed.
  * This mode _does not_ actually "compile" (parse, and eval) a kernel, it simply iterates on your code.
  * You can break a lot of rules here, because your kernel's function still has context of the state it came from.
  * PLEASE NOTE: Mapped kernels are not supported in this mode.  They simply cannot work because of context.
  * Example:
    ```js
    const gpu = new GPU({ mode: 'dev' });
    const kernel = gpu.createKernel(function(arg1, time) {
        // put a breakpoint on the next line, and watch it get hit
        const v = arg1[this.thread.y][this.thread.x * time];
        return v;
    }, { output: [100, 100] });
    ```
* Debugging actual kernels on CPU with `debugger`:
  * This will cause "breakpoint" like behaviour, but in an actual CPU kernel.  You'll peer into the compiled kernel here, for a CPU.
  * Example:
    ```js
    const gpu = new GPU({ mode: 'cpu' });
    const kernel = gpu.createKernel(function(arg1, time) {
        debugger; // <--NOTICE THIS, IMPORTANT!
        const v = arg1[this.thread.y][this.thread.x * time];
        return v;
    }, { output: [100, 100] });
    ```
* Debugging an actual GPU kernel:
  * There are no breakpoints available on the GPU, period.  By providing the same level of abstraction and logic, the above methods should give you enough insight to debug, but sometimes we just need to see what is on the GPU.
  * Be VERY specific and deliberate, and use the kernel to your advantage, rather than just getting frustrated or giving up.
  * Example:
    ```js
    const gpu = new GPU({ mode: 'cpu' });
    const kernel = gpu.createKernel(function(arg1, time) {
      const x = this.thread.x * time;
      return x; // <--NOTICE THIS, IMPORTANT!
      const v = arg1[this.thread.y][x];
      return v;
    }, { output: [100, 100] });
    ```
    In this example, we return early the value of x, to see exactly what it is.  The rest of the logic is ignored, but now you can see the value that is calculated from `x`, and debug it.
    This is an overly simplified problem.
  * Sometimes you need to solve graphical problems, that can be done similarly.
  * Example:
    ```js
    const gpu = new GPU({ mode: 'cpu' });
    const kernel = gpu.createKernel(function(arg1, time) {
      const x = this.thread.x * time;
      if (x < 4 || x > 2) {
        // RED
        this.color(1, 0, 0); // <--NOTICE THIS, IMPORTANT!
        return;
      }
      if (x > 6 && x < 12) {
        // GREEN
        this.color(0, 1, 0); // <--NOTICE THIS, IMPORTANT!
        return;
      }
      const v = arg1[this.thread.y][x];
      return v;
    }, { output: [100, 100], graphical: true });
    ```
    Here we are making the canvas red or green depending on the value of `x`.

## Accepting Input
### Supported Input Types
* Numbers
* 1d,2d, or 3d Array of numbers
  * Arrays of `Array`, `Float32Array`, `Int16Array`, `Int8Array`, `Uint16Array`, `uInt8Array`
* Pre-flattened 2d or 3d Arrays using 'Input', for faster upload of arrays
  * Example:
  ```js
  const { input } = require('gpu.js');
  const value = input(flattenedArray, [width, height, depth]);
  ```
* HTML Image
* Array of HTML Images
* Video Element **New in V2!**
To define an argument, simply add it to the kernel function like regular JavaScript.

### Input Examples
```js
const kernel = gpu.createKernel(function(x) {
    return x;
}).setOutput([100]);

kernel(42);
// Result: Float32Array[42, 42, 42, 42, ... 42]
```

Similarly, with array inputs:

```js
const kernel = gpu.createKernel(function(x) {
    return x[this.thread.x % 3];
}).setOutput([100]);

kernel([1, 2, 3]);
// Result: Float32Array[1, 2, 3, 1, ... 1 ]
```

An HTML Image:

```js
const kernel = gpu.createKernel(function(image) {
    const pixel = image[this.thread.y][this.thread.x];
    this.color(pixel[0], pixel[1], pixel[2], pixel[3]);
})
  .setGraphical(true)
  .setOutput([100, 100]);

const image = document.createElement('img');
image.src = 'my/image/source.png';
image.onload = () => {
  kernel(image);
  // Result: colorful image
  
  document.getElementsByTagName('body')[0].appendChild(kernel.canvas);
};
```

An Array of HTML Images:

```js
const kernel = gpu.createKernel(function(image) {
    const pixel = image[this.thread.z][this.thread.y][this.thread.x];
    this.color(pixel[0], pixel[1], pixel[2], pixel[3]);
})
  .setGraphical(true)
  .setOutput([100, 100]);

const image1 = document.createElement('img');
image1.src = 'my/image/source1.png';
image1.onload = onload;
const image2 = document.createElement('img');
image2.src = 'my/image/source2.png';
image2.onload = onload;
const image3 = document.createElement('img');
image3.src = 'my/image/source3.png';
image3.onload = onload;
const totalImages = 3;
let loadedImages = 0;
function onload() {
  loadedImages++;
  if (loadedImages === totalImages) {
    kernel([image1, image2, image3]);
    // Result: colorful image composed of many images

     document.getElementsByTagName('body')[0].appendChild(kernel.canvas);
  }
};
```

An HTML Video: **New in V2!**

```js
const kernel = gpu.createKernel(function(videoFrame) {
    const pixel = videoFrame[this.thread.y][this.thread.x];
    this.color(pixel[0], pixel[1], pixel[2], pixel[3]);
})
  .setGraphical(true)
  .setOutput([100, 100]);

const video = new document.createElement('video');
video.src = 'my/video/source.webm';
kernel(image); //note, try and use requestAnimationFrame, and the video should be ready or playing
// Result: video frame
```

## Graphical Output

Sometimes, you want to produce a `canvas` image instead of doing numeric computations. To achieve this, set the `graphical` flag to `true` and the output dimensions to `[width, height]`. The thread identifiers will now refer to the `x` and `y` coordinate of the pixel you are producing. Inside your kernel function, use `this.color(r,g,b)` or `this.color(r,g,b,a)` to specify the color of the pixel.

For performance reasons, the return value of your function will no longer be anything useful. Instead, to display the image, retrieve the `canvas` DOM node and insert it into your page.

```js
const render = gpu.createKernel(function() {
    this.color(0, 0, 0, 1);
})
  .setOutput([20, 20])
  .setGraphical(true);

render();

const canvas = render.canvas;
document.getElementsByTagName('body')[0].appendChild(canvas);
```

Note: To animate the rendering, use `requestAnimationFrame` instead of `setTimeout` for optimal performance. For more information, see [this](https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame).


### .getPixels() **New in V2!**
To make it easier to get pixels from a context, use `kernel.getPixels()`, which returns a flat array similar to what you get from WebGL's `readPixels` method.
A note on why: webgl's `readPixels` returns an array ordered differently from javascript's `getImageData`.
This makes them behave similarly.
While the values may be somewhat different, because of graphical precision available in the kernel, and alpha, this allows us to easily get pixel data in unified way.

Example:
```js
const render = gpu.createKernel(function() {
    this.color(0, 0, 0, 1);
})
  .setOutput([20, 20])
  .setGraphical(true);

render();
const pixels = render.getPixels();
// [r,g,b,a, r,g,b,a...
```

### Alpha

Currently, if you need alpha do something like enabling `premultipliedAlpha` with your own gl context:
```js
const canvas = DOM.canvas(500, 500);
const gl = canvas.getContext('webgl2', { premultipliedAlpha: false });

const gpu = new GPU({
  canvas,
  context: gl
});
const krender = gpu.createKernel(function(x) {
  this.color(this.thread.x / 500, this.thread.y / 500, x[0], x[1]);
})
  .setOutput([500, 500])
  .setGraphical(true);
 ```

## Combining kernels

Sometimes you want to do multiple math operations on the gpu without the round trip penalty of data transfer from cpu to gpu to cpu to gpu, etc.  To aid this there is the `combineKernels` method.
_**Note:**_ Kernels can have different output sizes.
```js
const add = gpu.createKernel(function(a, b) {
  return a[this.thread.x] + b[this.thread.x];
}).setOutput([20]);

const multiply = gpu.createKernel(function(a, b) {
  return a[this.thread.x] * b[this.thread.x];
}).setOutput([20]);

const superKernel = gpu.combineKernels(add, multiply, function(a, b, c) {
  return multiply(add(a, b), c);
});

superKernel(a, b, c);
```
This gives you the flexibility of using multiple transformations but without the performance penalty, resulting in a much much MUCH faster operation.

## Create Kernel Map

Sometimes you want to do multiple math operations in one kernel, and save the output of each of those operations. An example is **Machine Learning** where the previous output is required for back propagation. To aid this there is the `createKernelMap` method.

### object outputs
```js
const megaKernel = gpu.createKernelMap({
  addResult: function add(a, b) {
    return a + b;
  },
  multiplyResult: function multiply(a, b) {
    return a * b;
  },
}, function(a, b, c) {
  return multiply(add(a[this.thread.x], b[this.thread.x]), c[this.thread.x]);
}, { output: [10] });

megaKernel(a, b, c);
// Result: { addResult: Float32Array, multiplyResult: Float32Array, result: Float32Array }
```
### array outputs
```js
const megaKernel = gpu.createKernelMap([
  function add(a, b) {
    return a + b;
  },
  function multiply(a, b) {
    return a * b;
  }
], function(a, b, c) {
  return multiply(add(a[this.thread.x], b[this.thread.x]), c[this.thread.x]);
}, { output: [10] });

megaKernel(a, b, c);
// Result: { 0: Float32Array, 1: Float32Array, result: Float32Array }
```
This gives you the flexibility of using parts of a single transformation without the performance penalty, resulting in much much _MUCH_ faster operation.

## Adding custom functions
### To `GPU` instance
use `gpu.addFunction(function() {}, settings)` for adding custom functions to all kernels.  Needs to be called BEFORE `gpu.createKernel`. Example:


```js
gpu.addFunction(function mySuperFunction(a, b) {
  return a - b;
});
function anotherFunction(value) {
  return value + 1;
}
gpu.addFunction(anotherFunction);
const kernel = gpu.createKernel(function(a, b) {
  return anotherFunction(mySuperFunction(a[this.thread.x], b[this.thread.x]));
}).setOutput([20]);
```

### To `Kernel` instance
use `kernel.addFunction(function() {}, settings)` for adding custom functions to all kernels.  Example:


```js
kernel.addFunction(function mySuperFunction(a, b) {
  return a - b;
});
function anotherFunction(value) {
  return value + 1;
}
kernel.addFunction(anotherFunction);
const kernel = gpu.createKernel(function(a, b) {
  return anotherFunction(mySuperFunction(a[this.thread.x], b[this.thread.x]));
}).setOutput([20]);
```

### Adding strongly typed functions

To manually strongly type a function you may use settings.
By setting this value, it makes the build step of the kernel less resource intensive.
Settings take an optional hash values:
* `returnType`: optional, defaults to inference from `FunctionBuilder`, the value you'd like to return from the function.
* `argumentTypes`: optional, defaults to inference from `FunctionBuilder` for each param, a hash of param names with values of the return types.

Example on `GPU` instance:
```js
gpu.addFunction(function mySuperFunction(a, b) {
  return [a - b[1], b[0] - a];
}, { argumentTypes: { a: 'Number', b: 'Array(2)'}, returnType: 'Array(2)' });
```

Example on `Kernel` instance:
```js
kernel.addFunction(function mySuperFunction(a, b) {
  return [a - b[1], b[0] - a];
}, { argumentTypes: { a: 'Number', b: 'Array(2)'}, returnType: 'Array(2)' });
```

NOTE: GPU.js infers types if they are not defined and is generally able to detect the types you need, however
'Array(2)', 'Array(3)', and 'Array(4)' are exceptions, at least on the kernel level.  Also, it is nice to have power
over the automatic type inference system.

## Adding custom functions directly to kernel
```js
function mySuperFunction(a, b) {
  return a - b;
}
const kernel = gpu.createKernel(function(a, b) {
  return mySuperFunction(a[this.thread.x], b[this.thread.x]);
})
  .setOutput([20])
  .setFunctions([mySuperFunction]);

```


## Types
GPU.js does type inference when types are not defined, so even if you code weak type, you are typing strongly typed.
This is needed because c++, which glsl is a subset of, is, of course, strongly typed.
Types that can be used with GPU.js are as follows:

### Argument Types
* 'Array'
* 'Array(2)' **New in V2!**
* 'Array(3)' **New in V2!**
* 'Array(4)' **New in V2!**
* 'Array1D(2)' **New in V2!**
* 'Array1D(3)' **New in V2!**
* 'Array1D(4)' **New in V2!**
* 'Array2D(2)' **New in V2!**
* 'Array2D(3)' **New in V2!**
* 'Array2D(4)' **New in V2!**
* 'Array3D(2)' **New in V2!**
* 'Array3D(3)' **New in V2!**
* 'Array3D(4)' **New in V2!**
* 'HTMLCanvas' **New in V2.6**
* 'OffscreenCanvas' **New in V2.13**
* 'HTMLImage'
* 'ImageBitmap' **New in V2.14**
* 'ImageData' **New in V2.15**
* 'HTMLImageArray'
* 'HTMLVideo' **New in V2!**
* 'Number'
* 'Float'
* 'Integer'
* 'Boolean' **New in V2!**

### Return Types
NOTE: These refer the the return type of the kernel function, the actual result will always be a collection in the size of the defined `output`
* 'Array(2)'
* 'Array(3)'
* 'Array(4)'
* 'Number'
* 'Float'
* 'Integer'

### Internal Types
Types generally used in the `Texture` class, for #pipelining or for advanced usage.
* 'ArrayTexture(1)' **New in V2!**
* 'ArrayTexture(2)' **New in V2!**
* 'ArrayTexture(3)' **New in V2!**
* 'ArrayTexture(4)' **New in V2!**
* 'NumberTexture'
* 'MemoryOptimizedNumberTexture' **New in V2!**

## Loops
* Any loops defined inside the kernel must have a maximum iteration count defined by the loopMaxIterations setting.
* Other than defining the iterations by a constant or fixed value as shown [Dynamic sized via constants](dynamic-sized-via-constants), you can also simply pass the number of iterations as a variable to the kernel

### Dynamic sized via constants
```js
const matMult = gpu.createKernel(function(a, b) {
    var sum = 0;
    for (var i = 0; i < this.constants.size; i++) {
        sum += a[this.thread.y][i] * b[i][this.thread.x];
    }
    return sum;
}, {
  constants: { size: 512 },
  output: [512, 512],
});
```

### Fixed sized
```js
const matMult = gpu.createKernel(function(a, b) {
    var sum = 0;
    for (var i = 0; i < 512; i++) {
        sum += a[this.thread.y][i] * b[i][this.thread.x];
    }
    return sum;
}).setOutput([512, 512]);
```

## Pipelining
[Pipeline](https://en.wikipedia.org/wiki/Pipeline_(computing)) is a feature where values are sent directly from kernel to kernel via a texture.
This results in extremely fast computing.  This is achieved with the kernel setting `pipeline: boolean` or by calling `kernel.setPipeline(true)`
In an effort to make the CPU and GPU work similarly, pipeline on CPU and GPU modes causes the kernel result to be reused when `immutable: false` (which is default).
If you'd like to keep kernel results around, use `immutable: true` and ensure you cleanup memory:
* In gpu mode using `texture.delete()` when appropriate.
* In cpu mode allowing values to go out of context

### Cloning Textures **New in V2!**
When using pipeline mode the outputs from kernels can be cloned using `texture.clone()`.

```js
const kernel1 = gpu.createKernel(function(v) {
    return v[this.thread.x];
})
  .setPipeline(true)
  .setOutput([100]);

const kernel2 = gpu.createKernel(function(v) {
    return v[this.thread.x];
})
  .setOutput([100]);

const result1 = kernel1(array);
// Result: Texture
console.log(result1.toArray());
// Result: Float32Array[0, 1, 2, 3, ... 99]

const result2 = kernel2(result1);
// Result: Float32Array[0, 1, 2, 3, ... 99]
```

### Cleanup pipeline texture memory **New in V2.4!**
When using `kernel.immutable = true` recycling GPU memory is handled internally, but a good practice is to clean up memory you no longer need it.
Cleanup kernel outputs by using `texture.delete()` to keep GPU memory as small as possible.

NOTE: Internally textures will only release from memory if there are no references to them.
When using pipeline mode on a kernel `K` the output for each call will be a newly allocated texture `T`.
If, after getting texture `T` as an output, `T.delete()` is called, the next call to K will reuse `T` as its output texture.

Alternatively, if you'd like to clear out a `texture` and yet keep it in memory, you may use `texture.clear()`, which
will cause the `texture` to persist in memory, but its internal values to become all zeros.

## Offscreen Canvas
GPU.js supports offscreen canvas where available.  Here is an example of how to use it with two files, `gpu-worker.js`, and `index.js`:

file: `gpu-worker.js`
```js
importScripts('path/to/gpu.js');
onmessage = function() {
  // define gpu instance
  const gpu = new GPU();

  // input values
  const a = [1,2,3];
  const b = [3,2,1];

  // setup kernel
  const kernel = gpu.createKernel(function(a, b) {
    return a[this.thread.x] - b[this.thread.x];
  })
    .setOutput([3]);

  // output some results!
  postMessage(kernel(a, b));
};
```

file: `index.js`
```js
var worker = new Worker('gpu-worker.js');
worker.onmessage = function(e) {
  var result = e.data;
  console.log(result);
};
```

## Cleanup
* for instances of `GPU` use the `destroy` method.  Example: `gpu.destroy()`
* for instances of `Kernel` use the `destroy` method.  Example: `kernel.destroy()`
* for instances of `Texture` use the `delete` method. Example: `texture.delete()`
* for instances of `Texture` that you might want to reuse/reset to zeros, use the `clear` method. Example: `texture.clear()`

## Flattened typed array support
To use the useful `x`, `y`, `z` `thread` lookup api inside of GPU.js, and yet use flattened arrays, there is the `Input` type.
This is generally much faster for when sending values to the gpu, especially with larger data sets.  Usage example:
```js
const { GPU, input, Input } = require('gpu.js');
const gpu = new GPU();
const kernel = gpu.createKernel(function(a, b) {
  return a[this.thread.y][this.thread.x] + b[this.thread.y][this.thread.x];
}).setOutput([3,3]);


kernel(
  input(
    new Float32Array([1,2,3,4,5,6,7,8,9]),
    [3, 3]
  ),
  input(
    new Float32Array([1,2,3,4,5,6,7,8,9]),
    [3, 3]
  )
);
```

Note: `input(value, size)` is a simple pointer for `new Input(value, size)`

## Precompiled and Lighter Weight Kernels

### using JSON
GPU.js packs a lot of functionality into a single file, such as a complete javascript parse, which may not be needed in some cases.
To aid in keeping your kernels lightweight, the `kernel.toJSON()` method was added.
This allows you to reuse a previously built kernel, without the need to re-parse the javascript.
Here is an example:

```js
const gpu = new GPU();
const kernel = gpu.createKernel(function() {
  return [1,2,3,4];
}, { output: [1] });
console.log(kernel()); // [Float32Array([1,2,3,4])];
const json = kernel.toJSON();
const newKernelFromJson = gpu.createKernel(json);
console.log(newKernelFromJSON()); // [Float32Array([1,2,3,4])];
```

NOTE: There is lighter weight, pre-built, version of GPU.js to assist with serializing from to and from json in the dist folder of the project, which include:
* [dist/gpu-browser-core.js](dist/gpu-browser-core.js)
* [dist/gpu-browser-core.min.js](dist/gpu-browser-core.min.js)

### Exporting kernel
GPU.js supports seeing exactly how it is interacting with the graphics processor by means of the `kernel.toString(...)` method.
This method, when called, creates a kernel that executes _exactly the instruction set given to the GPU (or CPU)_ *as a
very tiny reusable function* that instantiates a kernel.

NOTE: When exporting a kernel and using `constants` the following constants are *not changeable*:
* `Array(2)`
* `Array(3)`
* `Array(4)`
* `Integer`
* `Number`
* `Float`
* `Boolean`

Here is an example used to/from file:
```js
import { GPU } from 'gpu.js';
import * as fs from 'fs';
const gpu = new GPU();
const kernel = gpu.createKernel(function(v) {
  return this.thread.x + v + this.constants.v1;
}, { output: [10], constants: { v1: 100 } });
const result = kernel(1);
const kernelString = kernel.toString(1);
fs.writeFileSync('./my-exported-kernel.js', 'module.exports = ' + kernelString);
import * as MyExportedKernel from './my-exported-kernel';
import gl from 'gl';
const myExportedKernel = MyExportedKernel({ context: gl(1,1), constants: { v1: 100 } });
```


Here is an example for just-in-time function creation:

```js
const gpu = new GPU();
const kernel = gpu.createKernel(function(a) {
  let sum = 0;
  for (let i = 0; i < 6; i++) {
    sum += a[this.thread.x][i];
  }
  return sum;
  }, { output: [6] });
kernel(input(a, [6, 6]));
const kernelString = kernel.toString(input(a, [6, 6]));
const newKernel = new Function('return ' + kernelString)()({ context });
newKernel(input(a, [6, 6]));
```

#### using constants with `kernel.toString(...args)`
You can assign _some_ new constants when using the function output from `.toString()`,

## Supported Math functions

Since the code running in the kernel is actually compiled to GLSL code, not all functions from the JavaScript Math module are supported.

This is a list of the supported ones:

* `Math.abs()`
* `Math.acos()`
* `Math.acosh()`
* `Math.asin()`
* `Math.asinh()`
* `Math.atan()`
* `Math.atanh()`
* `Math.atan2()`
* `Math.cbrt()`
* `Math.ceil()`
* `Math.cos()`
* `Math.cosh()`
* `Math.exp()`
* `Math.expm1()`
* `Math.floor()`
* `Math.fround()`
* `Math.imul()`
* `Math.log()`
* `Math.log10()`
* `Math.log1p()`
* `Math.log2()`
* `Math.max()`
* `Math.min()`
* `Math.pow()`
* `Math.random()`
  * A note on random.  We use [a plugin](src/plugins/math-random-uniformly-distributed.js) to generate random.
  Random seeded _and_ generated, _both from the GPU_, is not as good as random from the CPU as there are more things that the CPU can seed random from.
  However, we seed random on the GPU, _from a random value in the CPU_.
  We then seed the subsequent randoms from the previous random value.
  So we seed from CPU, and generate from GPU.
  Which is still not as good as CPU, but closer.
  While this isn't perfect, it should suffice in most scenarios.
  In any case, we must give thanks to [RandomPower](https://www.randompower.eu/), and this [issue](https://github.com/gpujs/gpu.js/issues/498), for assisting in improving our implementation of random.
* `Math.round()`
* `Math.sign()`
* `Math.sin()`
* `Math.sinh()`
* `Math.sqrt()`
* `Math.tan()`
* `Math.tanh()`
* `Math.trunc()`

This is a list and reasons of unsupported ones:
*  `Math.clz32` - bits directly are hard
*  `Math.hypot` - dynamically sized

## How to check what is supported

To assist with mostly unit tests, but perhaps in scenarios outside of GPU.js, there are the following logical checks to determine what support level the system executing a GPU.js kernel may have:
* `GPU.disableValidation()` - turn off all kernel validation
* `GPU.enableValidation()` - turn on all kernel validation
* `GPU.isGPUSupported`: `boolean` - checks if GPU is in-fact supported
* `GPU.isKernelMapSupported`: `boolean` - checks if kernel maps are supported
* `GPU.isOffscreenCanvasSupported`: `boolean` - checks if offscreen canvas is supported
* `GPU.isWebGLSupported`: `boolean` - checks if WebGL v1 is supported
* `GPU.isWebGL2Supported`: `boolean` - checks if WebGL v2 is supported
* `GPU.isHeadlessGLSupported`: `boolean` - checks if headlessgl is supported
* `GPU.isCanvasSupported`: `boolean` - checks if canvas is supported
* `GPU.isGPUHTMLImageArraySupported`: `boolean` - checks if the platform supports HTMLImageArray's
* `GPU.isSinglePrecisionSupported`: `boolean` - checks if the system supports single precision float 32 values

## Typescript Typings
Typescript is supported!  Typings can be found [here](src/index.d.ts)!
For strongly typed kernels:
```typescript
import { GPU, IKernelFunctionThis } from 'gpu.js';
const gpu = new GPU();

function kernelFunction(this: IKernelFunctionThis): number {
  return 1 + this.thread.x;
}

const kernelMap = gpu.createKernel<typeof kernelFunction>(kernelFunction)
  .setOutput([3,3,3]);

const result = kernelMap();

console.log(result as number[][][]);
```

For strongly typed mapped kernels:
```typescript
import { GPU, Texture, IKernelFunctionThis } from 'gpu.js';
const gpu = new GPU();

function kernelFunction(this: IKernelFunctionThis): [number, number] {
  return [1, 1];
}

function subKernel(): [number, number] {
  return [1, 1];
}

const kernelMap = gpu.createKernelMap<typeof kernelFunction>({
  test: subKernel,
}, kernelFunction)
  .setOutput([1])
  .setPipeline(true);

const result = kernelMap();

console.log((result.test as Texture).toArray() as [number, number][]);
```

For extending constants:
```typescript
import { GPU, IKernelFunctionThis } from 'gpu.js';
const gpu = new GPU();

interface IConstants {
  screen: [number, number];
}

type This = {
  constants: IConstants
} & IKernelFunctionThis;

function kernelFunction(this: This): number {
  const { screen } = this.constants;
  return 1 + screen[0];
}

const kernelMap = gpu.createKernel<typeof kernelFunction>(kernelFunction)
  .setOutput([3,3,3])
  .setConstants<IConstants>({
    screen: [1, 1]
  });

const result = kernelMap();

console.log(result as number[][][]);
```

[Click here](/examples) for more typescript examples.

## Destructured Assignments **New in V2!**
Destructured Objects and Arrays work in GPU.js.
* Object destructuring
  ```js
  const gpu = new GPU();
  const kernel = gpu.createKernel(function() {
    const { thread: {x, y} } = this;
    return x + y;
  }, { output: [2] });
  console.log(kernel());
  ```
* Array destructuring
  ```js
  const gpu = new GPU();
  const kernel = gpu.createKernel(function(array) {
    const [first, second] = array;
    return first + second; 
  }, {
    output: [2],
    argumentTypes: { array: 'Array(2)' }
  });
  console.log(kernel([1, 2]));
  ```

## Dealing With Transpilation
Transpilation doesn't do the best job of keeping code beautiful.  To aid in this endeavor GPU.js can handle some scenarios to still aid you harnessing the GPU in less than ideal circumstances.
Here is a list of a few things that GPU.js does to fix transpilation:

* When a transpiler such as [Babel](https://babeljs.io/) changes `myCall()` to `(0, _myCall.myCall)`, it is gracefully handled.

## Full API Reference

You can find a [complete API reference here](https://doxdox.org/gpujs/gpu.js/).

## How possible in node?
GPU.js uses [HeadlessGL](https://github.com/stackgl/headless-gl) in node for GPU acceleration.
GPU.js is written in such a way, you can introduce your own backend.  Have a suggestion?  We'd love to hear it!

## Terms Explained
* Kernel - A function that is tightly coupled to program that runs on the Graphic Processor
* Texture - A graphical artifact that is packed with data, in the case of GPU.js, bit shifted parts of a 32 bit floating point decimal

## Testing
Testing is done (right now) manually, (help wanted [here](https://github.com/gpujs/gpu.js/issues/515) if you can!), using the following:
* For browser, setup a webserver on the root of the gpu.js project and visit http://url/test/all.html
* For node, run either of the 3 commands:
  * `yarn test test/features`
  * `yarn test test/internal`
  * `yarn test test/issues`

## Building
Building isn't required on node, but is for browser.  To build the browser's files, run: `yarn make`

# Get Involved!

## Contributing

Contributors are welcome! Create a merge request to the `develop` branch and we
will gladly review it. If you wish to get write access to the repository,
please email us and we will review your application and grant you access to
the `develop` branch.

We promise never to pass off your code as ours.

### Issues

If you have an issue, either a bug or a feature you think would benefit your project let us know and we will do our best.

Create issues [here](https://github.com/gpujs/gpu.js/issues) and follow the template.

### Contributors

This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
<a href="https://github.com/gpujs/gpu.js/graphs/contributors"><img src="https://opencollective.com/gpujs/contributors.svg?width=890&button=false" /></a>


### Backers

Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/gpujs#backer)]

<a href="https://opencollective.com/gpujs#backers" target="_blank"><img src="https://opencollective.com/gpujs/backers.svg?width=890"></a>


### Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/gpujs#sponsor)]

![](https://www.leadergpu.com/assets/main/logo_leadergpu-a8cacac0c90d204b7f7f6c8420c6a149e71ebe53f3f28f3fc94a01cd05c0bd93.png)
Sponsored NodeJS GPU environment from [LeaderGPU](https://www.leadergpu.com) - These guys rock!

![](https://3fxtqy18kygf3on3bu39kh93-wpengine.netdna-ssl.com/wp-content/themes/browserstack/img/browserstack-logo.svg)
Sponsored Browser GPU environment's from [BrowserStack](https://browserstack.com) - Second to none!

<a href="https://opencollective.com/gpujs/sponsor/0/website" target="_blank"><img src="https://opencollective.com/gpujs/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/gpujs/sponsor/1/website" target="_blank"><img src="https://opencollective.com/gpujs/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/gpujs/sponsor/2/website" target="_blank"><img src="https://opencollective.com/gpujs/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/gpujs/sponsor/3/website" target="_blank"><img src="https://opencollective.com/gpujs/sponsor/3/avatar.svg"></a>
<a href="https://opencollective.com/gpujs/sponsor/4/website" target="_blank"><img src="https://opencollective.com/gpujs/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/gpujs/sponsor/5/website" target="_blank"><img src="https://opencollective.com/gpujs/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/gpujs/sponsor/6/website" target="_blank"><img src="https://opencollective.com/gpujs/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/gpujs/sponsor/7/website" target="_blank"><img src="https://opencollective.com/gpujs/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/gpujs/sponsor/8/website" target="_blank"><img src="https://opencollective.com/gpujs/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/gpujs/sponsor/9/website" target="_blank"><img src="https://opencollective.com/gpujs/sponsor/9/avatar.svg"></a>

## [License](LICENSE)


================================================
FILE: dist/gpu-browser-core.js
================================================
/**
 * gpu.js
 * http://gpu.rocks/
 *
 * GPU Accelerated JavaScript
 *
 * @version 2.16.0
 * @date Thu Feb 13 2025 11:46:48 GMT-0800 (Pacific Standard Time)
 *
 * @license MIT
 * The MIT License
 *
 * Copyright (c) 2025 gpu.js Team
 */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.GPU = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){

},{}],2:[function(require,module,exports){
function glWiretap(gl, options = {}) {
  const {
    contextName = 'gl',
    throwGetError,
    useTrackablePrimitives,
    readPixelsFile,
    recording = [],
    variables = {},
    onReadPixels,
    onUnrecognizedArgumentLookup,
  } = options;
  const proxy = new Proxy(gl, { get: listen });
  const contextVariables = [];
  const entityNames = {};
  let imageCount = 0;
  let indent = '';
  let readPixelsVariableName;
  return proxy;
  function listen(obj, property) {
    switch (property) {
      case 'addComment': return addComment;
      case 'checkThrowError': return checkThrowError;
      case 'getReadPixelsVariableName': return readPixelsVariableName;
      case 'insertVariable': return insertVariable;
      case 'reset': return reset;
      case 'setIndent': return setIndent;
      case 'toString': return toString;
      case 'getContextVariableName': return getContextVariableName;
    }
    if (typeof gl[property] === 'function') {
      return function() { 
        switch (property) {
          case 'getError':
            if (throwGetError) {
              recording.push(`${indent}if (${contextName}.getError() !== ${contextName}.NONE) throw new Error('error');`);
            } else {
              recording.push(`${indent}${contextName}.getError();`); 
            }
            return gl.getError();
          case 'getExtension': {
            const variableName = `${contextName}Variables${contextVariables.length}`;
            recording.push(`${indent}const ${variableName} = ${contextName}.getExtension('${arguments[0]}');`);
            const extension = gl.getExtension(arguments[0]);
            if (extension && typeof extension === 'object') {
              const tappedExtension = glExtensionWiretap(extension, {
                getEntity,
                useTrackablePrimitives,
                recording,
                contextName: variableName,
                contextVariables,
                variables,
                indent,
                onUnrecognizedArgumentLookup,
              });
              contextVariables.push(tappedExtension);
              return tappedExtension;
            } else {
              contextVariables.push(null);
            }
            return extension;
          }
          case 'readPixels':
            const i = contextVariables.indexOf(arguments[6]);
            let targetVariableName;
            if (i === -1) {
              const variableName = getVariableName(arguments[6]);
              if (variableName) {
                targetVariableName = variableName;
                recording.push(`${indent}${variableName}`);
              } else {
                targetVariableName = `${contextName}Variable${contextVariables.length}`;
                contextVariables.push(arguments[6]);
                recording.push(`${indent}const ${targetVariableName} = new ${arguments[6].constructor.name}(${arguments[6].length});`);
              }
            } else {
              targetVariableName = `${contextName}Variable${i}`;
            }
            readPixelsVariableName = targetVariableName;
            const argumentAsStrings = [
              arguments[0],
              arguments[1],
              arguments[2],
              arguments[3],
              getEntity(arguments[4]),
              getEntity(arguments[5]),
              targetVariableName
            ];
            recording.push(`${indent}${contextName}.readPixels(${argumentAsStrings.join(', ')});`);
            if (readPixelsFile) {
              writePPM(arguments[2], arguments[3]);
            }
            if (onReadPixels) {
              onReadPixels(targetVariableName, argumentAsStrings);
            }
            return gl.readPixels.apply(gl, arguments);
          case 'drawBuffers':
            recording.push(`${indent}${contextName}.drawBuffers([${argumentsToString(arguments[0], { contextName, contextVariables, getEntity, addVariable, variables, onUnrecognizedArgumentLookup } )}]);`);
            return gl.drawBuffers(arguments[0]);
        }
        let result = gl[property].apply(gl, arguments);
        switch (typeof result) {
          case 'undefined':
            recording.push(`${indent}${methodCallToString(property, arguments)};`);
            return;
          case 'number':
          case 'boolean':
            if (useTrackablePrimitives && contextVariables.indexOf(trackablePrimitive(result)) === -1) {
              recording.push(`${indent}const ${contextName}Variable${contextVariables.length} = ${methodCallToString(property, arguments)};`);
              contextVariables.push(result = trackablePrimitive(result));
              break;
            }
          default:
            if (result === null) {
              recording.push(`${methodCallToString(property, arguments)};`);
            } else {
              recording.push(`${indent}const ${contextName}Variable${contextVariables.length} = ${methodCallToString(property, arguments)};`);
            }

            contextVariables.push(result);
        }
        return result;
      }
    }
    entityNames[gl[property]] = property;
    return gl[property];
  }
  function toString() {
    return recording.join('\n');
  }
  function reset() {
    while (recording.length > 0) {
      recording.pop();
    }
  }
  function insertVariable(name, value) {
    variables[name] = value;
  }
  function getEntity(value) {
    const name = entityNames[value];
    if (name) {
      return contextName + '.' + name;
    }
    return value;
  }
  function setIndent(spaces) {
    indent = ' '.repeat(spaces);
  }
  function addVariable(value, source) {
    const variableName = `${contextName}Variable${contextVariables.length}`;
    recording.push(`${indent}const ${variableName} = ${source};`);
    contextVariables.push(value);
    return variableName;
  }
  function writePPM(width, height) {
    const sourceVariable = `${contextName}Variable${contextVariables.length}`;
    const imageVariable = `imageDatum${imageCount}`;
    recording.push(`${indent}let ${imageVariable} = ["P3\\n# ${readPixelsFile}.ppm\\n", ${width}, ' ', ${height}, "\\n255\\n"].join("");`);
    recording.push(`${indent}for (let i = 0; i < ${imageVariable}.length; i += 4) {`);
    recording.push(`${indent}  ${imageVariable} += ${sourceVariable}[i] + ' ' + ${sourceVariable}[i + 1] + ' ' + ${sourceVariable}[i + 2] + ' ';`);
    recording.push(`${indent}}`);
    recording.push(`${indent}if (typeof require !== "undefined") {`);
    recording.push(`${indent}  require('fs').writeFileSync('./${readPixelsFile}.ppm', ${imageVariable});`);
    recording.push(`${indent}}`);
    imageCount++;
  }
  function addComment(value) {
    recording.push(`${indent}// ${value}`);
  }
  function checkThrowError() {
    recording.push(`${indent}(() => {
${indent}const error = ${contextName}.getError();
${indent}if (error !== ${contextName}.NONE) {
${indent}  const names = Object.getOwnPropertyNames(gl);
${indent}  for (let i = 0; i < names.length; i++) {
${indent}    const name = names[i];
${indent}    if (${contextName}[name] === error) {
${indent}      throw new Error('${contextName} threw ' + name);
${indent}    }
${indent}  }
${indent}}
${indent}})();`);
  }
  function methodCallToString(method, args) {
    return `${contextName}.${method}(${argumentsToString(args, { contextName, contextVariables, getEntity, addVariable, variables, onUnrecognizedArgumentLookup })})`;
  }

  function getVariableName(value) {
    if (variables) {
      for (const name in variables) {
        if (variables[name] === value) {
          return name;
        }
      }
    }
    return null;
  }

  function getContextVariableName(value) {
    const i = contextVariables.indexOf(value);
    if (i !== -1) {
      return `${contextName}Variable${i}`;
    }
    return null;
  }
}

function glExtensionWiretap(extension, options) {
  const proxy = new Proxy(extension, { get: listen });
  const extensionEntityNames = {};
  const {
    contextName,
    contextVariables,
    getEntity,
    useTrackablePrimitives,
    recording,
    variables,
    indent,
    onUnrecognizedArgumentLookup,
  } = options;
  return proxy;
  function listen(obj, property) {
    if (typeof obj[property] === 'function') {
      return function() {
        switch (property) {
          case 'drawBuffersWEBGL':
            recording.push(`${indent}${contextName}.drawBuffersWEBGL([${argumentsToString(arguments[0], { contextName, contextVariables, getEntity: getExtensionEntity, addVariable, variables, onUnrecognizedArgumentLookup })}]);`);
            return extension.drawBuffersWEBGL(arguments[0]);
        }
        let result = extension[property].apply(extension, arguments);
        switch (typeof result) {
          case 'undefined':
            recording.push(`${indent}${methodCallToString(property, arguments)};`);
            return;
          case 'number':
          case 'boolean':
            if (useTrackablePrimitives && contextVariables.indexOf(trackablePrimitive(result)) === -1) {
              recording.push(`${indent}const ${contextName}Variable${contextVariables.length} = ${methodCallToString(property, arguments)};`);
              contextVariables.push(result = trackablePrimitive(result));
            } else {
              recording.push(`${indent}const ${contextName}Variable${contextVariables.length} = ${methodCallToString(property, arguments)};`);
              contextVariables.push(result);
            }
            break;
          default:
            if (result === null) {
              recording.push(`${methodCallToString(property, arguments)};`);
            } else {
              recording.push(`${indent}const ${contextName}Variable${contextVariables.length} = ${methodCallToString(property, arguments)};`);
            }
            contextVariables.push(result);
        }
        return result;
      };
    }
    extensionEntityNames[extension[property]] = property;
    return extension[property];
  }

  function getExtensionEntity(value) {
    if (extensionEntityNames.hasOwnProperty(value)) {
      return `${contextName}.${extensionEntityNames[value]}`;
    }
    return getEntity(value);
  }

  function methodCallToString(method, args) {
    return `${contextName}.${method}(${argumentsToString(args, { contextName, contextVariables, getEntity: getExtensionEntity, addVariable, variables, onUnrecognizedArgumentLookup })})`;
  }

  function addVariable(value, source) {
    const variableName = `${contextName}Variable${contextVariables.length}`;
    contextVariables.push(value);
    recording.push(`${indent}const ${variableName} = ${source};`);
    return variableName;
  }
}

function argumentsToString(args, options) {
  const { variables, onUnrecognizedArgumentLookup } = options;
  return (Array.from(args).map((arg) => {
    const variableName = getVariableName(arg);
    if (variableName) {
      return variableName;
    }
    return argumentToString(arg, options);
  }).join(', '));

  function getVariableName(value) {
    if (variables) {
      for (const name in variables) {
        if (!variables.hasOwnProperty(name)) continue;
        if (variables[name] === value) {
          return name;
        }
      }
    }
    if (onUnrecognizedArgumentLookup) {
      return onUnrecognizedArgumentLookup(value);
    }
    return null;
  }
}

function argumentToString(arg, options) {
  const { contextName, contextVariables, getEntity, addVariable, onUnrecognizedArgumentLookup } = options;
  if (typeof arg === 'undefined') {
    return 'undefined';
  }
  if (arg === null) {
    return 'null';
  }
  const i = contextVariables.indexOf(arg);
  if (i > -1) {
    return `${contextName}Variable${i}`;
  }
  switch (arg.constructor.name) {
    case 'String':
      const hasLines = /\n/.test(arg);
      const hasSingleQuotes = /'/.test(arg);
      const hasDoubleQuotes = /"/.test(arg);
      if (hasLines) {
        return '`' + arg + '`';
      } else if (hasSingleQuotes && !hasDoubleQuotes) {
        return '"' + arg + '"';
      } else if (!hasSingleQuotes && hasDoubleQuotes) {
        return "'" + arg + "'";
      } else {
        return '\'' + arg + '\'';
      }
    case 'Number': return getEntity(arg);
    case 'Boolean': return getEntity(arg);
    case 'Array':
      return addVariable(arg, `new ${arg.constructor.name}([${Array.from(arg).join(',')}])`);
    case 'Float32Array':
    case 'Uint8Array':
    case 'Uint16Array':
    case 'Int32Array':
      return addVariable(arg, `new ${arg.constructor.name}(${JSON.stringify(Array.from(arg))})`);
    default:
      if (onUnrecognizedArgumentLookup) {
        const instantiationString = onUnrecognizedArgumentLookup(arg);
        if (instantiationString) {
          return instantiationString;
        }
      }
      throw new Error(`unrecognized argument type ${arg.constructor.name}`);
  }
}

function trackablePrimitive(value) {
  return new value.constructor(value);
}

if (typeof module !== 'undefined') {
  module.exports = { glWiretap, glExtensionWiretap };
}

if (typeof window !== 'undefined') {
  glWiretap.glExtensionWiretap = glExtensionWiretap;
  window.glWiretap = glWiretap;
}

},{}],3:[function(require,module,exports){
function setupArguments(args) {
  const newArguments = new Array(args.length);
  for (let i = 0; i < args.length; i++) {
    const arg = args[i];
    if (arg.toArray) {
      newArguments[i] = arg.toArray();
    } else {
      newArguments[i] = arg;
    }
  }
  return newArguments;
}

function mock1D() {
  const args = setupArguments(arguments);
  const row = new Float32Array(this.output.x);
  for (let x = 0; x < this.output.x; x++) {
    this.thread.x = x;
    this.thread.y = 0;
    this.thread.z = 0;
    row[x] = this._fn.apply(this, args);
  }
  return row;
}

function mock2D() {
  const args = setupArguments(arguments);
  const matrix = new Array(this.output.y);
  for (let y = 0; y < this.output.y; y++) {
    const row = new Float32Array(this.output.x);
    for (let x = 0; x < this.output.x; x++) {
      this.thread.x = x;
      this.thread.y = y;
      this.thread.z = 0;
      row[x] = this._fn.apply(this, args);
    }
    matrix[y] = row;
  }
  return matrix;
}

function mock2DGraphical() {
  const args = setupArguments(arguments);
  for (let y = 0; y < this.output.y; y++) {
    for (let x = 0; x < this.output.x; x++) {
      this.thread.x = x;
      this.thread.y = y;
      this.thread.z = 0;
      this._fn.apply(this, args);
    }
  }
}

function mock3D() {
  const args = setupArguments(arguments);
  const cube = new Array(this.output.z);
  for (let z = 0; z < this.output.z; z++) {
    const matrix = new Array(this.output.y);
    for (let y = 0; y < this.output.y; y++) {
      const row = new Float32Array(this.output.x);
      for (let x = 0; x < this.output.x; x++) {
        this.thread.x = x;
        this.thread.y = y;
        this.thread.z = z;
        row[x] = this._fn.apply(this, args);
      }
      matrix[y] = row;
    }
    cube[z] = matrix;
  }
  return cube;
}

function apiDecorate(kernel) {
  kernel.setOutput = (output) => {
    kernel.output = setupOutput(output);
    if (kernel.graphical) {
      setupGraphical(kernel);
    }
  };
  kernel.toJSON = () => {
    throw new Error('Not usable with gpuMock');
  };
  kernel.setConstants = (flag) => {
    kernel.constants = flag;
    return kernel;
  };
  kernel.setGraphical = (flag) => {
    kernel.graphical = flag;
    return kernel;
  };
  kernel.setCanvas = (flag) => {
    kernel.canvas = flag;
    return kernel;
  };
  kernel.setContext = (flag) => {
    kernel.context = flag;
    return kernel;
  };
  kernel.destroy = () => {};
  kernel.validateSettings = () => {};
  if (kernel.graphical && kernel.output) {
    setupGraphical(kernel);
  }
  kernel.exec = function() {
    return new Promise((resolve, reject) => {
      try {
        resolve(kernel.apply(kernel, arguments));
      } catch(e) {
        reject(e);
      }
    });
  };
  kernel.getPixels = (flip) => {
    const {x, y} = kernel.output;
    return flip ? flipPixels(kernel._imageData.data, x, y) : kernel._imageData.data.slice(0);
  };
  kernel.color = function(r, g, b, a) {
    if (typeof a === 'undefined') {
      a = 1;
    }

    r = Math.floor(r * 255);
    g = Math.floor(g * 255);
    b = Math.floor(b * 255);
    a = Math.floor(a * 255);

    const width = kernel.output.x;
    const height = kernel.output.y;

    const x = kernel.thread.x;
    const y = height - kernel.thread.y - 1;

    const index = x + y * width;

    kernel._colorData[index * 4 + 0] = r;
    kernel._colorData[index * 4 + 1] = g;
    kernel._colorData[index * 4 + 2] = b;
    kernel._colorData[index * 4 + 3] = a;
  };

  const mockMethod = () => kernel;
  const methods = [
    'setWarnVarUsage',
    'setArgumentTypes',
    'setTactic',
    'setOptimizeFloatMemory',
    'setDebug',
    'setLoopMaxIterations',
    'setConstantTypes',
    'setFunctions',
    'setNativeFunctions',
    'setInjectedNative',
    'setPipeline',
    'setPrecision',
    'setOutputToTexture',
    'setImmutable',
    'setStrictIntegers',
    'setDynamicOutput',
    'setHardcodeConstants',
    'setDynamicArguments',
    'setUseLegacyEncoder',
    'setWarnVarUsage',
    'addSubKernel',
  ];
  for (let i = 0; i < methods.length; i++) {
    kernel[methods[i]] = mockMethod;
  }
  return kernel;
}

function setupGraphical(kernel) {
  const {x, y} = kernel.output;
  if (kernel.context && kernel.context.createImageData) {
    const data = new Uint8ClampedArray(x * y * 4);
    kernel._imageData = kernel.context.createImageData(x, y);
    kernel._colorData = data;
  } else {
    const data = new Uint8ClampedArray(x * y * 4);
    kernel._imageData = { data };
    kernel._colorData = data;
  }
}

function setupOutput(output) {
  let result = null;
  if (output.length) {
    if (output.length === 3) {
      const [x,y,z] = output;
      result = { x, y, z };
    } else if (output.length === 2) {
      const [x,y] = output;
      result = { x, y };
    } else {
      const [x] = output;
      result = { x };
    }
  } else {
    result = output;
  }
  return result;
}

function gpuMock(fn, settings = {}) {
  const output = settings.output ? setupOutput(settings.output) : null;
  function kernel() {
    if (kernel.output.z) {
      return mock3D.apply(kernel, arguments);
    } else if (kernel.output.y) {
      if (kernel.graphical) {
        return mock2DGraphical.apply(kernel, arguments);
      }
      return mock2D.apply(kernel, arguments);
    } else {
      return mock1D.apply(kernel, arguments);
    }
  }
  kernel._fn = fn;
  kernel.constants = settings.constants || null;
  kernel.context = settings.context || null;
  kernel.canvas = settings.canvas || null;
  kernel.graphical = settings.graphical || false;
  kernel._imageData = null;
  kernel._colorData = null;
  kernel.output = output;
  kernel.thread = {
    x: 0,
    y: 0,
    z: 0
  };
  return apiDecorate(kernel);
}

function flipPixels(pixels, width, height) {
  const halfHeight = height / 2 | 0; 
  const bytesPerRow = width * 4;
  const temp = new Uint8ClampedArray(width * 4);
  const result = pixels.slice(0);
  for (let y = 0; y < halfHeight; ++y) {
    const topOffset = y * bytesPerRow;
    const bottomOffset = (height - y - 1) * bytesPerRow;

    temp.set(result.subarray(topOffset, topOffset + bytesPerRow));

    result.copyWithin(topOffset, bottomOffset, bottomOffset + bytesPerRow);

    result.set(temp, bottomOffset);
  }
  return result;
}

module.exports = {
  gpuMock
};

},{}],4:[function(require,module,exports){
const { utils } = require('./utils');

function alias(name, source) {
  const fnString = source.toString();
  return new Function(`return function ${ name } (${ utils.getArgumentNamesFromString(fnString).join(', ') }) {
  ${ utils.getFunctionBodyFromString(fnString) }
}`)();
}

module.exports = {
  alias
};
},{"./utils":113}],5:[function(require,module,exports){
const { FunctionNode } = require('../function-node');

class CPUFunctionNode extends FunctionNode {
  astFunction(ast, retArr) {

    if (!this.isRootKernel) {
      retArr.push('function');
      retArr.push(' ');
      retArr.push(this.name);
      retArr.push('(');

      for (let i = 0; i < this.argumentNames.length; ++i) {
        const argumentName = this.argumentNames[i];

        if (i > 0) {
          retArr.push(', ');
        }
        retArr.push('user_');
        retArr.push(argumentName);
      }

      retArr.push(') {\n');
    }

    for (let i = 0; i < ast.body.body.length; ++i) {
      this.astGeneric(ast.body.body[i], retArr);
      retArr.push('\n');
    }

    if (!this.isRootKernel) {
      retArr.push('}\n');
    }
    return retArr;
  }

  astReturnStatement(ast, retArr) {
    const type = this.returnType || this.getType(ast.argument);

    if (!this.returnType) {
      this.returnType = type;
    }

    if (this.isRootKernel) {
      retArr.push(this.leadingReturnStatement);
      this.astGeneric(ast.argument, retArr);
      retArr.push(';\n');
      retArr.push(this.followingReturnStatement);
      retArr.push('continue;\n');
    } else if (this.isSubKernel) {
      retArr.push(`subKernelResult_${ this.name } = `);
      this.astGeneric(ast.argument, retArr);
      retArr.push(';');
      retArr.push(`return subKernelResult_${ this.name };`);
    } else {
      retArr.push('return ');
      this.astGeneric(ast.argument, retArr);
      retArr.push(';');
    }
    return retArr;
  }

  astLiteral(ast, retArr) {

    if (isNaN(ast.value)) {
      throw this.astErrorOutput(
        'Non-numeric literal not supported : ' + ast.value,
        ast
      );
    }

    retArr.push(ast.value);

    return retArr;
  }

  astBinaryExpression(ast, retArr) {
    retArr.push('(');
    this.astGeneric(ast.left, retArr);
    retArr.push(ast.operator);
    this.astGeneric(ast.right, retArr);
    retArr.push(')');
    return retArr;
  }

  astIdentifierExpression(idtNode, retArr) {
    if (idtNode.type !== 'Identifier') {
      throw this.astErrorOutput(
        'IdentifierExpression - not an Identifier',
        idtNode
      );
    }

    switch (idtNode.name) {
      case 'Infinity':
        retArr.push('Infinity');
        break;
      default:
        if (this.constants && this.constants.hasOwnProperty(idtNode.name)) {
          retArr.push('constants_' + idtNode.name);
        } else {
          retArr.push('user_' + idtNode.name);
        }
    }

    return retArr;
  }

  astForStatement(forNode, retArr) {
    if (forNode.type !== 'ForStatement') {
      throw this.astErrorOutput('Invalid for statement', forNode);
    }

    const initArr = [];
    const testArr = [];
    const updateArr = [];
    const bodyArr = [];
    let isSafe = null;

    if (forNode.init) {
      this.pushState('in-for-loop-init');
      this.astGeneric(forNode.init, initArr);
      for (let i = 0; i < initArr.length; i++) {
        if (initArr[i].includes && initArr[i].includes(',')) {
          isSafe = false;
        }
      }
      this.popState('in-for-loop-init');
    } else {
      isSafe = false;
    }

    if (forNode.test) {
      this.astGeneric(forNode.test, testArr);
    } else {
      isSafe = false;
    }

    if (forNode.update) {
      this.astGeneric(forNode.update, updateArr);
    } else {
      isSafe = false;
    }

    if (forNode.body) {
      this.pushState('loop-body');
      this.astGeneric(forNode.body, bodyArr);
      this.popState('loop-body');
    }

    if (isSafe === null) {
      isSafe = this.isSafe(forNode.init) && this.isSafe(forNode.test);
    }

    if (isSafe) {
      retArr.push(`for (${initArr.join('')};${testArr.join('')};${updateArr.join('')}){\n`);
      retArr.push(bodyArr.join(''));
      retArr.push('}\n');
    } else {
      const iVariableName = this.getInternalVariableName('safeI');
      if (initArr.length > 0) {
        retArr.push(initArr.join(''), ';\n');
      }
      retArr.push(`for (let ${iVariableName}=0;${iVariableName}<LOOP_MAX;${iVariableName}++){\n`);
      if (testArr.length > 0) {
        retArr.push(`if (!${testArr.join('')}) break;\n`);
      }
      retArr.push(bodyArr.join(''));
      retArr.push(`\n${updateArr.join('')};`);
      retArr.push('}\n');
    }
    return retArr;
  }

  astWhileStatement(whileNode, retArr) {
    if (whileNode.type !== 'WhileStatement') {
      throw this.astErrorOutput(
        'Invalid while statement',
        whileNode
      );
    }

    retArr.push('for (let i = 0; i < LOOP_MAX; i++) {');
    retArr.push('if (');
    this.astGeneric(whileNode.test, retArr);
    retArr.push(') {\n');
    this.astGeneric(whileNode.body, retArr);
    retArr.push('} else {\n');
    retArr.push('break;\n');
    retArr.push('}\n');
    retArr.push('}\n');

    return retArr;
  }

  astDoWhileStatement(doWhileNode, retArr) {
    if (doWhileNode.type !== 'DoWhileStatement') {
      throw this.astErrorOutput(
        'Invalid while statement',
        doWhileNode
      );
    }

    retArr.push('for (let i = 0; i < LOOP_MAX; i++) {');
    this.astGeneric(doWhileNode.body, retArr);
    retArr.push('if (!');
    this.astGeneric(doWhileNode.test, retArr);
    retArr.push(') {\n');
    retArr.push('break;\n');
    retArr.push('}\n');
    retArr.push('}\n');

    return retArr;

  }

  astAssignmentExpression(assNode, retArr) {
    const declaration = this.getDeclaration(assNode.left);
    if (declaration && !declaration.assignable) {
      throw this.astErrorOutput(`Variable ${assNode.left.name} is not assignable here`, assNode);
    }
    this.astGeneric(assNode.left, retArr);
    retArr.push(assNode.operator);
    this.astGeneric(assNode.right, retArr);
    return retArr;
  }

  astBlockStatement(bNode, retArr) {
    if (this.isState('loop-body')) {
      this.pushState('block-body'); 
      for (let i = 0; i < bNode.body.length; i++) {
        this.astGeneric(bNode.body[i], retArr);
      }
      this.popState('block-body');
    } else {
      retArr.push('{\n');
      for (let i = 0; i < bNode.body.length; i++) {
        this.astGeneric(bNode.body[i], retArr);
      }
      retArr.push('}\n');
    }
    return retArr;
  }

  astVariableDeclaration(varDecNode, retArr) {
    retArr.push(`${varDecNode.kind} `);
    const { declarations } = varDecNode;
    for (let i = 0; i < declarations.length; i++) {
      if (i > 0) {
        retArr.push(',');
      }
      const declaration = declarations[i];
      const info = this.getDeclaration(declaration.id);
      if (!info.valueType) {
        info.valueType = this.getType(declaration.init);
      }
      this.astGeneric(declaration, retArr);
    }
    if (!this.isState('in-for-loop-init')) {
      retArr.push(';');
    }
    return retArr;
  }

  astIfStatement(ifNode, retArr) {
    retArr.push('if (');
    this.astGeneric(ifNode.test, retArr);
    retArr.push(')');
    if (ifNode.consequent.type === 'BlockStatement') {
      this.astGeneric(ifNode.consequent, retArr);
    } else {
      retArr.push(' {\n');
      this.astGeneric(ifNode.consequent, retArr);
      retArr.push('\n}\n');
    }

    if (ifNode.alternate) {
      retArr.push('else ');
      if (ifNode.alternate.type === 'BlockStatement' || ifNode.alternate.type === 'IfStatement') {
        this.astGeneric(ifNode.alternate, retArr);
      } else {
        retArr.push(' {\n');
        this.astGeneric(ifNode.alternate, retArr);
        retArr.push('\n}\n');
      }
    }
    return retArr;

  }

  astSwitchStatement(ast, retArr) {
    const { discriminant, cases } = ast;
    retArr.push('switch (');
    this.astGeneric(discriminant, retArr);
    retArr.push(') {\n');
    for (let i = 0; i < cases.length; i++) {
      if (cases[i].test === null) {
        retArr.push('default:\n');
        this.astGeneric(cases[i].consequent, retArr);
        if (cases[i].consequent && cases[i].consequent.length > 0) {
          retArr.push('break;\n');
        }
        continue;
      }
      retArr.push('case ');
      this.astGeneric(cases[i].test, retArr);
      retArr.push(':\n');
      if (cases[i].consequent && cases[i].consequent.length > 0) {
        this.astGeneric(cases[i].consequent, retArr);
        retArr.push('break;\n');
      }
    }
    retArr.push('\n}');
  }

  astThisExpression(tNode, retArr) {
    retArr.push('_this');
    return retArr;
  }

  astMemberExpression(mNode, retArr) {
    const {
      signature,
      type,
      property,
      xProperty,
      yProperty,
      zProperty,
      name,
      origin
    } = this.getMemberExpressionDetails(mNode);
    switch (signature) {
      case 'this.thread.value':
        retArr.push(`_this.thread.${ name }`);
        return retArr;
      case 'this.output.value':
        switch (name) {
          case 'x':
            retArr.push('outputX');
            break;
          case 'y':
            retArr.push('outputY');
            break;
          case 'z':
            retArr.push('outputZ');
            break;
          default:
            throw this.astErrorOutput('Unexpected expression', mNode);
        }
        return retArr;
      case 'value':
        throw this.astErrorOutput('Unexpected expression', mNode);
      case 'value[]':
      case 'value[][]':
      case 'value[][][]':
      case 'value.value':
        if (origin === 'Math') {
          retArr.push(Math[name]);
          return retArr;
        }
        switch (property) {
          case 'r':
            retArr.push(`user_${ name }[0]`);
            return retArr;
          case 'g':
            retArr.push(`user_${ name }[1]`);
            return retArr;
          case 'b':
            retArr.push(`user_${ name }[2]`);
            return retArr;
          case 'a':
            retArr.push(`user_${ name }[3]`);
            return retArr;
        }
        break;
      case 'this.constants.value':
      case 'this.constants.value[]':
      case 'this.constants.value[][]':
      case 'this.constants.value[][][]':
        break;
      case 'fn()[]':
        this.astGeneric(mNode.object, retArr);
        retArr.push('[');
        this.astGeneric(mNode.property, retArr);
        retArr.push(']');
        return retArr;
      case 'fn()[][]':
        this.astGeneric(mNode.object.object, retArr);
        retArr.push('[');
        this.astGeneric(mNode.object.property, retArr);
        retArr.push(']');
        retArr.push('[');
        this.astGeneric(mNode.property, retArr);
        retArr.push(']');
        return retArr;
      default:
        throw this.astErrorOutput('Unexpected expression', mNode);
    }

    if (!mNode.computed) {
      switch (type) {
        case 'Number':
        case 'Integer':
        case 'Float':
        case 'Boolean':
          retArr.push(`${origin}_${name}`);
          return retArr;
      }
    }

    const markupName = `${origin}_${name}`;

    switch (type) {
      case 'Array(2)':
      case 'Array(3)':
      case 'Array(4)':
      case 'Matrix(2)':
      case 'Matrix(3)':
      case 'Matrix(4)':
      case 'HTMLImageArray':
      case 'ArrayTexture(1)':
      case 'ArrayTexture(2)':
      case 'ArrayTexture(3)':
      case 'ArrayTexture(4)':
      case 'HTMLImage':
      default:
        let size;
        let isInput;
        if (origin === 'constants') {
          const constant = this.constants[name];
          isInput = this.constantTypes[name] === 'Input';
          size = isInput ? constant.size : null;
        } else {
          isInput = this.isInput(name);
          size = isInput ? this.argumentSizes[this.argumentNames.indexOf(name)] : null;
        }
        retArr.push(`${ markupName }`);
        if (zProperty && yProperty) {
          if (isInput) {
            retArr.push('[(');
            this.astGeneric(zProperty, retArr);
            retArr.push(`*${ this.dynamicArguments ? '(outputY * outputX)' : size[1] * size[0] })+(`);
            this.astGeneric(yProperty, retArr);
            retArr.push(`*${ this.dynamicArguments ? 'outputX' : size[0] })+`);
            this.astGeneric(xProperty, retArr);
            retArr.push(']');
          } else {
            retArr.push('[');
            this.astGeneric(zProperty, retArr);
            retArr.push(']');
            retArr.push('[');
            this.astGeneric(yProperty, retArr);
            retArr.push(']');
            retArr.push('[');
            this.astGeneric(xProperty, retArr);
            retArr.push(']');
          }
        } else if (yProperty) {
          if (isInput) {
            retArr.push('[(');
            this.astGeneric(yProperty, retArr);
            retArr.push(`*${ this.dynamicArguments ? 'outputX' : size[0] })+`);
            this.astGeneric(xProperty, retArr);
            retArr.push(']');
          } else {
            retArr.push('[');
            this.astGeneric(yProperty, retArr);
            retArr.push(']');
            retArr.push('[');
            this.astGeneric(xProperty, retArr);
            retArr.push(']');
          }
        } else if (typeof xProperty !== 'undefined') {
          retArr.push('[');
          this.astGeneric(xProperty, retArr);
          retArr.push(']');
        }
    }
    return retArr;
  }

  astCallExpression(ast, retArr) {
    if (ast.type !== 'CallExpression') {
      throw this.astErrorOutput('Unknown CallExpression', ast);
    }
    let functionName = this.astMemberExpressionUnroll(ast.callee);

    if (this.calledFunctions.indexOf(functionName) < 0) {
      this.calledFunctions.push(functionName);
    }

    const isMathFunction = this.isAstMathFunction(ast);

    if (this.onFunctionCall) {
      this.onFunctionCall(this.name, functionName, ast.arguments);
    }

    retArr.push(functionName);

    retArr.push('(');
    const targetTypes = this.lookupFunctionArgumentTypes(functionName) || [];
    for (let i = 0; i < ast.arguments.length; ++i) {
      const argument = ast.arguments[i];

      let argumentType = this.getType(argument);
      if (!targetTypes[i]) {
        this.triggerImplyArgumentType(functionName, i, argumentType, this);
      }

      if (i > 0) {
        retArr.push(', ');
      }
      this.astGeneric(argument, retArr);
    }
    retArr.push(')');

    return retArr;
  }

  astArrayExpression(arrNode, retArr) {
    const returnType = this.getType(arrNode);
    const arrLen = arrNode.elements.length;
    const elements = [];
    for (let i = 0; i < arrLen; ++i) {
      const element = [];
      this.astGeneric(arrNode.elements[i], element);
      elements.push(element.join(''));
    }
    switch (returnType) {
      case 'Matrix(2)':
      case 'Matrix(3)':
      case 'Matrix(4)':
        retArr.push(`[${elements.join(', ')}]`);
        break;
      default:
        retArr.push(`new Float32Array([${elements.join(', ')}])`);
    }
    return retArr;
  }

  astDebuggerStatement(arrNode, retArr) {
    retArr.push('debugger;');
    return retArr;
  }
}

module.exports = {
  CPUFunctionNode
};
},{"../function-node":9}],6:[function(require,module,exports){
const { utils } = require('../../utils');

function constantsToString(constants, types) {
  const results = [];
  for (const name in types) {
    if (!types.hasOwnProperty(name)) continue;
    const type = types[name];
    const constant = constants[name];
    switch (type) {
      case 'Number':
      case 'Integer':
      case 'Float':
      case 'Boolean':
        results.push(`${name}:${constant}`);
        break;
      case 'Array(2)':
      case 'Array(3)':
      case 'Array(4)':
      case 'Matrix(2)':
      case 'Matrix(3)':
      case 'Matrix(4)':
        results.push(`${name}:new ${constant.constructor.name}(${JSON.stringify(Array.from(constant))})`);
        break;
    }
  }
  return `{ ${ results.join() } }`;
}

function cpuKernelString(cpuKernel, name) {
  const header = [];
  const thisProperties = [];
  const beforeReturn = [];

  const useFunctionKeyword = !/^function/.test(cpuKernel.color.toString());

  header.push(
    '  const { context, canvas, constants: incomingConstants } = settings;',
    `  const output = new Int32Array(${JSON.stringify(Array.from(cpuKernel.output))});`,
    `  const _constantTypes = ${JSON.stringify(cpuKernel.constantTypes)};`,
    `  const _constants = ${constantsToString(cpuKernel.constants, cpuKernel.constantTypes)};`
  );

  thisProperties.push(
    '    constants: _constants,',
    '    context,',
    '    output,',
    '    thread: {x: 0, y: 0, z: 0},'
  );

  if (cpuKernel.graphical) {
    header.push(`  const _imageData = context.createImageData(${cpuKernel.output[0]}, ${cpuKernel.output[1]});`);
    header.push(`  const _colorData = new Uint8ClampedArray(${cpuKernel.output[0]} * ${cpuKernel.output[1]} * 4);`);

    const colorFn = utils.flattenFunctionToString((useFunctionKeyword ? 'function ' : '') + cpuKernel.color.toString(), {
      thisLookup: (propertyName) => {
        switch (propertyName) {
          case '_colorData':
            return '_colorData';
          case '_imageData':
            return '_imageData';
          case 'output':
            return 'output';
          case 'thread':
            return 'this.thread';
        }
        return JSON.stringify(cpuKernel[propertyName]);
      },
      findDependency: (object, name) => {
        return null;
      }
    });

    const getPixelsFn = utils.flattenFunctionToString((useFunctionKeyword ? 'function ' : '') + cpuKernel.getPixels.toString(), {
      thisLookup: (propertyName) => {
        switch (propertyName) {
          case '_colorData':
            return '_colorData';
          case '_imageData':
            return '_imageData';
          case 'output':
            return 'output';
          case 'thread':
            return 'this.thread';
        }
        return JSON.stringify(cpuKernel[propertyName]);
      },
      findDependency: () => {
        return null;
      }
    });

    thisProperties.push(
      '    _imageData,',
      '    _colorData,',
      `    color: ${colorFn},`
    );

    beforeReturn.push(
      `  kernel.getPixels = ${getPixelsFn};`
    );
  }

  const constantTypes = [];
  const constantKeys = Object.keys(cpuKernel.constantTypes);
  for (let i = 0; i < constantKeys.length; i++) {
    constantTypes.push(cpuKernel.constantTypes[constantKeys]);
  }
  if (cpuKernel.argumentTypes.indexOf('HTMLImageArray') !== -1 || constantTypes.indexOf('HTMLImageArray') !== -1) {
    const flattenedImageTo3DArray = utils.flattenFunctionToString((useFunctionKeyword ? 'function ' : '') + cpuKernel._imageTo3DArray.toString(), {
      doNotDefine: ['canvas'],
      findDependency: (object, name) => {
        if (object === 'this') {
          return (useFunctionKeyword ? 'function ' : '') + cpuKernel[name].toString();
        }
        return null;
      },
      thisLookup: (propertyName) => {
        switch (propertyName) {
          case 'canvas':
            return;
          case 'context':
            return 'context';
        }
      }
    });
    beforeReturn.push(flattenedImageTo3DArray);
    thisProperties.push(`    _mediaTo2DArray,`);
    thisProperties.push(`    _imageTo3DArray,`);
  } else if (cpuKernel.argumentTypes.indexOf('HTMLImage') !== -1 || constantTypes.indexOf('HTMLImage') !== -1) {
    const flattenedImageTo2DArray = utils.flattenFunctionToString((useFunctionKeyword ? 'function ' : '') + cpuKernel._mediaTo2DArray.toString(), {
      findDependency: (object, name) => {
        return null;
      },
      thisLookup: (propertyName) => {
        switch (propertyName) {
          case 'canvas':
            return 'settings.canvas';
          case 'context':
            return 'settings.context';
        }
        throw new Error('unhandled thisLookup');
      }
    });
    beforeReturn.push(flattenedImageTo2DArray);
    thisProperties.push(`    _mediaTo2DArray,`);
  }

  return `function(settings) {
${ header.join('\n') }
  for (const p in _constantTypes) {
    if (!_constantTypes.hasOwnProperty(p)) continue;
    const type = _constantTypes[p];
    switch (type) {
      case 'Number':
      case 'Integer':
      case 'Float':
      case 'Boolean':
      case 'Array(2)':
      case 'Array(3)':
      case 'Array(4)':
      case 'Matrix(2)':
      case 'Matrix(3)':
      case 'Matrix(4)':
        if (incomingConstants.hasOwnProperty(p)) {
          console.warn('constant ' + p + ' of type ' + type + ' cannot be resigned');
        }
        continue;
    }
    if (!incomingConstants.hasOwnProperty(p)) {
      throw new Error('constant ' + p + ' not found');
    }
    _constants[p] = incomingConstants[p];
  }
  const kernel = (function() {
${cpuKernel._kernelString}
  })
    .apply({ ${thisProperties.join('\n')} });
  ${ beforeReturn.join('\n') }
  return kernel;
}`;
}

module.exports = {
  cpuKernelString
};
},{"../../utils":113}],7:[function(require,module,exports){
const { Kernel } = require('../kernel');
const { FunctionBuilder } = require('../function-builder');
const { CPUFunctionNode } = require('./function-node');
const { utils } = require('../../utils');
const { cpuKernelString } = require('./kernel-string');

class CPUKernel extends Kernel {
  static getFeatures() {
    return this.features;
  }
  static get features() {
    return Object.freeze({
      kernelMap: true,
      isIntegerDivisionAccurate: true
    });
  }
  static get isSupported() {
    return true;
  }
  static isContextMatch(context) {
    return false;
  }
  static get mode() {
    return 'cpu';
  }

  static nativeFunctionArguments() {
    return null;
  }

  static nativeFunctionReturnType() {
    throw new Error(`Looking up native function return type not supported on ${this.name}`);
  }

  static combineKernels(combinedKernel) {
    return combinedKernel;
  }

  static getSignature(kernel, argumentTypes) {
    return 'cpu' + (argumentTypes.length > 0 ? ':' + argumentTypes.join(',') : '');
  }

  constructor(source, settings) {
    super(source, settings);
    this.mergeSettings(source.settings || settings);

    this._imageData = null;
    this._colorData = null;
    this._kernelString = null;
    this._prependedString = [];
    this.thread = {
      x: 0,
      y: 0,
      z: 0
    };
    this.translatedSources = null;
  }

  initCanvas() {
    if (typeof document !== 'undefined') {
      return document.createElement('canvas');
    } else if (typeof OffscreenCanvas !== 'undefined') {
      return new OffscreenCanvas(0, 0);
    }
  }

  initContext() {
    if (!this.canvas) return null;
    return this.canvas.getContext('2d');
  }

  initPlugins(settings) {
    return [];
  }

  validateSettings(args) {
    if (!this.output || this.output.length === 0) {
      if (args.length !== 1) {
        throw new Error('Auto output only supported for kernels with only one input');
      }

      const argType = utils.getVariableType(args[0], this.strictIntegers);
      if (argType === 'Array') {
        this.output = utils.getDimensions(argType);
      } else if (argType === 'NumberTexture' || argType === 'ArrayTexture(4)') {
        this.output = args[0].output;
      } else {
        throw new Error('Auto output not supported for input type: ' + argType);
      }
    }

    if (this.graphical) {
      if (this.output.length !== 2) {
        throw new Error('Output must have 2 dimensions on graphical mode');
      }
    }

    this.checkOutput();
  }

  translateSource() {
    this.leadingReturnStatement = this.output.length > 1 ? 'resultX[x] = ' : 'result[x] = ';
    if (this.subKernels) {
      const followingReturnStatement = [];
      for (let i = 0; i < this.subKernels.length; i++) {
        const {
          name
        } = this.subKernels[i];
        followingReturnStatement.push(this.output.length > 1 ? `resultX_${ name }[x] = subKernelResult_${ name };\n` : `result_${ name }[x] = subKernelResult_${ name };\n`);
      }
      this.followingReturnStatement = followingReturnStatement.join('');
    }
    const functionBuilder = FunctionBuilder.fromKernel(this, CPUFunctionNode);
    this.translatedSources = functionBuilder.getPrototypes('kernel');
    if (!this.graphical && !this.returnType) {
      this.returnType = functionBuilder.getKernelResultType();
    }
  }

  build() {
    if (this.built) return;
    this.setupConstants();
    this.setupArguments(arguments);
    this.validateSettings(arguments);
    this.translateSource();

    if (this.graphical) {
      const {
        canvas,
        output
      } = this;
      if (!canvas) {
        throw new Error('no canvas available for using graphical output');
      }
      const width = output[0];
      const height = output[1] || 1;
      canvas.width = width;
      canvas.height = height;
      this._imageData = this.context.createImageData(width, height);
      this._colorData = new Uint8ClampedArray(width * height * 4);
    }

    const kernelString = this.getKernelString();
    this.kernelString = kernelString;

    if (this.debug) {
      console.log('Function output:');
      console.log(kernelString);
    }

    try {
      this.run = new Function([], kernelString).bind(this)();
    } catch (e) {
      console.error('An error occurred compiling the javascript: ', e);
    }
    this.buildSignature(arguments);
    this.built = true;
  }

  color(r, g, b, a) {
    if (typeof a === 'undefined') {
      a = 1;
    }

    r = Math.floor(r * 255);
    g = Math.floor(g * 255);
    b = Math.floor(b * 255);
    a = Math.floor(a * 255);

    const width = this.output[0];
    const height = this.output[1];

    const x = this.thread.x;
    const y = height - this.thread.y - 1;

    const index = x + y * width;

    this._colorData[index * 4 + 0] = r;
    this._colorData[index * 4 + 1] = g;
    this._colorData[index * 4 + 2] = b;
    this._colorData[index * 4 + 3] = a;
  }

  getKernelString() {
    if (this._kernelString !== null) return this._kernelString;

    let kernelThreadString = null;
    let {
      translatedSources
    } = this;
    if (translatedSources.length > 1) {
      translatedSources = translatedSources.filter(fn => {
        if (/^function/.test(fn)) return fn;
        kernelThreadString = fn;
        return false;
      });
    } else {
      kernelThreadString = translatedSources.shift();
    }
    return this._kernelString = `  const LOOP_MAX = ${ this._getLoopMaxString() };
  ${ this.injectedNative || '' }
  const _this = this;
  ${ this._resultKernelHeader() }
  ${ this._processConstants() }
  return (${ this.argumentNames.map(argumentName => 'user_' + argumentName).join(', ') }) => {
    ${ this._prependedString.join('') }
    ${ this._earlyThrows() }
    ${ this._processArguments() }
    ${ this.graphical ? this._graphicalKernelBody(kernelThreadString) : this._resultKernelBody(kernelThreadString) }
    ${ translatedSources.length > 0 ? translatedSources.join('\n') : '' }
  };`;
  }

  toString() {
    return cpuKernelString(this);
  }

  _getLoopMaxString() {
    return (
      this.loopMaxIterations ?
      ` ${ parseInt(this.loopMaxIterations) };` :
      ' 1000;'
    );
  }

  _processConstants() {
    if (!this.constants) return '';

    const result = [];
    for (let p in this.constants) {
      const type = this.constantTypes[p];
      switch (type) {
        case 'HTMLCanvas':
        case 'OffscreenCanvas':
        case 'HTMLImage':
        case 'ImageBitmap':
        case 'ImageData':
        case 'HTMLVideo':
          result.push(`    const constants_${p} = this._mediaTo2DArray(this.constants.${p});\n`);
          break;
        case 'HTMLImageArray':
          result.push(`    const constants_${p} = this._imageTo3DArray(this.constants.${p});\n`);
          break;
        case 'Input':
          result.push(`    const constants_${p} = this.constants.${p}.value;\n`);
          break;
        default:
          result.push(`    const constants_${p} = this.constants.${p};\n`);
      }
    }
    return result.join('');
  }

  _earlyThrows() {
    if (this.graphical) return '';
    if (this.immutable) return '';
    if (!this.pipeline) return '';
    const arrayArguments = [];
    for (let i = 0; i < this.argumentTypes.length; i++) {
      if (this.argumentTypes[i] === 'Array') {
        arrayArguments.push(this.argumentNames[i]);
      }
    }
    if (arrayArguments.length === 0) return '';
    const checks = [];
    for (let i = 0; i < arrayArguments.length; i++) {
      const argumentName = arrayArguments[i];
      const checkSubKernels = this._mapSubKernels(subKernel => `user_${argumentName} === result_${subKernel.name}`).join(' || ');
      checks.push(`user_${argumentName} === result${checkSubKernels ? ` || ${checkSubKernels}` : ''}`);
    }
    return `if (${checks.join(' || ')}) throw new Error('Source and destination arrays are the same.  Use immutable = true');`;
  }

  _processArguments() {
    const result = [];
    for (let i = 0; i < this.argumentTypes.length; i++) {
      const variableName = `user_${this.argumentNames[i]}`;
      switch (this.argumentTypes[i]) {
        case 'HTMLCanvas':
        case 'OffscreenCanvas':
        case 'HTMLImage':
        case 'ImageBitmap':
        case 'ImageData':
        case 'HTMLVideo':
          result.push(`    ${variableName} = this._mediaTo2DArray(${variableName});\n`);
          break;
        case 'HTMLImageArray':
          result.push(`    ${variableName} = this._imageTo3DArray(${variableName});\n`);
          break;
        case 'Input':
          result.push(`    ${variableName} = ${variableName}.value;\n`);
          break;
        case 'ArrayTexture(1)':
        case 'ArrayTexture(2)':
        case 'ArrayTexture(3)':
        case 'ArrayTexture(4)':
        case 'NumberTexture':
        case 'MemoryOptimizedNumberTexture':
          result.push(`
    if (${variableName}.toArray) {
      if (!_this.textureCache) {
        _this.textureCache = [];
        _this.arrayCache = [];
      }
      const textureIndex = _this.textureCache.indexOf(${variableName});
      if (textureIndex !== -1) {
        ${variableName} = _this.arrayCache[textureIndex];
      } else {
        _this.textureCache.push(${variableName});
        ${variableName} = ${variableName}.toArray();
        _this.arrayCache.push(${variableName});
      }
    }`);
          break;
      }
    }
    return result.join('');
  }

  _mediaTo2DArray(media) {
    const canvas = this.canvas;
    const width = media.width > 0 ? media.width : media.videoWidth;
    const height = media.height > 0 ? media.height : media.videoHeight;
    if (canvas.width < width) {
      canvas.width = width;
    }
    if (canvas.height < height) {
      canvas.height = height;
    }
    const ctx = this.context;
    let pixelsData;
    if (media.constructor === ImageData) {
      pixelsData = media.data;
    } else {
      ctx.drawImage(media, 0, 0, width, height);
      pixelsData = ctx.getImageData(0, 0, width, height).data;
    }
    const imageArray = new Array(height);
    let index = 0;
    for (let y = height - 1; y >= 0; y--) {
      const row = imageArray[y] = new Array(width);
      for (let x = 0; x < width; x++) {
        const pixel = new Float32Array(4);
        pixel[0] = pixelsData[index++] / 255; 
        pixel[1] = pixelsData[index++] / 255; 
        pixel[2] = pixelsData[index++] / 255; 
        pixel[3] = pixelsData[index++] / 255; 
        row[x] = pixel;
      }
    }
    return imageArray;
  }

  getPixels(flip) {
    const [width, height] = this.output;
    return flip ? utils.flipPixels(this._imageData.data, width, height) : this._imageData.data.slice(0);
  }

  _imageTo3DArray(images) {
    const imagesArray = new Array(images.length);
    for (let i = 0; i < images.length; i++) {
      imagesArray[i] = this._mediaTo2DArray(images[i]);
    }
    return imagesArray;
  }

  _resultKernelHeader() {
    if (this.graphical) return '';
    if (this.immutable) return '';
    if (!this.pipeline) return '';
    switch (this.output.length) {
      case 1:
        return this._mutableKernel1DResults();
      case 2:
        return this._mutableKernel2DResults();
      case 3:
        return this._mutableKernel3DResults();
    }
  }

  _resultKernelBody(kernelString) {
    switch (this.output.length) {
      case 1:
        return (!this.immutable && this.pipeline ? this._resultMutableKernel1DLoop(kernelString) : this._resultImmutableKernel1DLoop(kernelString)) + this._kernelOutput();
      case 2:
        return (!this.immutable && this.pipeline ? this._resultMutableKernel2DLoop(kernelString) : this._resultImmutableKernel2DLoop(kernelString)) + this._kernelOutput();
      case 3:
        return (!this.immutable && this.pipeline ? this._resultMutableKernel3DLoop(kernelString) : this._resultImmutableKernel3DLoop(kernelString)) + this._kernelOutput();
      default:
        throw new Error('unsupported size kernel');
    }
  }

  _graphicalKernelBody(kernelThreadString) {
    switch (this.output.length) {
      case 2:
        return this._graphicalKernel2DLoop(kernelThreadString) + this._graphicalOutput();
      default:
        throw new Error('unsupported size kernel');
    }
  }

  _graphicalOutput() {
    return `
    this._imageData.data.set(this._colorData);
    this.context.putImageData(this._imageData, 0, 0);
    return;`
  }

  _getKernelResultTypeConstructorString() {
    switch (this.returnType) {
      case 'LiteralInteger':
      case 'Number':
      case 'Integer':
      case 'Float':
        return 'Float32Array';
      case 'Array(2)':
      case 'Array(3)':
      case 'Array(4)':
        return 'Array';
      default:
        if (this.graphical) {
          return 'Float32Array';
        }
        throw new Error(`unhandled returnType ${ this.returnType }`);
    }
  }

  _resultImmutableKernel1DLoop(kernelString) {
    const constructorString = this._getKernelResultTypeConstructorString();
    return `  const outputX = _this.output[0];
    const result = new ${constructorString}(outputX);
    ${ this._mapSubKernels(subKernel => `const result_${ subKernel.name } = new ${constructorString}(outputX);\n`).join('    ') }
    ${ this._mapSubKernels(subKernel => `let subKernelResult_${ subKernel.name };\n`).join('    ') }
    for (let x = 0; x < outputX; x++) {
      this.thread.x = x;
      this.thread.y = 0;
      this.thread.z = 0;
      ${ kernelString }
    }`;
  }

  _mutableKernel1DResults() {
    const constructorString = this._getKernelResultTypeConstructorString();
    return `  const outputX = _this.output[0];
    const result = new ${constructorString}(outputX);
    ${ this._mapSubKernels(subKernel => `const result_${ subKernel.name } = new ${constructorString}(outputX);\n`).join('    ') }
    ${ this._mapSubKernels(subKernel => `let subKernelResult_${ subKernel.name };\n`).join('    ') }`;
  }

  _resultMutableKernel1DLoop(kernelString) {
    return `  const outputX = _this.output[0];
    for (let x = 0; x < outputX; x++) {
      this.thread.x = x;
      this.thread.y = 0;
      this.thread.z = 0;
      ${ kernelString }
    }`;
  }

  _resultImmutableKernel2DLoop(kernelString) {
    const constructorString = this._getKernelResultTypeConstructorString();
    return `  const outputX = _this.output[0];
    const outputY = _this.output[1];
    const result = new Array(outputY);
    ${ this._mapSubKernels(subKernel => `const result_${ subKernel.name } = new Array(outputY);\n`).join('    ') }
    ${ this._mapSubKernels(subKernel => `let subKernelResult_${ subKernel.name };\n`).join('    ') }
    for (let y = 0; y < outputY; y++) {
      this.thread.z = 0;
      this.thread.y = y;
      const resultX = result[y] = new ${constructorString}(outputX);
      ${ this._mapSubKernels(subKernel => `const resultX_${ subKernel.name } = result_${subKernel.name}[y] = new ${constructorString}(outputX);\n`).join('') }
      for (let x = 0; x < outputX; x++) {
        this.thread.x = x;
        ${ kernelString }
      }
    }`;
  }

  _mutableKernel2DResults() {
    const constructorString = this._getKernelResultTypeConstructorString();
    return `  const outputX = _this.output[0];
    const outputY = _this.output[1];
    const result = new Array(outputY);
    ${ this._mapSubKernels(subKernel => `const result_${ subKernel.name } = new Array(outputY);\n`).join('    ') }
    ${ this._mapSubKernels(subKernel => `let subKernelResult_${ subKernel.name };\n`).join('    ') }
    for (let y = 0; y < outputY; y++) {
      const resultX = result[y] = new ${constructorString}(outputX);
      ${ this._mapSubKernels(subKernel => `const resultX_${ subKernel.name } = result_${subKernel.name}[y] = new ${constructorString}(outputX);\n`).join('') }
    }`;
  }

  _resultMutableKernel2DLoop(kernelString) {
    const constructorString = this._getKernelResultTypeConstructorString();
    return `  const outputX = _this.output[0];
    const outputY = _this.output[1];
    for (let y = 0; y < outputY; y++) {
      this.thread.z = 0;
      this.thread.y = y;
      const resultX = result[y];
      ${ this._mapSubKernels(subKernel => `const resultX_${ subKernel.name } = result_${subKernel.name}[y] = new ${constructorString}(outputX);\n`).join('') }
      for (let x = 0; x < outputX; x++) {
        this.thread.x = x;
        ${ kernelString }
      }
    }`;
  }

  _graphicalKernel2DLoop(kernelString) {
    return `  const outputX = _this.output[0];
    const outputY = _this.output[1];
    for (let y = 0; y < outputY; y++) {
      this.thread.z = 0;
      this.thread.y = y;
      for (let x = 0; x < outputX; x++) {
        this.thread.x = x;
        ${ kernelString }
      }
    }`;
  }

  _resultImmutableKernel3DLoop(kernelString) {
    const constructorString = this._getKernelResultTypeConstructorString();
    return `  const outputX = _this.output[0];
    const outputY = _this.output[1];
    const outputZ = _this.output[2];
    const result = new Array(outputZ);
    ${ this._mapSubKernels(subKernel => `const result_${ subKernel.name } = new Array(outputZ);\n`).join('    ') }
    ${ this._mapSubKernels(subKernel => `let subKernelResult_${ subKernel.name };\n`).join('    ') }
    for (let z = 0; z < outputZ; z++) {
      this.thread.z = z;
      const resultY = result[z] = new Array(outputY);
      ${ this._mapSubKernels(subKernel => `const resultY_${ subKernel.name } = result_${subKernel.name}[z] = new Array(outputY);\n`).join('      ') }
      for (let y = 0; y < outputY; y++) {
        this.thread.y = y;
        const resultX = resultY[y] = new ${constructorString}(outputX);
        ${ this._mapSubKernels(subKernel => `const resultX_${ subKernel.name } = resultY_${subKernel.name}[y] = new ${constructorString}(outputX);\n`).join('        ') }
        for (let x = 0; x < outputX; x++) {
          this.thread.x = x;
          ${ kernelString }
        }
      }
    }`;
  }

  _mutableKernel3DResults() {
    const constructorString = this._getKernelResultTypeConstructorString();
    return `  const outputX = _this.output[0];
    const outputY = _this.output[1];
    const outputZ = _this.output[2];
    const result = new Array(outputZ);
    ${ this._mapSubKernels(subKernel => `const result_${ subKernel.name } = new Array(outputZ);\n`).join('    ') }
    ${ this._mapSubKernels(subKernel => `let subKernelResult_${ subKernel.name };\n`).join('    ') }
    for (let z = 0; z < outputZ; z++) {
      const resultY = result[z] = new Array(outputY);
      ${ this._mapSubKernels(subKernel => `const resultY_${ subKernel.name } = result_${subKernel.name}[z] = new Array(outputY);\n`).join('      ') }
      for (let y = 0; y < outputY; y++) {
        const resultX = resultY[y] = new ${constructorString}(outputX);
        ${ this._mapSubKernels(subKernel => `const resultX_${ subKernel.name } = resultY_${subKernel.name}[y] = new ${constructorString}(outputX);\n`).join('        ') }
      }
    }`;
  }

  _resultMutableKernel3DLoop(kernelString) {
    return `  const outputX = _this.output[0];
    const outputY = _this.output[1];
    const outputZ = _this.output[2];
    for (let z = 0; z < outputZ; z++) {
      this.thread.z = z;
      const resultY = result[z];
      for (let y = 0; y < outputY; y++) {
        this.thread.y = y;
        const resultX = resultY[y];
        for (let x = 0; x < outputX; x++) {
          this.thread.x = x;
          ${ kernelString }
        }
      }
    }`;
  }

  _kernelOutput() {
    if (!this.subKernels) {
      return '\n    return result;';
    }
    return `\n    return {
      result: result,
      ${ this.subKernels.map(subKernel => `${ subKernel.property }: result_${ subKernel.name }`).join(',\n      ') }
    };`;
  }

  _mapSubKernels(fn) {
    return this.subKernels === null ? [''] :
      this.subKernels.map(fn);
  }

  destroy(removeCanvasReference) {
    if (removeCanvasReference) {
      delete this.canvas;
    }
  }

  static destroyContext(context) {}

  toJSON() {
    const json = super.toJSON();
    json.functionNodes = FunctionBuilder.fromKernel(this, CPUFunctionNode).toJSON();
    return json;
  }

  setOutput(output) {
    super.setOutput(output);
    const [width, height] = this.output;
    if (this.graphical) {
      this._imageData = this.context.createImageData(width, height);
      this._colorData = new Uint8ClampedArray(width * height * 4);
    }
  }

  prependString(value) {
    if (this._kernelString) throw new Error('Kernel already built');
    this._prependedString.push(value);
  }

  hasPrependString(value) {
    return this._prependedString.indexOf(value) > -1;
  }
}

module.exports = {
  CPUKernel
};
},{"../../utils":113,"../function-builder":8,"../kernel":35,"./function-node":5,"./kernel-string":6}],8:[function(require,module,exports){
class FunctionBuilder {
  static fromKernel(kernel, FunctionNode, extraNodeOptions) {
    const {
      kernelArguments,
      kernelConstants,
      argumentNames,
      argumentSizes,
      argumentBitRatios,
      constants,
      constantBitRatios,
      debug,
      loopMaxIterations,
      nativeFunctions,
      output,
      optimizeFloatMemory,
      precision,
      plugins,
      source,
      subKernels,
      functions,
      leadingReturnStatement,
      followingReturnStatement,
      dynamicArguments,
      dynamicOutput,
    } = kernel;

    const argumentTypes = new Array(kernelArguments.length);
    const constantTypes = {};

    for (let i = 0; i < kernelArguments.length; i++) {
      argumentTypes[i] = kernelArguments[i].type;
    }

    for (let i = 0; i < kernelConstants.length; i++) {
      const kernelConstant = kernelConstants[i];
      constantTypes[kernelConstant.name] = kernelConstant.type;
    }

    const needsArgumentType = (functionName, index) => {
      return functionBuilder.needsArgumentType(functionName, index);
    };

    const assignArgumentType = (functionName, index, type) => {
      functionBuilder.assignArgumentType(functionName, index, type);
    };

    const lookupReturnType = (functionName, ast, requestingNode) => {
      return functionBuilder.lookupReturnType(functionName, ast, requestingNode);
    };

    const lookupFunctionArgumentTypes = (functionName) => {
      return functionBuilder.lookupFunctionArgumentTypes(functionName);
    };

    const lookupFunctionArgumentName = (functionName, argumentIndex) => {
      return functionBuilder.lookupFunctionArgumentName(functionName, argumentIndex);
    };

    const lookupFunctionArgumentBitRatio = (functionName, argumentName) => {
      return functionBuilder.lookupFunctionArgumentBitRatio(functionName, argumentName);
    };

    const triggerImplyArgumentType = (functionName, i, argumentType, requestingNode) => {
      functionBuilder.assignArgumentType(functionName, i, argumentType, requestingNode);
    };

    const triggerImplyArgumentBitRatio = (functionName, argumentName, calleeFunctionName, argumentIndex) => {
      functionBuilder.assignArgumentBitRatio(functionName, argumentName, calleeFunctionName, argumentIndex);
    };

    const onFunctionCall = (functionName, calleeFunctionName, args) => {
      functionBuilder.trackFunctionCall(functionName, calleeFunctionName, args);
    };

    const onNestedFunction = (ast, source) => {
      const argumentNames = [];
      for (let i = 0; i < ast.params.length; i++) {
        argumentNames.push(ast.params[i].name);
      }
      const nestedFunction = new FunctionNode(source, Object.assign({}, nodeOptions, {
        returnType: null,
        ast,
        name: ast.id.name,
        argumentNames,
        lookupReturnType,
        lookupFunctionArgumentTypes,
        lookupFunctionArgumentName,
        lookupFunctionArgumentBitRatio,
        needsArgumentType,
        assignArgumentType,
        triggerImplyArgumentType,
        triggerImplyArgumentBitRatio,
        onFunctionCall,
      }));
      nestedFunction.traceFunctionAST(ast);
      functionBuilder.addFunctionNode(nestedFunction);
    };

    const nodeOptions = Object.assign({
      isRootKernel: false,
      onNestedFunction,
      lookupReturnType,
      lookupFunctionArgumentTypes,
      lookupFunctionArgumentName,
      lookupFunctionArgumentBitRatio,
      needsArgumentType,
      assignArgumentType,
      triggerImplyArgumentType,
      triggerImplyArgumentBitRatio,
      onFunctionCall,
      optimizeFloatMemory,
      precision,
      constants,
      constantTypes,
      constantBitRatios,
      debug,
      loopMaxIterations,
      output,
      plugins,
      dynamicArguments,
      dynamicOutput,
    }, extraNodeOptions || {});

    const rootNodeOptions = Object.assign({}, nodeOptions, {
      isRootKernel: true,
      name: 'kernel',
      argumentNames,
      argumentTypes,
      argumentSizes,
      argumentBitRatios,
      leadingReturnStatement,
      followingReturnStatement,
    });

    if (typeof source === 'object' && source.functionNodes) {
      return new FunctionBuilder().fromJSON(source.functionNodes, FunctionNode);
    }

    const rootNode = new FunctionNode(source, rootNodeOptions);

    let functionNodes = null;
    if (functions) {
      functionNodes = functions.map((fn) => new FunctionNode(fn.source, {
        returnType: fn.returnType,
        argumentTypes: fn.argumentTypes,
        output,
        plugins,
        constants,
        constantTypes,
        constantBitRatios,
        optimizeFloatMemory,
        precision,
        lookupReturnType,
        lookupFunctionArgumentTypes,
        lookupFunctionArgumentName,
        lookupFunctionArgumentBitRatio,
        needsArgumentType,
        assignArgumentType,
        triggerImplyArgumentType,
        triggerImplyArgumentBitRatio,
        onFunctionCall,
        onNestedFunction,
      }));
    }

    let subKernelNodes = null;
    if (subKernels) {
      subKernelNodes = subKernels.map((subKernel) => {
        const { name, source } = subKernel;
        return new FunctionNode(source, Object.assign({}, nodeOptions, {
          name,
          isSubKernel: true,
          isRootKernel: false,
        }));
      });
    }

    const functionBuilder = new FunctionBuilder({
      kernel,
      rootNode,
      functionNodes,
      nativeFunctions,
      subKernelNodes
    });

    return functionBuilder;
  }

  constructor(settings) {
    settings = settings || {};
    this.kernel = settings.kernel;
    this.rootNode = settings.rootNode;
    this.functionNodes = settings.functionNodes || [];
    this.subKernelNodes = settings.subKernelNodes || [];
    this.nativeFunctions = settings.nativeFunctions || [];
    this.functionMap = {};
    this.nativeFunctionNames = [];
    this.lookupChain = [];
    this.functionNodeDependencies = {};
    this.functionCalls = {};

    if (this.rootNode) {
      this.functionMap['kernel'] = this.rootNode;
    }

    if (this.functionNodes) {
      for (let i = 0; i < this.functionNodes.length; i++) {
        this.functionMap[this.functionNodes[i].name] = this.functionNodes[i];
      }
    }

    if (this.subKernelNodes) {
      for (let i = 0; i < this.subKernelNodes.length; i++) {
        this.functionMap[this.subKernelNodes[i].name] = this.subKernelNodes[i];
      }
    }

    if (this.nativeFunctions) {
      for (let i = 0; i < this.nativeFunctions.length; i++) {
        const nativeFunction = this.nativeFunctions[i];
        this.nativeFunctionNames.push(nativeFunction.name);
      }
    }
  }

  addFunctionNode(functionNode) {
    if (!functionNode.name) throw new Error('functionNode.name needs set');
    this.functionMap[functionNode.name] = functionNode;
    if (functionNode.isRootKernel) {
      this.rootNode = functionNode;
    }
  }

  traceFunctionCalls(functionName, retList) {
    functionName = functionName || 'kernel';
    retList = retList || [];

    if (this.nativeFunctionNames.indexOf(functionName) > -1) {
      const nativeFunctionIndex = retList.indexOf(functionName);
      if (nativeFunctionIndex === -1) {
        retList.push(functionName);
      } else {
        const dependantNativeFunctionName = retList.splice(nativeFunctionIndex, 1)[0];
        retList.push(dependantNativeFunctionName);
      }
      return retList;
    }

    const functionNode = this.functionMap[functionName];
    if (functionNode) {
      const functionIndex = retList.indexOf(functionName);
      if (functionIndex === -1) {
        retList.push(functionName);
        functionNode.toString(); 
        for (let i = 0; i < functionNode.calledFunctions.length; ++i) {
          this.traceFunctionCalls(functionNode.calledFunctions[i], retList);
        }
      } else {
        const dependantFunctionName = retList.splice(functionIndex, 1)[0];
        retList.push(dependantFunctionName);
      }
    }

    return retList;
  }

  getPrototypeString(functionName) {
    return this.getPrototypes(functionName).join('\n');
  }

  getPrototypes(functionName) {
    if (this.rootNode) {
      this.rootNode.toString();
    }
    if (functionName) {
      return this.getPrototypesFromFunctionNames(this.traceFunctionCalls(functionName, []).reverse());
    }
    return this.getPrototypesFromFunctionNames(Object.keys(this.functionMap));
  }

  getStringFromFunctionNames(functionList) {
    const ret = [];
    for (let i = 0; i < functionList.length; ++i) {
      const node = this.functionMap[functionList[i]];
      if (node) {
        ret.push(this.functionMap[functionList[i]].toString());
      }
    }
    return ret.join('\n');
  }

  getPrototypesFromFunctionNames(functionList) {
    const ret = [];
    for (let i = 0; i < functionList.length; ++i) {
      const functionName = functionList[i];
      const functionIndex = this.nativeFunctionNames.indexOf(functionName);
      if (functionIndex > -1) {
        ret.push(this.nativeFunctions[functionIndex].source);
        continue;
      }
      const node = this.functionMap[functionName];
      if (node) {
        ret.push(node.toString());
      }
    }
    return ret;
  }

  toJSON() {
    return this.traceFunctionCalls(this.rootNode.name).reverse().map(name => {
      const nativeIndex = this.nativeFunctions.indexOf(name);
      if (nativeIndex > -1) {
        return {
          name,
          source: this.nativeFunctions[nativeIndex].source
        };
      } else if (this.functionMap[name]) {
        return this.functionMap[name].toJSON();
      } else {
        throw new Error(`function ${ name } not found`);
      }
    });
  }

  fromJSON(jsonFunctionNodes, FunctionNode) {
    this.functionMap = {};
    for (let i = 0; i < jsonFunctionNodes.length; i++) {
      const jsonFunctionNode = jsonFunctionNodes[i];
      this.functionMap[jsonFunctionNode.settings.name] = new FunctionNode(jsonFunctionNode.ast, jsonFunctionNode.settings);
    }
    return this;
  }

  getString(functionName) {
    if (functionName) {
      return this.getStringFromFunctionNames(this.traceFunctionCalls(functionName).reverse());
    }
    return this.getStringFromFunctionNames(Object.keys(this.functionMap));
  }

  lookupReturnType(functionName, ast, requestingNode) {
    if (ast.type !== 'CallExpression') {
      throw new Error(`expected ast type of "CallExpression", but is ${ ast.type }`);
    }
    if (this._isNativeFunction(functionName)) {
      return this._lookupNativeFunctionReturnType(functionName);
    } else if (this._isFunction(functionName)) {
      const node = this._getFunction(functionName);
      if (node.returnType) {
        return node.returnType;
      } else {
        for (let i = 0; i < this.lookupChain.length; i++) {
          if (this.lookupChain[i].ast === ast) {
            if (node.argumentTypes.length === 0 && ast.arguments.length > 0) {
              const args = ast.arguments;
              for (let j = 0; j < args.length; j++) {
                this.lookupChain.push({
                  name: requestingNode.name,
                  ast: args[i],
                  requestingNode
                });
                node.argumentTypes[j] = requestingNode.getType(args[j]);
                this.lookupChain.pop();
              }
              return node.returnType = node.getType(node.getJsAST());
            }

            throw new Error('circlical logic detected!');
          }
        }
        this.lookupChain.push({
          name: requestingNode.name,
          ast,
          requestingNode
        });
        const type = node.getType(node.getJsAST());
        this.lookupChain.pop();
        return node.returnType = type;
      }
    }

    return null;
  }

  _getFunction(functionName) {
    if (!this._isFunction(functionName)) {
      new Error(`Function ${functionName} not found`);
    }
    return this.functionMap[functionName];
  }

  _isFunction(functionName) {
    return Boolean(this.functionMap[functionName]);
  }

  _getNativeFunction(functionName) {
    for (let i = 0; i < this.nativeFunctions.length; i++) {
      if (this.nativeFunctions[i].name === functionName) return this.nativeFunctions[i];
    }
    return null;
  }

  _isNativeFunction(functionName) {
    return Boolean(this._getNativeFunction(functionName));
  }

  _lookupNativeFunctionReturnType(functionName) {
    let nativeFunction = this._getNativeFunction(functionName);
    if (nativeFunction) {
      return nativeFunction.returnType;
    }
    throw new Error(`Native function ${ functionName } not found`);
  }

  lookupFunctionArgumentTypes(functionName) {
    if (this._isNativeFunction(functionName)) {
      return this._getNativeFunction(functionName).argumentTypes;
    } else if (this._isFunction(functionName)) {
      return this._getFunction(functionName).argumentTypes;
    }
    return null;
  }

  lookupFunctionArgumentName(functionName, argumentIndex) {
    return this._getFunction(functionName).argumentNames[argumentIndex];
  }

  lookupFunctionArgumentBitRatio(functionName, argumentName) {
    if (!this._isFunction(functionName)) {
      throw new Error('function not found');
    }
    if (this.rootNode.name === functionName) {
      const i = this.rootNode.argumentNames.indexOf(argumentName);
      if (i !== -1) {
        return this.rootNode.argumentBitRatios[i];
      }
    }
    const node = this._getFunction(functionName);
    const i = node.argumentNames.indexOf(argumentName);
    if (i === -1) {
      throw new Error('argument not found');
    }
    const bitRatio = node.argumentBitRatios[i];
    if (typeof bitRatio !== 'number') {
      throw new Error('argument bit ratio not found');
    }
    return bitRatio;
  }

  needsArgumentType(functionName, i) {
    if (!this._isFunction(functionName)) return false;
    const fnNode = this._getFunction(functionName);
    return !fnNode.argumentTypes[i];
  }

  assignArgumentType(functionName, i, argumentType, requestingNode) {
    if (!this._isFunction(functionName)) return;
    const fnNode = this._getFunction(functionName);
    if (!fnNode.argumentTypes[i]) {
      fnNode.argumentTypes[i] = argumentType;
    }
  }

  assignArgumentBitRatio(functionName, argumentName, calleeFunctionName, argumentIndex) {
    const node = this._getFunction(functionName);
    if (this._isNativeFunction(calleeFunctionName)) return null;
    const calleeNode = this._getFunction(calleeFunctionName);
    const i = node.argumentNames.indexOf(argumentName);
    if (i === -1) {
      throw new Error(`Argument ${argumentName} not found in arguments from function ${functionName}`);
    }
    const bitRatio = node.argumentBitRatios[i];
    if (typeof bitRatio !== 'number') {
      throw new Error(`Bit ratio for argument ${argumentName} not found in function ${functionName}`);
    }
    if (!calleeNode.argumentBitRatios) {
      calleeNode.argumentBitRatios = new Array(calleeNode.argumentNames.length);
    }
    const calleeBitRatio = calleeNode.argumentBitRatios[i];
    if (typeof calleeBitRatio === 'number') {
      if (calleeBitRatio !== bitRatio) {
        throw new Error(`Incompatible bit ratio found at function ${functionName} at argument ${argumentName}`);
      }
      return calleeBitRatio;
    }
    calleeNode.argumentBitRatios[i] = bitRatio;
    return bitRatio;
  }

  trackFunctionCall(functionName, calleeFunctionName, args) {
    if (!this.functionNodeDependencies[functionName]) {
      this.functionNodeDependencies[functionName] = new Set();
      this.functionCalls[functionName] = [];
    }
    this.functionNodeDependencies[functionName].add(calleeFunctionName);
    this.functionCalls[functionName].push(args);
  }

  getKernelResultType() {
    return this.rootNode.returnType || this.rootNode.getType(this.rootNode.ast);
  }

  getSubKernelResultType(index) {
    const subKernelNode = this.subKernelNodes[index];
    let called = false;
    for (let functionCallIndex = 0; functionCallIndex < this.rootNode.functionCalls.length; functionCallIndex++) {
      const functionCall = this.rootNode.functionCalls[functionCallIndex];
      if (functionCall.ast.callee.name === subKernelNode.name) {
        called = true;
      }
    }
    if (!called) {
      throw new Error(`SubKernel ${ subKernelNode.name } never called by kernel`);
    }
    return subKernelNode.returnType || subKernelNode.getType(subKernelNode.getJsAST());
  }

  getReturnTypes() {
    const result = {
      [this.rootNode.name]: this.rootNode.getType(this.rootNode.ast),
    };
    const list = this.traceFunctionCalls(this.rootNode.name);
    for (let i = 0; i < list.length; i++) {
      const functionName = list[i];
      const functionNode = this.functionMap[functionName];
      result[functionName] = functionNode.getType(functionNode.ast);
    }
    return result;
  }
}

module.exports = {
  FunctionBuilder
};
},{}],9:[function(require,module,exports){
const acorn = require('acorn');
const { utils } = require('../utils');
const { FunctionTracer } = require('./function-tracer');

class FunctionNode {
  constructor(source, settings) {
    if (!source && !settings.ast) {
      throw new Error('source parameter is missing');
    }
    settings = settings || {};
    this.source = source;
    this.ast = null;
    this.name = typeof source === 'string' ? settings.isRootKernel ?
      'kernel' :
      (settings.name || utils.getFunctionNameFromString(source)) : null;
    this.calledFunctions = [];
    this.constants = {};
    this.constantTypes = {};
    this.constantBitRatios = {};
    this.isRootKernel = false;
    this.isSubKernel = false;
    this.debug = null;
    this.functions = null;
    this.identifiers = null;
    this.contexts = null;
    this.functionCalls = null;
    this.states = [];
    this.needsArgumentType = null;
    this.assignArgumentType = null;
    this.lookupReturnType = null;
    this.lookupFunctionArgumentTypes = null;
    this.lookupFunctionArgumentBitRatio = null;
    this.triggerImplyArgumentType = null;
    this.triggerImplyArgumentBitRatio = null;
    this.onNestedFunction = null;
    this.onFunctionCall = null;
    this.optimizeFloatMemory = null;
    this.precision = null;
    this.loopMaxIterations = null;
    this.argumentNames = (typeof this.source === 'string' ? utils.getArgumentNamesFromString(this.source) : null);
    this.argumentTypes = [];
    this.argumentSizes = [];
    this.argumentBitRatios = null;
    this.returnType = null;
    this.output = [];
    this.plugins = null;
    this.leadingReturnStatement = null;
    this.followingReturnStatement = null;
    this.dynamicOutput = null;
    this.dynamicArguments = null;
    this.strictTypingChecking = false;
    this.fixIntegerDivisionAccuracy = null;

    if (settings) {
      for (const p in settings) {
        if (!settings.hasOwnProperty(p)) continue;
        if (!this.hasOwnProperty(p)) continue;
        this[p] = settings[p];
      }
    }

    this.literalTypes = {};

    this.validate();
    this._string = null;
    this._internalVariableNames = {};
  }

  validate() {
    if (typeof this.source !== 'string' && !this.ast) {
      throw new Error('this.source not a string');
    }

    if (!this.ast && !utils.isFunctionString(this.source)) {
      throw new Error('this.source not a function string');
    }

    if (!this.name) {
      throw new Error('this.name could not be set');
    }

    if (this.argumentTypes.length > 0 && this.argumentTypes.length !== this.argumentNames.length) {
      throw new Error(`argumentTypes count of ${ this.argumentTypes.length } exceeds ${ this.argumentNames.length }`);
    }

    if (this.output.length < 1) {
      throw new Error('this.output is not big enough');
    }
  }

  isIdentifierConstant(name) {
    if (!this.constants) return false;
    return this.constants.hasOwnProperty(name);
  }

  isInput(argumentName) {
    return this.argumentTypes[this.argumentNames.indexOf(argumentName)] === 'Input';
  }

  pushState(state) {
    this.states.push(state);
  }

  popState(state) {
    if (this.state !== state) {
      throw new Error(`Cannot popState ${ state } when in ${ this.state }`);
    }
    this.states.pop();
  }

  isState(state) {
    return this.state === state;
  }

  get state() {
    return this.states[this.states.length - 1];
  }

  astMemberExpressionUnroll(ast) {
    if (ast.type === 'Identifier') {
      return ast.name;
    } else if (ast.type === 'ThisExpression') {
      return 'this';
    }

    if (ast.type === 'MemberExpression') {
      if (ast.object && ast.property) {
        if (ast.object.hasOwnProperty('name') && ast.object.name !== 'Math') {
          return this.astMemberExpressionUnroll(ast.property);
        }

        return (
          this.astMemberExpressionUnroll(ast.object) +
          '.' +
          this.astMemberExpressionUnroll(ast.property)
        );
      }
    }

    if (ast.hasOwnProperty('expressions')) {
      const firstExpression = ast.expressions[0];
      if (firstExpression.type === 'Literal' && firstExpression.value === 0 && ast.expressions.length === 2) {
        return this.astMemberExpressionUnroll(ast.expressions[1]);
      }
    }

    throw this.astErrorOutput('Unknown astMemberExpressionUnroll', ast);
  }

  getJsAST(inParser) {
    if (this.ast) {
      return this.ast;
    }
    if (typeof this.source === 'object') {
      this.traceFunctionAST(this.source);
      return this.ast = this.source;
    }

    inParser = inParser || acorn;
    if (inParser === null) {
      throw new Error('Missing JS to AST parser');
    }

    const ast = Object.freeze(inParser.parse(`const parser_${ this.name } = ${ this.source };`, {
      locations: true
    }));
    const functionAST = ast.body[0].declarations[0].init;
    this.traceFunctionAST(functionAST);

    if (!ast) {
      throw new Error('Failed to parse JS code');
    }

    return this.ast = functionAST;
  }

  traceFunctionAST(ast) {
    const { contexts, declarations, functions, identifiers, functionCalls } = new FunctionTracer(ast);
    this.contexts = contexts;
    this.identifiers = identifiers;
    this.functionCalls = functionCalls;
    this.functions = functions;
    for (let i = 0; i < declarations.length; i++) {
      const declaration = declarations[i];
      const { ast, inForLoopInit, inForLoopTest } = declaration;
      const { init } = ast;
      const dependencies = this.getDependencies(init);
      let valueType = null;

      if (inForLoopInit && inForLoopTest) {
        valueType = 'Integer';
      } else {
        if (init) {
          const realType = this.getType(init);
          switch (realType) {
            case 'Integer':
            case 'Float':
            case 'Number':
              if (init.type === 'MemberExpression') {
                valueType = realType;
              } else {
                valueType = 'Number';
              }
              break;
            case 'LiteralInteger':
              valueType = 'Number';
              break;
            default:
              valueType = realType;
          }
        }
      }
      declaration.valueType = valueType;
      declaration.dependencies = dependencies;
      declaration.isSafe = this.isSafeDependencies(dependencies);
    }

    for (let i = 0; i < functions.length; i++) {
      this.onNestedFunction(functions[i], this.source);
    }
  }

  getDeclaration(ast) {
    for (let i = 0; i < this.identifiers.length; i++) {
      const identifier = this.identifiers[i];
      if (ast === identifier.ast) {
        return identifier.declaration;
      }
    }
    return null;
  }

  getVariableType(ast) {
    if (ast.type !== 'Identifier') {
      throw new Error(`ast of ${ast.type} not "Identifier"`);
    }
    let type = null;
    const argumentIndex = this.argumentNames.indexOf(ast.name);
    if (argumentIndex === -1) {
      const declaration = this.getDeclaration(ast);
      if (declaration) {
        return declaration.valueType;
      }
    } else {
      const argumentType = this.argumentTypes[argumentIndex];
      if (argumentType) {
        type = argumentType;
      }
    }
    if (!type && this.strictTypingChecking) {
      throw new Error(`Declaration of ${name} not found`);
    }
    return type;
  }

  getLookupType(type) {
    if (!typeLookupMap.hasOwnProperty(type)) {
      throw new Error(`unknown typeLookupMap ${ type }`);
    }
    return typeLookupMap[type];
  }

  getConstantType(constantName) {
    if (this.constantTypes[constantName]) {
      const type = this.constantTypes[constantName];
      if (type === 'Float') {
        return 'Number';
      } else {
        return type;
      }
    }
    throw new Error(`Type for constant "${ constantName }" not declared`);
  }

  toString() {
    if (this._string) return this._string;
    return this._string = this.astGeneric(this.getJsAST(), []).join('').trim();
  }

  toJSON() {
    const settings = {
      source: this.source,
      name: this.name,
      constants: this.constants,
      constantTypes: this.constantTypes,
      isRootKernel: this.isRootKernel,
      isSubKernel: this.isSubKernel,
      debug: this.debug,
      output: this.output,
      loopMaxIterations: this.loopMaxIterations,
      argumentNames: this.argumentNames,
      argumentTypes: this.argumentTypes,
      argumentSizes: this.argumentSizes,
      returnType: this.returnType,
      leadingReturnStatement: this.leadingReturnStatement,
      followingReturnStatement: this.followingReturnStatement,
    };

    return {
      ast: this.ast,
      settings
    };
  }

  getType(ast) {
    if (Array.isArray(ast)) {
      return this.getType(ast[ast.length - 1]);
    }
    switch (ast.type) {
      case 'BlockStatement':
        return this.getType(ast.body);
      case 'ArrayExpression':
        const childType = this.getType(ast.elements[0]);
        switch (childType) {
          case 'Array(2)':
          case 'Array(3)':
          case 'Array(4)':
            return `Matrix(${ast.elements.length})`;
        }
        return `Array(${ ast.elements.length })`;
      case 'Literal':
        const literalKey = this.astKey(ast);
        if (this.literalTypes[literalKey]) {
          return this.literalTypes[literalKey];
        }
        if (Number.isInteger(ast.value)) {
          return 'LiteralInteger';
        } else if (ast.value === true || ast.value === false) {
          return 'Boolean';
        } else {
          return 'Number';
        }
        case 'AssignmentExpression':
          return this.getType(ast.left);
        case 'CallExpression':
          if (this.isAstMathFunction(ast)) {
            return 'Number';
          }
          if (!ast.callee || !ast.callee.name) {
            if (ast.callee.type === 'SequenceExpression' && ast.callee.expressions[ast.callee.expressions.length - 1].property.name) {
              const functionName = ast.callee.expressions[ast.callee.expressions.length - 1].property.name;
              this.inferArgumentTypesIfNeeded(functionName, ast.arguments);
              return this.lookupReturnType(functionName, ast, this);
            }
            if (this.getVariableSignature(ast.callee, true) === 'this.color') {
              return null;
            }
            if (ast.callee.type === 'MemberExpression' && ast.callee.object && ast.callee.property && ast.callee.property.name && ast.arguments) {
              const functionName = ast.callee.property.name;
              this.inferArgumentTypesIfNeeded(functionName, ast.arguments);
              return this.lookupReturnType(functionName, ast, this);
            }
            throw this.astErrorOutput('Unknown call expression', ast);
          }
          if (ast.callee && ast.callee.name) {
            const functionName = ast.callee.name;
            this.inferArgumentTypesIfNeeded(functionName, ast.arguments);
            return this.lookupReturnType(functionName, ast, this);
          }
          throw this.astErrorOutput(`Unhandled getType Type "${ ast.type }"`, ast);
        case 'LogicalExpression':
          return 'Boolean';
        case 'BinaryExpression':
          switch (ast.operator) {
            case '%':
            case '/':
              if (this.fixIntegerDivisionAccuracy) {
                return 'Number';
              } else {
                break;
              }
              case '>':
              case '<':
                return 'Boolean';
              case '&':
              case '|':
              case '^':
              case '<<':
              case '>>':
              case '>>>':
                return 'Integer';
          }
          const type = this.getType(ast.left);
          if (this.isState('skip-literal-correction')) return type;
          if (type === 'LiteralInteger') {
            const rightType = this.getType(ast.right);
            if (rightType === 'LiteralInteger') {
              if (ast.left.value % 1 === 0) {
                return 'Integer';
              } else {
                return 'Float';
              }
            }
            return rightType;
          }
          return typeLookupMap[type] || type;
        case 'UpdateExpression':
          return this.getType(ast.argument);
        case 'UnaryExpression':
          if (ast.operator === '~') {
            return 'Integer';
          }
          return this.getType(ast.argument);
        case 'VariableDeclaration': {
          const declarations = ast.declarations;
          let lastType;
          for (let i = 0; i < declarations.length; i++) {
            const declaration = declarations[i];
            lastType = this.getType(declaration);
          }
          if (!lastType) {
            throw this.astErrorOutput(`Unable to find type for declaration`, ast);
          }
          return lastType;
        }
        case 'VariableDeclarator':
          const declaration = this.getDeclaration(ast.id);
          if (!declaration) {
            throw this.astErrorOutput(`Unable to find declarator`, ast);
          }

          if (!declaration.valueType) {
            throw this.astErrorOutput(`Unable to find declarator valueType`, ast);
          }

          return declaration.valueType;
        case 'Identifier':
          if (ast.name === 'Infinity') {
            return 'Number';
          }
          if (this.isAstVariable(ast)) {
            const signature = this.getVariableSignature(ast);
            if (signature === 'value') {
              return this.getCheckVariableType(ast);
            }
          }
          const origin = this.findIdentifierOrigin(ast);
          if (origin && origin.init) {
            return this.getType(origin.init);
          }
          return null;
        case 'ReturnStatement':
          return this.getType(ast.argument);
        case 'MemberExpression':
          if (this.isAstMathFunction(ast)) {
            switch (ast.property.name) {
              case 'ceil':
                return 'Integer';
              case 'floor':
                return 'Integer';
              case 'round':
                return 'Integer';
            }
            return 'Number';
          }
          if (this.isAstVariable(ast)) {
            const variableSignature = this.getVariableSignature(ast);
            switch (variableSignature) {
              case 'value[]':
                return this.getLookupType(this.getCheckVariableType(ast.object));
              case 'value[][]':
                return this.getLookupType(this.getCheckVariableType(ast.object.object));
              case 'value[][][]':
                return this.getLookupType(this.getCheckVariableType(ast.object.object.object));
              case 'value[][][][]':
                return this.getLookupType(this.getCheckVariableType(ast.object.object.object.object));
              case 'value.thread.value':
              case 'this.thread.value':
                return 'Integer';
              case 'this.output.value':
                return this.dynamicOutput ? 'Integer' : 'LiteralInteger';
              case 'this.constants.value':
                return this.getConstantType(ast.property.name);
              case 'this.constants.value[]':
                return this.getLookupType(this.getConstantType(ast.object.property.name));
              case 'this.constants.value[][]':
                return this.getLookupType(this.getConstantType(ast.object.object.property.name));
              case 'this.constants.value[][][]':
                return this.getLookupType(this.getConstantType(ast.object.object.object.property.name));
              case 'this.constants.value[][][][]':
                return this.getLookupType(this.getConstantType(ast.object.object.object.object.property.name));
              case 'fn()[]':
              case 'fn()[][]':
              case 'fn()[][][]':
                return this.getLookupType(this.getType(ast.object));
              case 'value.value':
                if (this.isAstMathVariable(ast)) {
                  return 'Number';
                }
                switch (ast.property.name) {
                  case 'r':
                  case 'g':
                  case 'b':
                  case 'a':
                    return this.getLookupType(this.getCheckVariableType(ast.object));
                }
                case '[][]':
                  return 'Number';
            }
            throw this.astErrorOutput('Unhandled getType MemberExpression', ast);
          }
          throw this.astErrorOutput('Unhandled getType MemberExpression', ast);
        case 'ConditionalExpression':
          return this.getType(ast.consequent);
        case 'FunctionDeclaration':
        case 'FunctionExpression':
          const lastReturn = this.findLastReturn(ast.body);
          if (lastReturn) {
            return this.getType(lastReturn);
          }
          return null;
        case 'IfStatement':
          return this.getType(ast.consequent);
        case 'SequenceExpression':
          return this.getType(ast.expressions[ast.expressions.length - 1]);
        default:
          throw this.astErrorOutput(`Unhandled getType Type "${ ast.type }"`, ast);
    }
  }

  getCheckVariableType(ast) {
    const type = this.getVariableType(ast);
    if (!type) {
      throw this.astErrorOutput(`${ast.type} is not defined`, ast);
    }
    return type;
  }

  inferArgumentTypesIfNeeded(functionName, args) {
    for (let i = 0; i < args.length; i++) {
      if (!this.needsArgumentType(functionName, i)) continue;
      const type = this.getType(args[i]);
      if (!type) {
        throw this.astErrorOutput(`Unable to infer argument ${i}`, args[i]);
      }
      this.assignArgumentType(functionName, i, type);
    }
  }

  isAstMathVariable(ast) {
    const mathProperties = [
      'E',
      'PI',
      'SQRT2',
      'SQRT1_2',
      'LN2',
      'LN10',
      'LOG2E',
      'LOG10E',
    ];
    return ast.type === 'MemberExpression' &&
      ast.object && ast.object.type === 'Identifier' &&
      ast.object.name === 'Math' &&
      ast.property &&
      ast.property.type === 'Identifier' &&
      mathProperties.indexOf(ast.property.name) > -1;
  }

  isAstMathFunction(ast) {
    const mathFunctions = [
      'abs',
      'acos',
      'acosh',
      'asin',
      'asinh',
      'atan',
      'atan2',
      'atanh',
      'cbrt',
      'ceil',
      'clz32',
      'cos',
      'cosh',
      'expm1',
      'exp',
      'floor',
      'fround',
      'imul',
      'log',
      'log2',
      'log10',
      'log1p',
      'max',
      'min',
      'pow',
      'random',
      'round',
      'sign',
      'sin',
      'sinh',
      'sqrt',
      'tan',
      'tanh',
      'trunc',
    ];
    return ast.type === 'CallExpression' &&
      ast.callee &&
      ast.callee.type === 'MemberExpression' &&
      ast.callee.object &&
      ast.callee.object.type === 'Identifier' &&
      ast.callee.object.name === 'Math' &&
      ast.callee.property &&
      ast.callee.property.type === 'Identifier' &&
      mathFunctions.indexOf(ast.callee.property.name) > -1;
  }

  isAstVariable(ast) {
    return ast.type === 'Identifier' || ast.type === 'MemberExpression';
  }

  isSafe(ast) {
    return this.isSafeDependencies(this.getDependencies(ast));
  }

  isSafeDependencies(dependencies) {
    return dependencies && dependencies.every ? dependencies.every(dependency => dependency.isSafe) : true;
  }

  getDependencies(ast, dependencies, isNotSafe) {
    if (!dependencies) {
      dependencies = [];
    }
    if (!ast) return null;
    if (Array.isArray(ast)) {
      for (let i = 0; i < ast.length; i++) {
        this.getDependencies(ast[i], dependencies, isNotSafe);
      }
      return dependencies;
    }
    switch (ast.type) {
      case 'AssignmentExpression':
        this.getDependencies(ast.left, dependencies, isNotSafe);
        this.getDependencies(ast.right, dependencies, isNotSafe);
        return dependencies;
      case 'ConditionalExpression':
        this.getDependencies(ast.test, dependencies, isNotSafe);
        this.getDependencies(ast.alternate, dependencies, isNotSafe);
        this.getDependencies(ast.consequent, dependencies, isNotSafe);
        return dependencies;
      case 'Literal':
        dependencies.push({
          origin: 'literal',
          value: ast.value,
          isSafe: isNotSafe === true ? false : ast.value > -Infinity && ast.value < Infinity && !isNaN(ast.value)
        });
        break;
      case 'VariableDeclarator':
        return this.getDependencies(ast.init, dependencies, isNotSafe);
      case 'Identifier':
        const declaration = this.getDeclaration(ast);
        if (declaration) {
          dependencies.push({
            name: ast.name,
            origin: 'declaration',
            isSafe: isNotSafe ? false : this.isSafeDependencies(declaration.dependencies),
          });
        } else if (this.argumentNames.indexOf(ast.name) > -1) {
          dependencies.push({
            name: ast.name,
            origin: 'argument',
            isSafe: false,
          });
        } else if (this.strictTypingChecking) {
          throw new Error(`Cannot find identifier origin "${ast.name}"`);
        }
        break;
      case 'FunctionDeclaration':
        return this.getDependencies(ast.body.body[ast.body.body.length - 1], dependencies, isNotSafe);
      case 'ReturnStatement':
        return this.getDependencies(ast.argument, dependencies);
      case 'BinaryExpression':
      case 'LogicalExpression':
        isNotSafe = (ast.operator === '/' || ast.operator === '*');
        this.getDependencies(ast.left, dependencies, isNotSafe);
        this.getDependencies(ast.right, dependencies, isNotSafe);
        return dependencies;
      case 'UnaryExpression':
      case 'UpdateExpression':
        return this.getDependencies(ast.argument, dependencies, isNotSafe);
      case 'VariableDeclaration':
        return this.getDependencies(ast.declarations, dependencies, isNotSafe);
      case 'ArrayExpression':
        dependencies.push({
          origin: 'declaration',
          isSafe: true,
        });
        return dependencies;
      case 'CallExpression':
        dependencies.push({
          origin: 'function',
          isSafe: true,
        });
        return dependencies;
      case 'MemberExpression':
        const details = this.getMemberExpressionDetails(ast);
        switch (details.signature) {
          case 'value[]':
            this.getDependencies(ast.object, dependencies, isNotSafe);
            break;
          case 'value[][]':
            this.getDependencies(ast.object.object, dependencies, isNotSafe);
            break;
          case 'value[][][]':
            this.getDependencies(ast.object.object.object, dependencies, isNotSafe);
            break;
          case 'this.output.value':
            if (this.dynamicOutput) {
              dependencies.push({
                name: details.name,
                origin: 'output',
                isSafe: false,
              });
            }
            break;
        }
        if (details) {
          if (details.property) {
            this.getDependencies(details.property, dependencies, isNotSafe);
          }
          if (details.xProperty) {
            this.getDependencies(details.xProperty, dependencies, isNotSafe);
          }
          if (details.yProperty) {
            this.getDependencies(details.yProperty, dependencies, isNotSafe);
          }
          if (details.zProperty) {
            this.getDependencies(details.zProperty, dependencies, isNotSafe);
          }
          return dependencies;
        }
        case 'SequenceExpression':
          return this.getDependencies(ast.expressions, dependencies, isNotSafe);
        default:
          throw this.astErrorOutput(`Unhandled type ${ ast.type } in getDependencies`, ast);
    }
    return dependencies;
  }

  getVariableSignature(ast, returnRawValue) {
    if (!this.isAstVariable(ast)) {
      throw new Error(`ast of type "${ ast.type }" is not a variable signature`);
    }
    if (ast.type === 'Identifier') {
      return 'value';
    }
    const signature = [];
    while (true) {
      if (!ast) break;
      if (ast.computed) {
        signature.push('[]');
      } else if (ast.type === 'ThisExpression') {
        signature.unshift('this');
      } else if (ast.property && ast.property.name) {
        if (
          ast.property.name === 'x' ||
          ast.property.name === 'y' ||
          ast.property.name === 'z'
        ) {
          signature.unshift(returnRawValue ? '.' + ast.property.name : '.value');
        } else if (
          ast.property.name === 'constants' ||
          ast.property.name === 'thread' ||
          ast.property.name === 'output'
        ) {
          signature.unshift('.' + ast.property.name);
        } else {
          signature.unshift(returnRawValue ? '.' + ast.property.name : '.value');
        }
      } else if (ast.name) {
        signature.unshift(returnRawValue ? ast.name : 'value');
      } else if (ast.callee && ast.callee.name) {
        signature.unshift(returnRawValue ? ast.callee.name + '()' : 'fn()');
      } else if (ast.elements) {
        signature.unshift('[]');
      } else {
        signature.unshift('unknown');
      }
      ast = ast.object;
    }

    const signatureString = signature.join('');
    if (returnRawValue) {
      return signatureString;
    }

    const allowedExpressions = [
      'value',
      'value[]',
      'value[][]',
      'value[][][]',
      'value[][][][]',
      'value.value',
      'value.thread.value',
      'this.thread.value',
      'this.output.value',
      'this.constants.value',
      'this.constants.value[]',
      'this.constants.value[][]',
      'this.constants.value[][][]',
      'this.constants.value[][][][]',
      'fn()[]',
      'fn()[][]',
      'fn()[][][]',
      '[][]',
    ];
    if (allowedExpressions.indexOf(signatureString) > -1) {
      return signatureString;
    }
    return null;
  }

  build() {
    return this.toString().length > 0;
  }

  astGeneric(ast, retArr) {
    if (ast === null) {
      throw this.astErrorOutput('NULL ast', ast);
    } else {
      if (Array.isArray(ast)) {
        for (let i = 0; i < ast.length; i++) {
          this.astGeneric(ast[i], retArr);
        }
        return retArr;
      }

      switch (ast.type) {
        case 'FunctionDeclaration':
          return this.astFunctionDeclaration(ast, retArr);
        case 'FunctionExpression':
          return this.astFunctionExpression(ast, retArr);
        case 'ReturnStatement':
          return this.astReturnStatement(ast, retArr);
        case 'Literal':
          return this.astLiteral(ast, retArr);
        case 'BinaryExpression':
          return this.astBinaryExpression(ast, retArr);
        case 'Identifier':
          return this.astIdentifierExpression(ast, retArr);
        case 'AssignmentExpression':
          return this.astAssignmentExpression(ast, retArr);
        case 'ExpressionStatement':
          return this.astExpressionStatement(ast, retArr);
        case 'EmptyStatement':
          return this.astEmptyStatement(ast, retArr);
        case 'BlockStatement':
          return this.astBlockStatement(ast, retArr);
        case 'IfStatement':
          return this.astIfStatement(ast, retArr);
        case 'SwitchStatement':
          return this.astSwitchStatement(ast, retArr);
        case 'BreakStatement':
          return this.astBreakStatement(ast, retArr);
        case 'ContinueStatement':
          return this.astContinueStatement(ast, retArr);
        case 'ForStatement':
          return this.astForStatement(ast, retArr);
        case 'WhileStatement':
          return this.astWhileStatement(ast, retArr);
        case 'DoWhileStatement':
          return this.astDoWhileStatement(ast, retArr);
        case 'VariableDeclaration':
          return this.astVariableDeclaration(ast, retArr);
        case 'VariableDeclarator':
          return this.astVariableDeclarator(ast, retArr);
        case 'ThisExpression':
          return this.astThisExpression(ast, retArr);
        case 'SequenceExpression':
          return this.astSequenceExpression(ast, retArr);
        case 'UnaryExpression':
          return this.astUnaryExpression(ast, retArr);
        case 'UpdateExpression':
          return this.astUpdateExpression(ast, retArr);
        case 'LogicalExpression':
          return this.astLogicalExpression(ast, retArr);
        case 'MemberExpression':
          return this.astMemberExpression(ast, retArr);
        case 'CallExpression':
          return this.astCallExpression(ast, retArr);
        case 'ArrayExpression':
          return this.astArrayExpression(ast, retArr);
        case 'DebuggerStatement':
          return this.astDebuggerStatement(ast, retArr);
        case 'ConditionalExpression':
          return this.astConditionalExpression(ast, retArr);
      }

      throw this.astErrorOutput('Unknown ast type : ' + ast.type, ast);
    }
  }
  astErrorOutput(error, ast) {
    if (typeof this.source !== 'string') {
      return new Error(error);
    }

    const debugString = utils.getAstString(this.source, ast);
    const leadingSource = this.source.substr(ast.start);
    const splitLines = leadingSource.split(/\n/);
    const lineBefore = splitLines.length > 0 ? splitLines[splitLines.length - 1] : 0;
    return new Error(`${error} on line ${ splitLines.length }, position ${ lineBefore.length }:\n ${ debugString }`);
  }

  astDebuggerStatement(arrNode, retArr) {
    return retArr;
  }

  astConditionalExpression(ast, retArr) {
    if (ast.type !== 'ConditionalExpression') {
      throw this.astErrorOutput('Not a conditional expression', ast);
    }
    retArr.push('(');
    this.astGeneric(ast.test, retArr);
    retArr.push('?');
    this.astGeneric(ast.consequent, retArr);
    retArr.push(':');
    this.astGeneric(ast.alternate, retArr);
    retArr.push(')');
    return retArr;
  }

  astFunction(ast, retArr) {
    throw new Error(`"astFunction" not defined on ${ this.constructor.name }`);
  }

  astFunctionDeclaration(ast, retArr) {
    if (this.isChildFunction(ast)) {
      return retArr;
    }
    return this.astFunction(ast, retArr);
  }
  astFunctionExpression(ast, retArr) {
    if (this.isChildFunction(ast)) {
      return retArr;
    }
    return this.astFunction(ast, retArr);
  }
  isChildFunction(ast) {
    for (let i = 0; i < this.functions.length; i++) {
      if (this.functions[i] === ast) {
        return true;
      }
    }
    return false;
  }
  astReturnStatement(ast, retArr) {
    return retArr;
  }
  astLiteral(ast, retArr) {
    this.literalTypes[this.astKey(ast)] = 'Number';
    return retArr;
  }
  astBinaryExpression(ast, retArr) {
    return retArr;
  }
  astIdentifierExpression(ast, retArr) {
    return retArr;
  }
  astAssignmentExpression(ast, retArr) {
    return retArr;
  }
  astExpressionStatement(esNode, retArr) {
    this.astGeneric(esNode.expression, retArr);
    retArr.push(';');
    return retArr;
  }
  astEmptyStatement(eNode, retArr) {
    return retArr;
  }
  astBlockStatement(ast, retArr) {
    return retArr;
  }
  astIfStatement(ast, retArr) {
    return retArr;
  }
  astSwitchStatement(ast, retArr) {
    return retArr;
  }
  astBreakStatement(brNode, retArr) {
    retArr.push('break;');
    return retArr;
  }
  astContinueStatement(crNode, retArr) {
    retArr.push('continue;\n');
    return retArr;
  }
  astForStatement(ast, retArr) {
    return retArr;
  }
  astWhileStatement(ast, retArr) {
    return retArr;
  }
  astDoWhileStatement(ast, retArr) {
    return retArr;
  }
  astVariableDeclarator(iVarDecNode, retArr) {
    this.astGeneric(iVarDecNode.id, retArr);
    if (iVarDecNode.init !== null) {
      retArr.push('=');
      this.astGeneric(iVarDecNode.init, retArr);
    }
    return retArr;
  }
  astThisExpression(ast, retArr) {
    return retArr;
  }
  astSequenceExpression(sNode, retArr) {
    const { expressions } = sNode;
    const sequenceResult = [];
    for (let i = 0; i < expressions.length; i++) {
      const expression = expressions[i];
      const expressionResult = [];
      this.astGeneric(expression, expressionResult);
      sequenceResult.push(expressionResult.join(''));
    }
    if (sequenceResult.length > 1) {
      retArr.push('(', sequenceResult.join(','), ')');
    } else {
      retArr.push(sequenceResult[0]);
    }
    return retArr;
  }
  astUnaryExpression(uNode, retArr) {
    const unaryResult = this.checkAndUpconvertBitwiseUnary(uNode, retArr);
    if (unaryResult) {
      return retArr;
    }

    if (uNode.prefix) {
      retArr.push(uNode.operator);
      this.astGeneric(uNode.argument, retArr);
    } else {
      this.astGeneric(uNode.argument, retArr);
      retArr.push(uNode.operator);
    }

    return retArr;
  }

  checkAndUpconvertBitwiseUnary(uNode, retArr) {}

  astUpdateExpression(uNode, retArr) {
    if (uNode.prefix) {
      retArr.push(uNode.operator);
      this.astGeneric(uNode.argument, retArr);
    } else {
      this.astGeneric(uNode.argument, retArr);
      retArr.push(uNode.operator);
    }

    return retArr;
  }
  astLogicalExpression(logNode, retArr) {
    retArr.push('(');
    this.astGeneric(logNode.left, retArr);
    retArr.push(logNode.operator);
    this.astGeneric(logNode.right, retArr);
    retArr.push(')');
    return retArr;
  }
  astMemberExpression(ast, retArr) {
    return retArr;
  }
  astCallExpression(ast, retArr) {
    return retArr;
  }
  astArrayExpression(ast, retArr) {
    return retArr;
  }

  getMemberExpressionDetails(ast) {
    if (ast.type !== 'MemberExpression') {
      throw this.astErrorOutput(`Expression ${ ast.type } not a MemberExpression`, ast);
    }
    let name = null;
    let type = null;
    const variableSignature = this.getVariableSignature(ast);
    switch (variableSignature) {
      case 'value':
        return null;
      case 'value.thread.value':
      case 'this.thread.value':
      case 'this.output.value':
        return {
          signature: variableSignature,
            type: 'Integer',
            name: ast.property.name
        };
      case 'value[]':
        if (typeof ast.object.name !== 'string') {
          throw this.astErrorOutput('Unexpected expression', ast);
        }
        name = ast.object.name;
        return {
          name,
          origin: 'user',
            signature: variableSignature,
            type: this.getVariableType(ast.object),
            xProperty: ast.property
        };
      case 'value[][]':
        if (typeof ast.object.object.name !== 'string') {
          throw this.astErrorOutput('Unexpected expression', ast);
        }
        name = ast.object.object.name;
        return {
          name,
          origin: 'user',
            signature: variableSignature,
            type: this.getVariableType(ast.object.object),
            yProperty: ast.object.property,
            xProperty: ast.property,
        };
      case 'value[][][]':
        if (typeof ast.object.object.object.name !== 'string') {
          throw this.astErrorOutput('Unexpected expression', ast);
        }
        name = ast.object.object.object.name;
        return {
          name,
          origin: 'user',
            signature: variableSignature,
            type: this.getVariableType(ast.object.object.object),
            zProperty: ast.object.object.property,
            yProperty: ast.object.property,
            xProperty: ast.property,
        };
      case 'value[][][][]':
        if (typeof ast.object.object.object.object.name !== 'string') {
          throw this.astErrorOutput('Unexpected expression', ast);
        }
        name = ast.object.object.object.object.name;
        return {
          name,
          origin: 'user',
            signature: variableSignature,
            type: this.getVariableType(ast.object.object.object.object),
            zProperty: ast.object.object.property,
            yProperty: ast.object.property,
            xProperty: ast.property,
        };
      case 'value.value':
        if (typeof ast.property.name !== 'string') {
          throw this.astErrorOutput('Unexpected expression', ast);
        }
        if (this.isAstMathVariable(ast)) {
          name = ast.property.name;
          return {
            name,
            origin: 'Math',
            type: 'Number',
            signature: variableSignature,
          };
        }
        switch (ast.property.name) {
          case 'r':
          case 'g':
          case 'b':
          case 'a':
            name = ast.object.name;
            return {
              name,
              property: ast.property.name,
                origin: 'user',
                signature: variableSignature,
                type: 'Number'
            };
          default:
            throw this.astErrorOutput('Unexpected expression', ast);
        }
        case 'this.constants.value':
          if (typeof ast.property.name !== 'string') {
            throw this.astErrorOutput('Unexpected expression', ast);
          }
          name = ast.property.name;
          type = this.getConstantType(name);
          if (!type) {
            throw this.astErrorOutput('Constant has no type', ast);
          }
          return {
            name,
            type,
            origin: 'constants',
              signature: variableSignature,
          };
        case 'this.constants.value[]':
          if (typeof ast.object.property.name !== 'string') {
            throw this.astErrorOutput('Unexpected expression', ast);
          }
          name = ast.object.property.name;
          type = this.getConstantType(name);
          if (!type) {
            throw this.astErrorOutput('Constant has no type', ast);
          }
          return {
            name,
            type,
            origin: 'constants',
              signature: variableSignature,
              xProperty: ast.property,
          };
        case 'this.constants.value[][]': {
          if (typeof ast.object.object.property.name !== 'string') {
            throw this.astErrorOutput('Unexpected expression', ast);
          }
          name = ast.object.object.property.name;
          type = this.getConstantType(name);
          if (!type) {
            throw this.astErrorOutput('Constant has no type', ast);
          }
          return {
            name,
            type,
            origin: 'constants',
            signature: variableSignature,
            yProperty: ast.object.property,
            xProperty: ast.property,
          };
        }
        case 'this.constants.value[][][]': {
          if (typeof ast.object.object.object.property.name !== 'string') {
            throw this.astErrorOutput('Unexpected expression', ast);
          }
          name = ast.object.object.object.property.name;
          type = this.getConstantType(name);
          if (!type) {
            throw this.astErrorOutput('Constant has no type', ast);
          }
          return {
            name,
            type,
            origin: 'constants',
            signature: variableSignature,
            zProperty: ast.object.object.property,
            yProperty: ast.object.property,
            xProperty: ast.property,
          };
        }
        case 'fn()[]':
        case 'fn()[][]':
        case '[][]':
          return {
            signature: variableSignature,
              property: ast.property,
          };
        default:
          throw this.astErrorOutput('Unexpected expression', ast);
    }
  }

  findIdentifierOrigin(astToFind) {
    const stack = [this.ast];

    while (stack.length > 0) {
      const atNode = stack[0];
      if (atNode.type === 'VariableDeclarator' && atNode.id && atNode.id.name && atNode.id.name === astToFind.name) {
        return atNode;
      }
      stack.shift();
      if (atNode.argument) {
        stack.push(atNode.argument);
      } else if (atNode.body) {
        stack.push(atNode.body);
      } else if (atNode.declarations) {
        stack.push(atNode.declarations);
      } else if (Array.isArray(atNode)) {
        for (let i = 0; i < atNode.length; i++) {
          stack.push(atNode[i]);
        }
      }
    }
    return null;
  }

  findLastReturn(ast) {
    const stack = [ast || this.ast];

    while (stack.length > 0) {
      const atNode = stack.pop();
      if (atNode.type === 'ReturnStatement') {
        return atNode;
      }
      if (atNode.type === 'FunctionDeclaration') {
        continue;
      }
      if (atNode.argument) {
        stack.push(atNode.argument);
      } else if (atNode.body) {
        stack.push(atNode.body);
      } else if (atNode.declarations) {
        stack.push(atNode.declarations);
      } else if (Array.isArray(atNode)) {
        for (let i = 0; i < atNode.length; i++) {
          stack.push(atNode[i]);
        }
      } else if (atNode.consequent) {
        stack.push(atNode.consequent);
      } else if (atNode.cases) {
        stack.push(atNode.cases);
      }
    }
    return null;
  }

  getInternalVariableName(name) {
    if (!this._internalVariableNames.hasOwnProperty(name)) {
      this._internalVariableNames[name] = 0;
    }
    this._internalVariableNames[name]++;
    if (this._internalVariableNames[name] === 1) {
      return name;
    }
    return name + this._internalVariableNames[name];
  }

  astKey(ast, separator = ',') {
    if (!ast.start || !ast.end) throw new Error('AST start and end needed');
    return `${ast.start}${separator}${ast.end}`;
  }
}

const typeLookupMap = {
  'Number': 'Number',
  'Float': 'Float',
  'Integer': 'Integer',
  'Array': 'Number',
  'Array(2)': 'Number',
  'Array(3)': 'Number',
  'Array(4)': 'Number',
  'Matrix(2)': 'Number',
  'Matrix(3)': 'Number',
  'Matrix(4)': 'Number',
  'Array2D': 'Number',
  'Array3D': 'Number',
  'Input': 'Number',
  'HTMLCanvas': 'Array(4)',
  'OffscreenCanvas': 'Array(4)',
  'HTMLImage': 'Array(4)',
  'ImageBitmap': 'Array(4)',
  'ImageData': 'Array(4)',
  'HTMLVideo': 'Array(4)',
  'HTMLImageArray': 'Array(4)',
  'NumberTexture': 'Number',
  'MemoryOptimizedNumberTexture': 'Number',
  'Array1D(2)': 'Array(2)',
  'Array1D(3)': 'Array(3)',
  'Array1D(4)': 'Array(4)',
  'Array2D(2)': 'Array(2)',
  'Array2D(3)': 'Array(3)',
  'Array2D(4)': 'Array(4)',
  'Array3D(2)': 'Array(2)',
  'Array3D(3)': 'Array(3)',
  'Array3D(4)': 'Array(4)',
  'ArrayTexture(1)': 'Number',
  'ArrayTexture(2)': 'Array(2)',
  'ArrayTexture(3)': 'Array(3)',
  'ArrayTexture(4)': 'Array(4)',
};

module.exports = {
  FunctionNode
};
},{"../utils":113,"./function-tracer":10,"acorn":1}],10:[function(require,module,exports){
const { utils } = require('../utils');

function last(array) {
  return array.length > 0 ? array[array.length - 1] : null;
}

const states = {
  trackIdentifiers: 'trackIdentifiers',
  memberExpression: 'memberExpression',
  inForLoopInit: 'inForLoopInit'
};

class FunctionTracer {
  constructor(ast) {
    this.runningContexts = [];
    this.functionContexts = [];
    this.contexts = [];
    this.functionCalls = [];
    this.declarations = [];
    this.identifiers = [];
    this.functions = [];
    this.returnStatements = [];
    this.trackedIdentifiers = null;
    this.states = [];
    this.newFunctionContext();
    this.scan(ast);
  }

  isState(state) {
    return this.states[this.states.length - 1] === state;
  }

  hasState(state) {
    return this.states.indexOf(state) > -1;
  }

  pushState(state) {
    this.states.push(state);
  }

  popState(state) {
    if (this.isState(state)) {
      this.states.pop();
    } else {
      throw new Error(`Cannot pop the non-active state "${state}"`);
    }
  }

  get currentFunctionContext() {
    return last(this.functionContexts);
  }

  get currentContext() {
    return last(this.runningContexts);
  }

  newFunctionContext() {
    const newContext = { '@contextType': 'function' };
    this.contexts.push(newContext);
    this.functionContexts.push(newContext);
  }

  newContext(run) {
    const newContext = Object.assign({ '@contextType': 'const/let' }, this.currentContext);
    this.contexts.push(newContext);
    this.runningContexts.push(newContext);
    run();
    const { currentFunctionContext } = this;
    for (const p in currentFunctionContext) {
      if (!currentFunctionContext.hasOwnProperty(p) || newContext.hasOwnProperty(p)) continue;
      newContext[p] = currentFunctionContext[p];
    }
    this.runningContexts.pop();
    return newContext;
  }

  useFunctionContext(run) {
    const functionContext = last(this.functionContexts);
    this.runningContexts.push(functionContext);
    run();
    this.runningContexts.pop();
  }

  getIdentifiers(run) {
    const trackedIdentifiers = this.trackedIdentifiers = [];
    this.pushState(states.trackIdentifiers);
    run();
    this.trackedIdentifiers = null;
    this.popState(states.trackIdentifiers);
    return trackedIdentifiers;
  }

  getDeclaration(name) {
    const { currentContext, currentFunctionContext, runningContexts } = this;
    const declaration = currentContext[name] || currentFunctionContext[name] || null;

    if (
      !declaration &&
      currentContext === currentFunctionContext &&
      runningContexts.length > 0
    ) {
      const previousRunningContext = runningContexts[runningContexts.length - 2];
      if (previousRunningContext[name]) {
        return previousRunningContext[name];
      }
    }

    return declaration;
  }

  scan(ast) {
    if (!ast) return;
    if (Array.isArray(ast)) {
      for (let i = 0; i < ast.length; i++) {
        this.scan(ast[i]);
      }
      return;
    }
    switch (ast.type) {
      case 'Program':
        this.useFunctionContext(() => {
          this.scan(ast.body);
        });
        break;
      case 'BlockStatement':
        this.newContext(() => {
          this.scan(ast.body);
        });
        break;
      case 'AssignmentExpression':
      case 'LogicalExpression':
        this.scan(ast.left);
        this.scan(ast.right);
        break;
      case 'BinaryExpression':
        this.scan(ast.left);
        this.scan(ast.right);
        break;
      case 'UpdateExpression':
        if (ast.operator === '++') {
          const declaration = this.getDeclaration(ast.argument.name);
          if (declaration) {
            declaration.suggestedType = 'Integer';
          }
        }
        this.scan(ast.argument);
        break;
      case 'UnaryExpression':
        this.scan(ast.argument);
        break;
      case 'VariableDeclaration':
        if (ast.kind === 'var') {
          this.useFunctionContext(() => {
            ast.declarations = utils.normalizeDeclarations(ast);
            this.scan(ast.declarations);
          });
        } else {
          ast.declarations = utils.normalizeDeclarations(ast);
          this.scan(ast.declarations);
        }
        break;
      case 'VariableDeclarator': {
        const { currentContext } = this;
        const inForLoopInit = this.hasState(states.inForLoopInit);
        const declaration = {
          ast: ast,
          context: currentContext,
          name: ast.id.name,
          origin: 'declaration',
          inForLoopInit,
          inForLoopTest: null,
          assignable: currentContext === this.currentFunctionContext || (!inForLoopInit && !currentContext.hasOwnProperty(ast.id.name)),
          suggestedType: null,
          valueType: null,
          dependencies: null,
          isSafe: null,
        };
        if (!currentContext[ast.id.name]) {
          currentContext[ast.id.name] = declaration;
        }
        this.declarations.push(declaration);
        this.scan(ast.id);
        this.scan(ast.init);
        break;
      }
      case 'FunctionExpression':
      case 'FunctionDeclaration':
        if (this.runningContexts.length === 0) {
          this.scan(ast.body);
        } else {
          this.functions.push(ast);
        }
        break;
      case 'IfStatement':
        this.scan(ast.test);
        this.scan(ast.consequent);
        if (ast.alternate) this.scan(ast.alternate);
        break;
      case 'ForStatement': {
        let testIdentifiers;
        const context = this.newContext(() => {
          this.pushState(states.inForLoopInit);
          this.scan(ast.init);
          this.popState(states.inForLoopInit);

          testIdentifiers = this.getIdentifiers(() => {
            this.scan(ast.test);
          });

          this.scan(ast.update);
          this.newContext(() => {
            this.scan(ast.body);
          });
        });

        if (testIdentifiers) {
          for (const p in context) {
            if (p === '@contextType') continue;
            if (testIdentifiers.indexOf(p) > -1) {
              context[p].inForLoopTest = true;
            }
          }
        }
        break;
      }
      case 'DoWhileStatement':
      case 'WhileStatement':
        this.newContext(() => {
          this.scan(ast.body);
          this.scan(ast.test);
        });
        break;
      case 'Identifier': {
        if (this.isState(states.trackIdentifiers)) {
          this.trackedIdentifiers.push(ast.name);
        }
        this.identifiers.push({
          context: this.currentContext,
          declaration: this.getDeclaration(ast.name),
          ast,
        });
        break;
      }
      case 'ReturnStatement':
        this.returnStatements.push(ast);
        this.scan(ast.argument);
        break;
      case 'MemberExpression':
        this.pushState(states.memberExpression);
        this.scan(ast.object);
        this.scan(ast.property);
        this.popState(states.memberExpression);
        break;
      case 'ExpressionStatement':
        this.scan(ast.expression);
        break;
      case 'SequenceExpression':
        this.scan(ast.expressions);
        break;
      case 'CallExpression':
        this.functionCalls.push({
          context: this.currentContext,
          ast,
        });
        this.scan(ast.arguments);
        break;
      case 'ArrayExpression':
        this.scan(ast.elements);
        break;
      case 'ConditionalExpression':
        this.scan(ast.test);
        this.scan(ast.alternate);
        this.scan(ast.consequent);
        break;
      case 'SwitchStatement':
        this.scan(ast.discriminant);
        this.scan(ast.cases);
        break;
      case 'SwitchCase':
        this.scan(ast.test);
        this.scan(ast.consequent);
        break;

      case 'ThisExpression':
      case 'Literal':
      case 'DebuggerStatement':
      case 'EmptyStatement':
      case 'BreakStatement':
      case 'ContinueStatement':
        break;
      default:
        throw new Error(`unhandled type "${ast.type}"`);
    }
  }
}

module.exports = {
  FunctionTracer,
};
},{"../utils":113}],11:[function(require,module,exports){
const { glWiretap } = require('gl-wiretap');
const { utils } = require('../../utils');

function toStringWithoutUtils(fn) {
  return fn.toString()
    .replace('=>', '')
    .replace(/^function /, '')
    .replace(/utils[.]/g, '/*utils.*/');
}

function glKernelString(Kernel, args, originKernel, setupContextString, destroyContextString) {
  if (!originKernel.built) {
    originKernel.build.apply(originKernel, args);
  }
  args = args ? Array.from(args).map(arg => {
    switch (typeof arg) {
      case 'boolean':
        return new Boolean(arg);
      case 'number':
        return new Number(arg);
      default:
        return arg;
    }
  }) : null;
  const uploadedValues = [];
  const postResult = [];
  const context = glWiretap(originKernel.context, {
    useTrackablePrimitives: true,
    onReadPixels: (targetName) => {
      if (kernel.subKernels) {
        if (!subKernelsResultVariableSetup) {
          postResult.push(`    const result = { result: ${getRenderString(targetName, kernel)} };`);
          subKernelsResultVariableSetup = true;
        } else {
          const property = kernel.subKernels[subKernelsResultIndex++].property;
          postResult.push(`    result${isNaN(property) ? '.' + property : `[${property}]`} = ${getRenderString(targetName, kernel)};`);
        }
        if (subKernelsResultIndex === kernel.subKernels.length) {
          postResult.push('    return result;');
        }
        return;
      }
      if (targetName) {
        postResult.push(`    return ${getRenderString(targetName, kernel)};`);
      } else {
        postResult.push(`    return null;`);
      }
    },
    onUnrecognizedArgumentLookup: (argument) => {
      const argumentName = findKernelValue(argument, kernel.kernelArguments, [], context, uploadedValues);
      if (argumentName) {
        return argumentName;
      }
      const constantName = findKernelValue(argument, kernel.kernelConstants, constants ? Object.keys(constants).map(key => constants[key]) : [], context, uploadedValues);
      if (constantName) {
        return constantName;
      }
      return null;
    }
  });
  let subKernelsResultVariableSetup = false;
  let subKernelsResultIndex = 0;
  const {
    source,
    canvas,
    output,
    pipeline,
    graphical,
    loopMaxIterations,
    constants,
    optimizeFloatMemory,
    precision,
    fixIntegerDivisionAccuracy,
    functions,
    nativeFunctions,
    subKernels,
    immutable,
    argumentTypes,
    constantTypes,
    kernelArguments,
    kernelConstants,
    tactic,
  } = originKernel;
  const kernel = new Kernel(source, {
    canvas,
    context,
    checkContext: false,
    output,
    pipeline,
    graphical,
    loopMaxIterations,
    constants,
    optimizeFloatMemory,
    precision,
    fixIntegerDivisionAccuracy,
    functions,
    nativeFunctions,
    subKernels,
    immutable,
    argumentTypes,
    constantTypes,
    tactic,
  });
  let result = [];
  context.setIndent(2);
  kernel.build.apply(kernel, args);
  result.push(context.toString());
  context.reset();

  kernel.kernelArguments.forEach((kernelArgument, i) => {
    switch (kernelArgument.type) {
      case 'Integer':
      case 'Boolean':
      case 'Number':
      case 'Float':
      case 'Array':
      case 'Array(2)':
      case 'Array(3)':
      case 'Array(4)':
      case 'HTMLCanvas':
      case 'HTMLImage':
      case 'HTMLVideo':
        context.insertVariable(`uploadValue_${kernelArgument.name}`, kernelArgument.uploadValue);
        break;
      case 'HTMLImageArray':
        for (let imageIndex = 0; imageIndex < args[i].length; imageIndex++) {
          const arg = args[i];
          context.insertVariable(`uploadValue_${kernelArgument.name}[${imageIndex}]`, arg[imageIndex]);
        }
        break;
      case 'Input':
        context.insertVariable(`uploadValue_${kernelArgument.name}`, kernelArgument.uploadValue);
        break;
      case 'MemoryOptimizedNumberTexture':
      case 'NumberTexture':
      case 'Array1D(2)':
      case 'Array1D(3)':
      case 'Array1D(4)':
      case 'Array2D(2)':
      case 'Array2D(3)':
      case 'Array2D(4)':
      case 'Array3D(2)':
      case 'Array3D(3)':
      case 'Array3D(4)':
      case 'ArrayTexture(1)':
      case 'ArrayTexture(2)':
      case 'ArrayTexture(3)':
      case 'ArrayTexture(4)':
        context.insertVariable(`uploadValue_${kernelArgument.name}`, args[i].texture);
        break;
      default:
        throw new Error(`unhandled kernelArgumentType insertion for glWiretap of type ${kernelArgument.type}`);
    }
  });
  result.push('/** start of injected functions **/');
  result.push(`function ${toStringWithoutUtils(utils.flattenTo)}`);
  result.push(`function ${toStringWithoutUtils(utils.flatten2dArrayTo)}`);
  result.push(`function ${toStringWithoutUtils(utils.flatten3dArrayTo)}`);
  result.push(`function ${toStringWithoutUtils(utils.flatten4dArrayTo)}`);
  result.push(`function ${toStringWithoutUtils(utils.isArray)}`);
  if (kernel.renderOutput !== kernel.renderTexture && kernel.formatValues) {
    result.push(
      `  const renderOutput = function ${toStringWithoutUtils(kernel.formatValues)};`
    );
  }
  result.push('/** end of injected functions **/');
  result.push(`  const innerKernel = function (${kernel.kernelArguments.map(kernelArgument => kernelArgument.varName).join(', ')}) {`);
  context.setIndent(4);
  kernel.run.apply(kernel, args);
  if (kernel.renderKernels) {
    kernel.renderKernels();
  } else if (kernel.renderOutput) {
    kernel.renderOutput();
  }
  result.push('    /** start setup uploads for kernel values **/');
  kernel.kernelArguments.forEach(kernelArgument => {
    result.push('    ' + kernelArgument.getStringValueHandler().split('\n').join('\n    '));
  });
  result.push('    /** end setup uploads for kernel values **/');
  result.push(context.toString());
  if (kernel.renderOutput === kernel.renderTexture) {
    context.reset();
    const framebufferName = context.getContextVariableName(kernel.framebuffer);
    if (kernel.renderKernels) {
      const results = kernel.renderKernels();
      const textureName = context.getContextVariableName(kernel.texture.texture);
      result.push(`    return {
      result: {
        texture: ${ textureName },
        type: '${ results.result.type }',
        toArray: ${ getToArrayString(results.result, textureName, framebufferName) }
      },`);
      const { subKernels, mappedTextures } = kernel;
      for (let i = 0; i < subKernels.length; i++) {
        const texture = mappedTextures[i];
        const subKernel = subKernels[i];
        const subKernelResult = results[subKernel.property];
        const subKernelTextureName = context.getContextVariableName(texture.texture);
        result.push(`
      ${subKernel.property}: {
        texture: ${ subKernelTextureName },
        type: '${ subKernelResult.type }',
        toArray: ${ getToArrayString(subKernelResult, subKernelTextureName, framebufferName) }
      },`);
      }
      result.push(`    };`);
    } else {
      const rendered = kernel.renderOutput();
      const textureName = context.getContextVariableName(kernel.texture.texture);
      result.push(`    return {
        texture: ${ textureName },
        type: '${ rendered.type }',
        toArray: ${ getToArrayString(rendered, textureName, framebufferName) }
      };`);
    }
  }
  result.push(`    ${destroyContextString ? '\n' + destroyContextString + '    ': ''}`);
  result.push(postResult.join('\n'));
  result.push('  };');
  if (kernel.graphical) {
    result.push(getGetPixelsString(kernel));
    result.push(`  innerKernel.getPixels = getPixels;`);
  }
  result.push('  return innerKernel;');

  let constantsUpload = [];
  kernelConstants.forEach((kernelConstant) => {
    constantsUpload.push(`${kernelConstant.getStringValueHandler()}`);
  });
  return `function kernel(settings) {
  const { context, constants } = settings;
  ${constantsUpload.join('')}
  ${setupContextString ? setupContextString : ''}
${result.join('\n')}
}`;
}

function getRenderString(targetName, kernel) {
  const readBackValue = kernel.precision === 'single' ? targetName : `new Float32Array(${targetName}.buffer)`;
  if (kernel.output[2]) {
    return `renderOutput(${readBackValue}, ${kernel.output[0]}, ${kernel.output[1]}, ${kernel.output[2]})`;
  }
  if (kernel.output[1]) {
    return `renderOutput(${readBackValue}, ${kernel.output[0]}, ${kernel.output[1]})`;
  }

  return `renderOutput(${readBackValue}, ${kernel.output[0]})`;
}

function getGetPixelsString(kernel) {
  const getPixels = kernel.getPixels.toString();
  const useFunctionKeyword = !/^function/.test(getPixels);
  return utils.flattenFunctionToString(`${useFunctionKeyword ? 'function ' : ''}${ getPixels }`, {
    findDependency: (object, name) => {
      if (object === 'utils') {
        return `const ${name} = ${utils[name].toString()};`;
      }
      return null;
    },
    thisLookup: (property) => {
      if (property === 'context') {
        return null;
      }
      if (kernel.hasOwnProperty(property)) {
        return JSON.stringify(kernel[property]);
      }
      throw new Error(`unhandled thisLookup ${ property }`);
    }
  });
}

function getToArrayString(kernelResult, textureName, framebufferName) {
  const toArray = kernelResult.toArray.toString();
  const useFunctionKeyword = !/^function/.test(toArray);
  const flattenedFunctions = utils.flattenFunctionToString(`${useFunctionKeyword ? 'function ' : ''}${ toArray }`, {
    findDependency: (object, name) => {
      if (object === 'utils') {
        return `const ${name} = ${utils[name].toString()};`;
      } else if (object === 'this') {
        if (name === 'framebuffer') {
          return '';
        }
        return `${useFunctionKeyword ? 'function ' : ''}${kernelResult[name].toString()}`;
      } else {
        throw new Error('unhandled fromObject');
      }
    },
    thisLookup: (property, isDeclaration) => {
      if (property === 'texture') {
        return textureName;
      }
      if (property === 'context') {
        if (isDeclaration) return null;
        return 'gl';
      }
      if (kernelResult.hasOwnProperty(property)) {
        return JSON.stringify(kernelResult[property]);
      }
      throw new Error(`unhandled thisLookup ${ property }`);
    }
  });
  return `() => {
  function framebuffer() { return ${framebufferName}; };
  ${flattenedFunctions}
  return toArray();
  }`;
}

function findKernelValue(argument, kernelValues, values, context, uploadedValues) {
  if (argument === null) return null;
  if (kernelValues === null) return null;
  switch (typeof argument) {
    case 'boolean':
    case 'number':
      return null;
  }
  if (
    typeof HTMLImageElement !== 'undefined' &&
    argument instanceof HTMLImageElement
  ) {
    for (let i = 0; i < kernelValues.length; i++) {
      const kernelValue = kernelValues[i];
      if (kernelValue.type !== 'HTMLImageArray' && kernelValue) continue;
      if (kernelValue.uploadValue !== argument) continue;
      const variableIndex = values[i].indexOf(argument);
      if (variableIndex === -1) continue;
      const variableName = `uploadValue_${kernelValue.name}[${variableIndex}]`;
      context.insertVariable(variableName, argument);
      return variableName;
    }
  }

  for (let i = 0; i < kernelValues.length; i++) {
    const kernelValue = kernelValues[i];
    if (argument !== kernelValue.uploadValue) continue;
    const variable = `uploadValue_${kernelValue.name}`;
    context.insertVariable(variable, kernelValue);
    return variable;
  }
  return null;
}

module.exports = {
  glKernelString
};
},{"../../utils":113,"gl-wiretap":2}],12:[function(require,module,exports){
const { Kernel } = require('../kernel');
const { utils } = require('../../utils');
const { GLTextureArray2Float } = require('./texture/array-2-float');
const { GLTextureArray2Float2D } = require('./texture/array-2-float-2d');
const { GLTextureArray2Float3D } = require('./texture/array-2-float-3d');
const { GLTextureArray3Float } = require('./texture/array-3-float');
const { GLTextureArray3Float2D } = require('./texture/array-3-float-2d');
const { GLTextureArray3Float3D } = require('./texture/array-3-float-3d');
const { GLTextureArray4Float } = require('./texture/array-4-float');
const { GLTextureArray4Float2D } = require('./texture/array-4-float-2d');
const { GLTextureArray4Float3D } = require('./texture/array-4-float-3d');
const { GLTextureFloat } = require('./texture/float');
const { GLTextureFloat2D } = require('./texture/float-2d');
const { GLTextureFloat3D } = require('./texture/float-3d');
const { GLTextureMemoryOptimized } = require('./texture/memory-optimized');
const { GLTextureMemoryOptimized2D } = require('./texture/memory-optimized-2d');
const { GLTextureMemoryOptimized3D } = require('./texture/memory-optimized-3d');
const { GLTextureUnsigned } = require('./texture/unsigned');
const { GLTextureUnsigned2D } = require('./texture/unsigned-2d');
const { GLTextureUnsigned3D } = require('./texture/unsigned-3d');
const { GLTextureGraphical } = require('./texture/graphical');

class GLKernel extends Kernel {
  static get mode() {
    return 'gpu';
  }

  static getIsFloatRead() {
    const kernelString = `function kernelFunction() {
      return 1;
    }`;
    const kernel = new this(kernelString, {
      context: this.testContext,
      canvas: this.testCanvas,
      validate: false,
      output: [1],
      precision: 'single',
      returnType: 'Number',
      tactic: 'speed',
    });
    kernel.build();
    kernel.run();
    const result = kernel.renderOutput();
    kernel.destroy(true);
    return result[0] === 1;
  }

  static getIsIntegerDivisionAccurate() {
    function kernelFunction(v1, v2) {
      return v1[this.thread.x] / v2[this.thread.x];
    }
    const kernel = new this(kernelFunction.toString(), {
      context: this.testContext,
      canvas: this.testCanvas,
      validate: false,
      output: [2],
      returnType: 'Number',
      precision: 'unsigned',
      tactic: 'speed',
    });
    const args = [
      [6, 6030401],
      [3, 3991]
    ];
    kernel.build.apply(kernel, args);
    kernel.run.apply(kernel, args);
    const result = kernel.renderOutput();
    kernel.destroy(true);
    return result[0] === 2 && result[1] === 1511;
  }

  static getIsSpeedTacticSupported() {
    function kernelFunction(value) {
      return value[this.thread.x];
    }
    const kernel = new this(kernelFunction.toString(), {
      context: this.testContext,
      canvas: this.testCanvas,
      validate: false,
      output: [4],
      returnType: 'Number',
      precision: 'unsigned',
      tactic: 'speed',
    });
    const args = [
      [0, 1, 2, 3]
    ];
    kernel.build.apply(kernel, args);
    kernel.run.apply(kernel, args);
    const result = kernel.renderOutput();
    kernel.destroy(true);
    return Math.round(result[0]) === 0 && Math.round(result[1]) === 1 && Math.round(result[2]) === 2 && Math.round(result[3]) === 3;
  }

  static get testCanvas() {
    throw new Error(`"testCanvas" not defined on ${ this.name }`);
  }

  static get testContext() {
    throw new Error(`"testContext" not defined on ${ this.name }`);
  }

  static getFeatures() {
    const gl = this.testContext;
    const isDrawBuffers = this.getIsDrawBuffers();
    return Object.freeze({
      isFloatRead: this.getIsFloatRead(),
      isIntegerDivisionAccurate: this.getIsIntegerDivisionAccurate(),
      isSpeedTacticSupported: this.getIsSpeedTacticSupported(),
      isTextureFloat: this.getIsTextureFloat(),
      isDrawBuffers,
      kernelMap: isDrawBuffers,
      channelCount: this.getChannelCount(),
      maxTextureSize: this.getMaxTextureSize(),
      lowIntPrecision: gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_INT),
      lowFloatPrecision: gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.LOW_FLOAT),
      mediumIntPrecision: gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_INT),
      mediumFloatPrecision: gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT),
      highIntPrecision: gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_INT),
      highFloatPrecision: gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT),
    });
  }

  static setupFeatureChecks() {
    throw new Error(`"setupFeatureChecks" not defined on ${ this.name }`);
  }

  static getSignature(kernel, argumentTypes) {
    return kernel.getVariablePrecisionString() + (argumentTypes.length > 0 ? ':' + argumentTypes.join(',') : '');
  }

  setFixIntegerDivisionAccuracy(fix) {
    this.fixIntegerDivisionAccuracy = fix;
    return this;
  }

  setPrecision(flag) {
    this.precision = flag;
    return this;
  }

  setFloatTextures(flag) {
    utils.warnDeprecated('method', 'setFloatTextures', 'setOptimizeFloatMemory');
    this.floatTextures = flag;
    return this;
  }

  static nativeFunctionArguments(source) {
    const argumentTypes = [];
    const argumentNames = [];
    const states = [];
    const isStartingVariableName = /^[a-zA-Z_]/;
    const isVariableChar = /[a-zA-Z_0-9]/;
    let i = 0;
    let argumentName = null;
    let argumentType = null;
    while (i < source.length) {
      const char = source[i];
      const nextChar = source[i + 1];
      const state = states.length > 0 ? states[states.length - 1] : null;

      if (state === 'FUNCTION_ARGUMENTS' && char === '/' && nextChar === '*') {
        states.push('MULTI_LINE_COMMENT');
        i += 2;
        continue;
      } else if (state === 'MULTI_LINE_COMMENT' && char === '*' && nextChar === '/') {
        states.pop();
        i += 2;
        continue;
      }

      else if (state === 'FUNCTION_ARGUMENTS' && char === '/' && nextChar === '/') {
        states.push('COMMENT');
        i += 2;
        continue;
      } else if (state === 'COMMENT' && char === '\n') {
        states.pop();
        i++;
        continue;
      }

      else if (state === null && char === '(') {
        states.push('FUNCTION_ARGUMENTS');
        i++;
        continue;
      } else if (state === 'FUNCTION_ARGUMENTS') {
        if (char === ')') {
          states.pop();
          break;
        }
        if (char === 'f' && nextChar === 'l' && source[i + 2] === 'o' && source[i + 3] === 'a' && source[i + 4] === 't' && source[i + 5] === ' ') {
          states.push('DECLARE_VARIABLE');
          argumentType = 'float';
          argumentName = '';
          i += 6;
          continue;
        } else if (char === 'i' && nextChar === 'n' && source[i + 2] === 't' && source[i + 3] === ' ') {
          states.push('DECLARE_VARIABLE');
          argumentType = 'int';
          argumentName = '';
          i += 4;
          continue;
        } else if (char === 'v' && nextChar === 'e' && source[i + 2] === 'c' && source[i + 3] === '2' && source[i + 4] === ' ') {
          states.push('DECLARE_VARIABLE');
          argumentType = 'vec2';
          argumentName = '';
          i += 5;
          continue;
        } else if (char === 'v' && nextChar === 'e' && source[i + 2] === 'c'
Download .txt
gitextract_g_im5cfv/

├── .gitignore
├── CONTRIBUTING.md
├── ISSUE_TEMPLATE.md
├── LICENSE
├── README.md
├── dist/
│   ├── gpu-browser-core.js
│   └── gpu-browser.js
├── examples/
│   ├── advanced-typescript.ts
│   ├── cat-image/
│   │   └── index.html
│   ├── fluid.html
│   ├── internal-variable-precision.html
│   ├── json-saving.js
│   ├── mandelbrot-set.html
│   ├── mandelbulb.html
│   ├── parallel-raytracer.html
│   ├── random.html
│   ├── raster-globe/
│   │   └── index.html
│   ├── raytracer.html
│   ├── simple-javascript.js
│   ├── simple-typescript.ts
│   ├── slow-fade.html
│   └── video/
│       └── index.html
├── gulpfile.js
├── package.json
├── src/
│   ├── alias.js
│   ├── backend/
│   │   ├── cpu/
│   │   │   ├── function-node.js
│   │   │   ├── kernel-string.js
│   │   │   └── kernel.js
│   │   ├── function-builder.js
│   │   ├── function-node.js
│   │   ├── function-tracer.js
│   │   ├── gl/
│   │   │   ├── kernel-string.js
│   │   │   ├── kernel.js
│   │   │   └── texture/
│   │   │       ├── array-2-float-2d.js
│   │   │       ├── array-2-float-3d.js
│   │   │       ├── array-2-float.js
│   │   │       ├── array-3-float-2d.js
│   │   │       ├── array-3-float-3d.js
│   │   │       ├── array-3-float.js
│   │   │       ├── array-4-float-2d.js
│   │   │       ├── array-4-float-3d.js
│   │   │       ├── array-4-float.js
│   │   │       ├── float-2d.js
│   │   │       ├── float-3d.js
│   │   │       ├── float.js
│   │   │       ├── graphical.js
│   │   │       ├── index.js
│   │   │       ├── memory-optimized-2d.js
│   │   │       ├── memory-optimized-3d.js
│   │   │       ├── memory-optimized.js
│   │   │       ├── unsigned-2d.js
│   │   │       ├── unsigned-3d.js
│   │   │       └── unsigned.js
│   │   ├── headless-gl/
│   │   │   └── kernel.js
│   │   ├── kernel-value.js
│   │   ├── kernel.js
│   │   ├── web-gl/
│   │   │   ├── fragment-shader.js
│   │   │   ├── function-node.js
│   │   │   ├── kernel-value/
│   │   │   │   ├── array.js
│   │   │   │   ├── array2.js
│   │   │   │   ├── array3.js
│   │   │   │   ├── array4.js
│   │   │   │   ├── boolean.js
│   │   │   │   ├── dynamic-html-image.js
│   │   │   │   ├── dynamic-html-video.js
│   │   │   │   ├── dynamic-memory-optimized-number-texture.js
│   │   │   │   ├── dynamic-number-texture.js
│   │   │   │   ├── dynamic-single-array.js
│   │   │   │   ├── dynamic-single-array1d-i.js
│   │   │   │   ├── dynamic-single-array2d-i.js
│   │   │   │   ├── dynamic-single-array3d-i.js
│   │   │   │   ├── dynamic-single-input.js
│   │   │   │   ├── dynamic-unsigned-array.js
│   │   │   │   ├── dynamic-unsigned-input.js
│   │   │   │   ├── float.js
│   │   │   │   ├── html-image.js
│   │   │   │   ├── html-video.js
│   │   │   │   ├── index.js
│   │   │   │   ├── integer.js
│   │   │   │   ├── memory-optimized-number-texture.js
│   │   │   │   ├── number-texture.js
│   │   │   │   ├── single-array.js
│   │   │   │   ├── single-array1d-i.js
│   │   │   │   ├── single-array2d-i.js
│   │   │   │   ├── single-array3d-i.js
│   │   │   │   ├── single-input.js
│   │   │   │   ├── unsigned-array.js
│   │   │   │   └── unsigned-input.js
│   │   │   ├── kernel-value-maps.js
│   │   │   ├── kernel.js
│   │   │   └── vertex-shader.js
│   │   └── web-gl2/
│   │       ├── fragment-shader.js
│   │       ├── function-node.js
│   │       ├── kernel-value/
│   │       │   ├── array2.js
│   │       │   ├── array3.js
│   │       │   ├── array4.js
│   │       │   ├── boolean.js
│   │       │   ├── dynamic-html-image-array.js
│   │       │   ├── dynamic-html-image.js
│   │       │   ├── dynamic-html-video.js
│   │       │   ├── dynamic-memory-optimized-number-texture.js
│   │       │   ├── dynamic-number-texture.js
│   │       │   ├── dynamic-single-array.js
│   │       │   ├── dynamic-single-array1d-i.js
│   │       │   ├── dynamic-single-array2d-i.js
│   │       │   ├── dynamic-single-array3d-i.js
│   │       │   ├── dynamic-single-input.js
│   │       │   ├── dynamic-unsigned-array.js
│   │       │   ├── dynamic-unsigned-input.js
│   │       │   ├── float.js
│   │       │   ├── html-image-array.js
│   │       │   ├── html-image.js
│   │       │   ├── html-video.js
│   │       │   ├── integer.js
│   │       │   ├── memory-optimized-number-texture.js
│   │       │   ├── number-texture.js
│   │       │   ├── single-array.js
│   │       │   ├── single-array1d-i.js
│   │       │   ├── single-array2d-i.js
│   │       │   ├── single-array3d-i.js
│   │       │   ├── single-input.js
│   │       │   ├── unsigned-array.js
│   │       │   └── unsigned-input.js
│   │       ├── kernel-value-maps.js
│   │       ├── kernel.js
│   │       └── vertex-shader.js
│   ├── browser-header.txt
│   ├── browser.js
│   ├── gpu.js
│   ├── index.d.ts
│   ├── index.js
│   ├── input.js
│   ├── kernel-run-shortcut.js
│   ├── plugins/
│   │   ├── math-random-triangle-noise.js
│   │   └── math-random-uniformly-distributed.js
│   ├── texture.js
│   └── utils.js
└── test/
    ├── all-template.html
    ├── all.html
    ├── benchmark-faster.js
    ├── benchmark.js
    ├── browser-test-utils.js
    ├── features/
    │   ├── add-custom-function.js
    │   ├── add-custom-native-function.js
    │   ├── add-typed-functions.js
    │   ├── argument-array-types.js
    │   ├── argument-array1d-types.js
    │   ├── argument-array2d-types.js
    │   ├── argument-array3d-types.js
    │   ├── arithmetic-operators.js
    │   ├── assignment-operators.js
    │   ├── basic-math.js
    │   ├── bitwise-operators.js
    │   ├── boolean-from-expression.js
    │   ├── canvas.js
    │   ├── clear-textures.js
    │   ├── clone-textures.js
    │   ├── combine-kernels.js
    │   ├── constants-array.js
    │   ├── constants-bool.js
    │   ├── constants-canvas.js
    │   ├── constants-float.js
    │   ├── constants-image-array.js
    │   ├── constants-image.js
    │   ├── constants-integer.js
    │   ├── constants-texture.js
    │   ├── cpu-with-textures.js
    │   ├── create-kernel-map.js
    │   ├── demo.js
    │   ├── destroy.js
    │   ├── destructured-assignment.js
    │   ├── dev-mode.js
    │   ├── dynamic-arguments.js
    │   ├── dynamic-output.js
    │   ├── function-return.js
    │   ├── get-canvas.js
    │   ├── get-pixels.js
    │   ├── if-else.js
    │   ├── image-array.js
    │   ├── image.js
    │   ├── infinity.js
    │   ├── inject-native.js
    │   ├── input.js
    │   ├── internally-defined-matrices.js
    │   ├── json.js
    │   ├── legacy-encoder.js
    │   ├── loops.js
    │   ├── math-object.js
    │   ├── nested-function.js
    │   ├── offscreen-canvas.js
    │   ├── optimize-float-memory.js
    │   ├── output.js
    │   ├── promise-api.js
    │   ├── raw-output.js
    │   ├── read-color-texture.js
    │   ├── read-from-texture.js
    │   ├── read-image-bitmap.js
    │   ├── read-image-data.js
    │   ├── read-offscreen-canvas.js
    │   ├── return-arrays.js
    │   ├── single-precision-textures.js
    │   ├── single-precision.js
    │   ├── switches.js
    │   ├── tactic.js
    │   ├── ternary.js
    │   ├── to-string/
    │   │   ├── as-file.js
    │   │   └── precision/
    │   │       ├── single/
    │   │       │   ├── arguments/
    │   │       │   │   ├── array.js
    │   │       │   │   ├── array2.js
    │   │       │   │   ├── array2d.js
    │   │       │   │   ├── array2d2.js
    │   │       │   │   ├── array2d3.js
    │   │       │   │   ├── array3.js
    │   │       │   │   ├── array3d.js
    │   │       │   │   ├── array4.js
    │   │       │   │   ├── boolean.js
    │   │       │   │   ├── float.js
    │   │       │   │   ├── html-canvas.js
    │   │       │   │   ├── html-image-array.js
    │   │       │   │   ├── html-image.js
    │   │       │   │   ├── html-video.js
    │   │       │   │   ├── input.js
    │   │       │   │   ├── integer.js
    │   │       │   │   ├── memory-optimized-number-texture.js
    │   │       │   │   └── number-texture.js
    │   │       │   ├── constants/
    │   │       │   │   ├── array.js
    │   │       │   │   ├── array2.js
    │   │       │   │   ├── array2d.js
    │   │       │   │   ├── array3.js
    │   │       │   │   ├── array3d.js
    │   │       │   │   ├── array4.js
    │   │       │   │   ├── boolean.js
    │   │       │   │   ├── float.js
    │   │       │   │   ├── html-canvas.js
    │   │       │   │   ├── html-image-array.js
    │   │       │   │   ├── html-image.js
    │   │       │   │   ├── input.js
    │   │       │   │   ├── integer.js
    │   │       │   │   ├── memory-optimized-number-texture.js
    │   │       │   │   └── number-texture.js
    │   │       │   ├── graphical.js
    │   │       │   ├── kernel-map/
    │   │       │   │   ├── array/
    │   │       │   │   │   ├── array.js
    │   │       │   │   │   ├── array2d.js
    │   │       │   │   │   ├── array3d.js
    │   │       │   │   │   ├── memory-optimized-number-texture.js
    │   │       │   │   │   └── number-texture.js
    │   │       │   │   └── object/
    │   │       │   │       ├── array.js
    │   │       │   │       ├── array2d.js
    │   │       │   │       ├── array3d.js
    │   │       │   │       ├── memory-optimized-number-texture.js
    │   │       │   │       └── number-texture.js
    │   │       │   └── returns/
    │   │       │       ├── array.js
    │   │       │       ├── array2d.js
    │   │       │       ├── array3d.js
    │   │       │       └── texture.js
    │   │       └── unsigned/
    │   │           ├── arguments/
    │   │           │   ├── array.js
    │   │           │   ├── array2.js
    │   │           │   ├── array2d.js
    │   │           │   ├── array3.js
    │   │           │   ├── array3d.js
    │   │           │   ├── array4.js
    │   │           │   ├── boolean.js
    │   │           │   ├── float.js
    │   │           │   ├── html-canvas.js
    │   │           │   ├── html-image-array.js
    │   │           │   ├── html-image.js
    │   │           │   ├── html-video.js
    │   │           │   ├── input.js
    │   │           │   ├── integer.js
    │   │           │   ├── memory-optimized-number-texture.js
    │   │           │   └── number-texture.js
    │   │           ├── constants/
    │   │           │   ├── array.js
    │   │           │   ├── array2.js
    │   │           │   ├── array2d.js
    │   │           │   ├── array3.js
    │   │           │   ├── array3d.js
    │   │           │   ├── array4.js
    │   │           │   ├── boolean.js
    │   │           │   ├── float.js
    │   │           │   ├── html-canvas.js
    │   │           │   ├── html-image-array.js
    │   │           │   ├── html-image.js
    │   │           │   ├── input.js
    │   │           │   ├── integer.js
    │   │           │   ├── memory-optimized-number-texture.js
    │   │           │   └── number-texture.js
    │   │           ├── graphical.js
    │   │           ├── kernel-map/
    │   │           │   ├── array/
    │   │           │   │   ├── array.js
    │   │           │   │   ├── array2d.js
    │   │           │   │   ├── array3d.js
    │   │           │   │   ├── memory-optimized-number-texture.js
    │   │           │   │   └── number-texture.js
    │   │           │   └── object/
    │   │           │       ├── array.js
    │   │           │       ├── array2d.js
    │   │           │       ├── array3d.js
    │   │           │       ├── memory-optimized-number-texture.js
    │   │           │       └── number-texture.js
    │   │           └── returns/
    │   │               ├── array.js
    │   │               ├── array2d.js
    │   │               ├── array3d.js
    │   │               └── texture.js
    │   ├── type-management.js
    │   ├── unsigned-precision-textures.js
    │   └── video.js
    ├── index.js
    ├── internal/
    │   ├── argument-texture-switching.js
    │   ├── backend/
    │   │   ├── cpu-kernel.js
    │   │   ├── function-node/
    │   │   │   ├── isSafe.js
    │   │   │   └── isSafeDependencies.js
    │   │   ├── gl-kernel.js
    │   │   ├── headless-gl/
    │   │   │   └── kernel/
    │   │   │       └── index.js
    │   │   ├── web-gl/
    │   │   │   ├── function-node/
    │   │   │   │   ├── astBinaryExpression.js
    │   │   │   │   ├── astCallExpression.js
    │   │   │   │   ├── astForStatement.js
    │   │   │   │   ├── astVariableDeclaration.js
    │   │   │   │   ├── contexts.js
    │   │   │   │   ├── firstAvailableTypeFromAst.js
    │   │   │   │   ├── getVariableSignature.js
    │   │   │   │   └── getVariableType.js
    │   │   │   ├── kernel/
    │   │   │   │   ├── index.js
    │   │   │   │   ├── setupArguments.js
    │   │   │   │   └── setupConstants.js
    │   │   │   └── kernel-value/
    │   │   │       ├── dynamic-html-image.js
    │   │   │       ├── dynamic-memory-optimized-number-texture.js
    │   │   │       ├── dynamic-number-texture.js
    │   │   │       ├── dynamic-single-array.js
    │   │   │       ├── dynamic-single-array1d-i.js
    │   │   │       ├── dynamic-single-array2d-i.js
    │   │   │       ├── dynamic-single-array3d-i.js
    │   │   │       ├── dynamic-single-input.js
    │   │   │       ├── dynamic-unsigned-array.js
    │   │   │       ├── dynamic-unsigned-input.js
    │   │   │       ├── html-image.js
    │   │   │       ├── memory-optimized-number-texture.js
    │   │   │       ├── number-texture.js
    │   │   │       ├── single-array.js
    │   │   │       ├── single-array1d-i.js
    │   │   │       ├── single-array2d-i.js
    │   │   │       ├── single-array3d-i.js
    │   │   │       ├── single-input.js
    │   │   │       ├── unsigned-array.js
    │   │   │       └── unsigned-input.js
    │   │   └── web-gl2/
    │   │       ├── kernel/
    │   │       │   ├── index.js
    │   │       │   ├── setupArguments.js
    │   │       │   └── setupConstants.js
    │   │       └── kernel-value/
    │   │           ├── dynamic-html-image-array.js
    │   │           ├── dynamic-single-array.js
    │   │           ├── dynamic-single-input.js
    │   │           ├── html-image-array.js
    │   │           └── single-input.js
    │   ├── boolean.js
    │   ├── casting.js
    │   ├── constants-texture-switching.js
    │   ├── constructor-features.js
    │   ├── context-inheritance.js
    │   ├── deep-types.js
    │   ├── deprecated.js
    │   ├── different-texture-cloning.js
    │   ├── function-builder.js
    │   ├── function-composition.js
    │   ├── function-node.js
    │   ├── function-return-type-detection.js
    │   ├── function-tracer.js
    │   ├── gpu-methods.js
    │   ├── implied-else.js
    │   ├── kernel-run-shortcut.js
    │   ├── kernel.js
    │   ├── loop-int.js
    │   ├── loop-max.js
    │   ├── math.random.js
    │   ├── matrix-multiply-precision.js
    │   ├── mixed-memory-optimize.js
    │   ├── modes.js
    │   ├── overloading.js
    │   ├── precision.js
    │   ├── recycling.js
    │   ├── texture-index.js
    │   ├── underscores.js
    │   └── utils.js
    ├── issues/
    │   ├── 114-create-kernel-map-run-second-time.js
    │   ├── 116-multiple-kernels-run-again.js
    │   ├── 130-typed-array.js
    │   ├── 147-missing-constant.js
    │   ├── 152-for-vars.js
    │   ├── 159-3d.js
    │   ├── 174-webgl-context-warning.js
    │   ├── 195-read-from-texture2d.js
    │   ├── 207-same-function-reuse.js
    │   ├── 212-funky-function-support.js
    │   ├── 233-kernel-map-single-precision.js
    │   ├── 241-CPU-vs-GPU-maps-output-differently.js
    │   ├── 259-atan2.js
    │   ├── 263-to-string.js
    │   ├── 267-immutable-sub-kernels.js
    │   ├── 270-cache.js
    │   ├── 279-wrong-canvas-size.js
    │   ├── 300-nested-array-index.js
    │   ├── 31-nested-var-declare-test.js
    │   ├── 313-variable-lookup.js
    │   ├── 314-large-input-array-addressing.js
    │   ├── 335-missing-z-index-issue.js
    │   ├── 346-uint8array-converted.js
    │   ├── 349-division-by-factors-of-3.js
    │   ├── 357-modulus-issue.js
    │   ├── 359-addfunction-params-wrong.js
    │   ├── 378-only-first-iteration.js
    │   ├── 382-bad-constant.js
    │   ├── 390-thread-assignment.js
    │   ├── 396-combine-kernels-example.js
    │   ├── 399-double-definition.js
    │   ├── 401-cpu-canvas-check.js
    │   ├── 410-if-statement.js
    │   ├── 422-warnings.js
    │   ├── 470-modulus-wrong.js
    │   ├── 471-canvas-issue.js
    │   ├── 472-compilation-issue.js
    │   ├── 473-4-pixels.js
    │   ├── 487-dynamic-arguments.js
    │   ├── 493-strange-literal.js
    │   ├── 500-sticky-arrays.js
    │   ├── 519-sanitize-names.js
    │   ├── 553-permanent-flip.js
    │   ├── 556-minify-for-loop.js
    │   ├── 560-minification-madness.js
    │   ├── 564-boolean.js
    │   ├── 567-wrong-modulus.js
    │   ├── 585-inaccurate-lookups.js
    │   ├── 586-unable-to-resize.js
    │   ├── 608-rewritten-arrays.js
    │   ├── 91-create-kernel-map-array.js
    │   └── 96-param-names.js
    ├── jellyfish.webm
    └── test-utils.js
Download .txt
Showing preview only (264K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (3246 symbols across 354 files)

FILE: dist/gpu-browser-core.js
  function r (line 14) | function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==...
  function glWiretap (line 17) | function glWiretap(gl, options = {}) {
  function glExtensionWiretap (line 223) | function glExtensionWiretap(extension, options) {
  function argumentsToString (line 294) | function argumentsToString(args, options) {
  function argumentToString (line 320) | function argumentToString(arg, options) {
  function trackablePrimitive (line 366) | function trackablePrimitive(value) {
  function setupArguments (line 380) | function setupArguments(args) {
  function mock1D (line 393) | function mock1D() {
  function mock2D (line 405) | function mock2D() {
  function mock2DGraphical (line 421) | function mock2DGraphical() {
  function mock3D (line 433) | function mock3D() {
  function apiDecorate (line 453) | function apiDecorate(kernel) {
  function setupGraphical (line 551) | function setupGraphical(kernel) {
  function setupOutput (line 564) | function setupOutput(output) {
  function gpuMock (line 583) | function gpuMock(fn, settings = {}) {
  function flipPixels (line 613) | function flipPixels(pixels, width, height) {
  function alias (line 638) | function alias(name, source) {
  class CPUFunctionNode (line 651) | class CPUFunctionNode extends FunctionNode {
    method astFunction (line 652) | astFunction(ast, retArr) {
    method astReturnStatement (line 684) | astReturnStatement(ast, retArr) {
    method astLiteral (line 710) | astLiteral(ast, retArr) {
    method astBinaryExpression (line 724) | astBinaryExpression(ast, retArr) {
    method astIdentifierExpression (line 733) | astIdentifierExpression(idtNode, retArr) {
    method astForStatement (line 756) | astForStatement(forNode, retArr) {
    method astWhileStatement (line 822) | astWhileStatement(whileNode, retArr) {
    method astDoWhileStatement (line 843) | astDoWhileStatement(doWhileNode, retArr) {
    method astAssignmentExpression (line 864) | astAssignmentExpression(assNode, retArr) {
    method astBlockStatement (line 875) | astBlockStatement(bNode, retArr) {
    method astVariableDeclaration (line 892) | astVariableDeclaration(varDecNode, retArr) {
    method astIfStatement (line 912) | astIfStatement(ifNode, retArr) {
    method astSwitchStatement (line 938) | astSwitchStatement(ast, retArr) {
    method astThisExpression (line 963) | astThisExpression(tNode, retArr) {
    method astMemberExpression (line 968) | astMemberExpression(mNode, retArr) {
    method astCallExpression (line 1129) | astCallExpression(ast, retArr) {
    method astArrayExpression (line 1167) | astArrayExpression(arrNode, retArr) {
    method astDebuggerStatement (line 1188) | astDebuggerStatement(arrNode, retArr) {
  function constantsToString (line 1200) | function constantsToString(constants, types) {
  function cpuKernelString (line 1226) | function cpuKernelString(cpuKernel, name) {
  class CPUKernel (line 1390) | class CPUKernel extends Kernel {
    method getFeatures (line 1391) | static getFeatures() {
    method features (line 1394) | static get features() {
    method isSupported (line 1400) | static get isSupported() {
    method isContextMatch (line 1403) | static isContextMatch(context) {
    method mode (line 1406) | static get mode() {
    method nativeFunctionArguments (line 1410) | static nativeFunctionArguments() {
    method nativeFunctionReturnType (line 1414) | static nativeFunctionReturnType() {
    method combineKernels (line 1418) | static combineKernels(combinedKernel) {
    method getSignature (line 1422) | static getSignature(kernel, argumentTypes) {
    method constructor (line 1426) | constructor(source, settings) {
    method initCanvas (line 1442) | initCanvas() {
    method initContext (line 1450) | initContext() {
    method initPlugins (line 1455) | initPlugins(settings) {
    method validateSettings (line 1459) | validateSettings(args) {
    method translateSource (line 1484) | translateSource() {
    method build (line 1503) | build() {
    method color (line 1543) | color(r, g, b, a) {
    method getKernelString (line 1567) | getKernelString() {
    method toString (line 1597) | toString() {
    method _getLoopMaxString (line 1601) | _getLoopMaxString() {
    method _processConstants (line 1609) | _processConstants() {
    method _earlyThrows (line 1637) | _earlyThrows() {
    method _processArguments (line 1657) | _processArguments() {
    method _mediaTo2DArray (line 1703) | _mediaTo2DArray(media) {
    method getPixels (line 1737) | getPixels(flip) {
    method _imageTo3DArray (line 1742) | _imageTo3DArray(images) {
    method _resultKernelHeader (line 1750) | _resultKernelHeader() {
    method _resultKernelBody (line 1764) | _resultKernelBody(kernelString) {
    method _graphicalKernelBody (line 1777) | _graphicalKernelBody(kernelThreadString) {
    method _graphicalOutput (line 1786) | _graphicalOutput() {
    method _getKernelResultTypeConstructorString (line 1793) | _getKernelResultTypeConstructorString() {
    method _resultImmutableKernel1DLoop (line 1812) | _resultImmutableKernel1DLoop(kernelString) {
    method _mutableKernel1DResults (line 1826) | _mutableKernel1DResults() {
    method _resultMutableKernel1DLoop (line 1834) | _resultMutableKernel1DLoop(kernelString) {
    method _resultImmutableKernel2DLoop (line 1844) | _resultImmutableKernel2DLoop(kernelString) {
    method _mutableKernel2DResults (line 1863) | _mutableKernel2DResults() {
    method _resultMutableKernel2DLoop (line 1876) | _resultMutableKernel2DLoop(kernelString) {
    method _graphicalKernel2DLoop (line 1892) | _graphicalKernel2DLoop(kernelString) {
    method _resultImmutableKernel3DLoop (line 1905) | _resultImmutableKernel3DLoop(kernelString) {
    method _mutableKernel3DResults (line 1929) | _mutableKernel3DResults() {
    method _resultMutableKernel3DLoop (line 1947) | _resultMutableKernel3DLoop(kernelString) {
    method _kernelOutput (line 1965) | _kernelOutput() {
    method _mapSubKernels (line 1975) | _mapSubKernels(fn) {
    method destroy (line 1980) | destroy(removeCanvasReference) {
    method destroyContext (line 1986) | static destroyContext(context) {}
    method toJSON (line 1988) | toJSON() {
    method setOutput (line 1994) | setOutput(output) {
    method prependString (line 2003) | prependString(value) {
    method hasPrependString (line 2008) | hasPrependString(value) {
  class FunctionBuilder (line 2017) | class FunctionBuilder {
    method fromKernel (line 2018) | static fromKernel(kernel, FunctionNode, extraNodeOptions) {
    method constructor (line 2205) | constructor(settings) {
    method addFunctionNode (line 2242) | addFunctionNode(functionNode) {
    method traceFunctionCalls (line 2250) | traceFunctionCalls(functionName, retList) {
    method getPrototypeString (line 2283) | getPrototypeString(functionName) {
    method getPrototypes (line 2287) | getPrototypes(functionName) {
    method getStringFromFunctionNames (line 2297) | getStringFromFunctionNames(functionList) {
    method getPrototypesFromFunctionNames (line 2308) | getPrototypesFromFunctionNames(functionList) {
    method toJSON (line 2325) | toJSON() {
    method fromJSON (line 2341) | fromJSON(jsonFunctionNodes, FunctionNode) {
    method getString (line 2350) | getString(functionName) {
    method lookupReturnType (line 2357) | lookupReturnType(functionName, ast, requestingNode) {
    method _getFunction (line 2401) | _getFunction(functionName) {
    method _isFunction (line 2408) | _isFunction(functionName) {
    method _getNativeFunction (line 2412) | _getNativeFunction(functionName) {
    method _isNativeFunction (line 2419) | _isNativeFunction(functionName) {
    method _lookupNativeFunctionReturnType (line 2423) | _lookupNativeFunctionReturnType(functionName) {
    method lookupFunctionArgumentTypes (line 2431) | lookupFunctionArgumentTypes(functionName) {
    method lookupFunctionArgumentName (line 2440) | lookupFunctionArgumentName(functionName, argumentIndex) {
    method lookupFunctionArgumentBitRatio (line 2444) | lookupFunctionArgumentBitRatio(functionName, argumentName) {
    method needsArgumentType (line 2466) | needsArgumentType(functionName, i) {
    method assignArgumentType (line 2472) | assignArgumentType(functionName, i, argumentType, requestingNode) {
    method assignArgumentBitRatio (line 2480) | assignArgumentBitRatio(functionName, argumentName, calleeFunctionName,...
    method trackFunctionCall (line 2506) | trackFunctionCall(functionName, calleeFunctionName, args) {
    method getKernelResultType (line 2515) | getKernelResultType() {
    method getSubKernelResultType (line 2519) | getSubKernelResultType(index) {
    method getReturnTypes (line 2534) | getReturnTypes() {
  class FunctionNode (line 2556) | class FunctionNode {
    method constructor (line 2557) | constructor(source, settings) {
    method validate (line 2620) | validate() {
    method isIdentifierConstant (line 2642) | isIdentifierConstant(name) {
    method isInput (line 2647) | isInput(argumentName) {
    method pushState (line 2651) | pushState(state) {
    method popState (line 2655) | popState(state) {
    method isState (line 2662) | isState(state) {
    method state (line 2666) | get state() {
    method astMemberExpressionUnroll (line 2670) | astMemberExpressionUnroll(ast) {
    method getJsAST (line 2701) | getJsAST(inParser) {
    method traceFunctionAST (line 2728) | traceFunctionAST(ast) {
    method getDeclaration (line 2774) | getDeclaration(ast) {
    method getVariableType (line 2784) | getVariableType(ast) {
    method getLookupType (line 2807) | getLookupType(type) {
    method getConstantType (line 2814) | getConstantType(constantName) {
    method toString (line 2826) | toString() {
    method toJSON (line 2831) | toJSON() {
    method getType (line 2856) | getType(ast) {
    method getCheckVariableType (line 3072) | getCheckVariableType(ast) {
    method inferArgumentTypesIfNeeded (line 3080) | inferArgumentTypesIfNeeded(functionName, args) {
    method isAstMathVariable (line 3091) | isAstMathVariable(ast) {
    method isAstMathFunction (line 3110) | isAstMathFunction(ast) {
    method isAstVariable (line 3158) | isAstVariable(ast) {
    method isSafe (line 3162) | isSafe(ast) {
    method isSafeDependencies (line 3166) | isSafeDependencies(dependencies) {
    method getDependencies (line 3170) | getDependencies(ast, dependencies, isNotSafe) {
    method getVariableSignature (line 3290) | getVariableSignature(ast, returnRawValue) {
    method build (line 3363) | build() {
    method astGeneric (line 3367) | astGeneric(ast, retArr) {
    method astErrorOutput (line 3442) | astErrorOutput(error, ast) {
    method astDebuggerStatement (line 3454) | astDebuggerStatement(arrNode, retArr) {
    method astConditionalExpression (line 3458) | astConditionalExpression(ast, retArr) {
    method astFunction (line 3472) | astFunction(ast, retArr) {
    method astFunctionDeclaration (line 3476) | astFunctionDeclaration(ast, retArr) {
    method astFunctionExpression (line 3482) | astFunctionExpression(ast, retArr) {
    method isChildFunction (line 3488) | isChildFunction(ast) {
    method astReturnStatement (line 3496) | astReturnStatement(ast, retArr) {
    method astLiteral (line 3499) | astLiteral(ast, retArr) {
    method astBinaryExpression (line 3503) | astBinaryExpression(ast, retArr) {
    method astIdentifierExpression (line 3506) | astIdentifierExpression(ast, retArr) {
    method astAssignmentExpression (line 3509) | astAssignmentExpression(ast, retArr) {
    method astExpressionStatement (line 3512) | astExpressionStatement(esNode, retArr) {
    method astEmptyStatement (line 3517) | astEmptyStatement(eNode, retArr) {
    method astBlockStatement (line 3520) | astBlockStatement(ast, retArr) {
    method astIfStatement (line 3523) | astIfStatement(ast, retArr) {
    method astSwitchStatement (line 3526) | astSwitchStatement(ast, retArr) {
    method astBreakStatement (line 3529) | astBreakStatement(brNode, retArr) {
    method astContinueStatement (line 3533) | astContinueStatement(crNode, retArr) {
    method astForStatement (line 3537) | astForStatement(ast, retArr) {
    method astWhileStatement (line 3540) | astWhileStatement(ast, retArr) {
    method astDoWhileStatement (line 3543) | astDoWhileStatement(ast, retArr) {
    method astVariableDeclarator (line 3546) | astVariableDeclarator(iVarDecNode, retArr) {
    method astThisExpression (line 3554) | astThisExpression(ast, retArr) {
    method astSequenceExpression (line 3557) | astSequenceExpression(sNode, retArr) {
    method astUnaryExpression (line 3573) | astUnaryExpression(uNode, retArr) {
    method checkAndUpconvertBitwiseUnary (line 3590) | checkAndUpconvertBitwiseUnary(uNode, retArr) {}
    method astUpdateExpression (line 3592) | astUpdateExpression(uNode, retArr) {
    method astLogicalExpression (line 3603) | astLogicalExpression(logNode, retArr) {
    method astMemberExpression (line 3611) | astMemberExpression(ast, retArr) {
    method astCallExpression (line 3614) | astCallExpression(ast, retArr) {
    method astArrayExpression (line 3617) | astArrayExpression(ast, retArr) {
    method getMemberExpressionDetails (line 3621) | getMemberExpressionDetails(ast) {
    method findIdentifierOrigin (line 3801) | findIdentifierOrigin(astToFind) {
    method findLastReturn (line 3825) | findLastReturn(ast) {
    method getInternalVariableName (line 3855) | getInternalVariableName(name) {
    method astKey (line 3866) | astKey(ast, separator = ',') {
  function last (line 3916) | function last(array) {
  class FunctionTracer (line 3926) | class FunctionTracer {
    method constructor (line 3927) | constructor(ast) {
    method isState (line 3942) | isState(state) {
    method hasState (line 3946) | hasState(state) {
    method pushState (line 3950) | pushState(state) {
    method popState (line 3954) | popState(state) {
    method currentFunctionContext (line 3962) | get currentFunctionContext() {
    method currentContext (line 3966) | get currentContext() {
    method newFunctionContext (line 3970) | newFunctionContext() {
    method newContext (line 3976) | newContext(run) {
    method useFunctionContext (line 3990) | useFunctionContext(run) {
    method getIdentifiers (line 3997) | getIdentifiers(run) {
    method getDeclaration (line 4006) | getDeclaration(name) {
    method scan (line 4024) | scan(ast) {
  function toStringWithoutUtils (line 4217) | function toStringWithoutUtils(fn) {
  function glKernelString (line 4224) | function glKernelString(Kernel, args, originKernel, setupContextString, ...
  function getRenderString (line 4451) | function getRenderString(targetName, kernel) {
  function getGetPixelsString (line 4463) | function getGetPixelsString(kernel) {
  function getToArrayString (line 4485) | function getToArrayString(kernelResult, textureName, framebufferName) {
  function findKernelValue (line 4522) | function findKernelValue(argument, kernelValues, values, context, upload...
  class GLKernel (line 4582) | class GLKernel extends Kernel {
    method mode (line 4583) | static get mode() {
    method getIsFloatRead (line 4587) | static getIsFloatRead() {
    method getIsIntegerDivisionAccurate (line 4607) | static getIsIntegerDivisionAccurate() {
    method getIsSpeedTacticSupported (line 4631) | static getIsSpeedTacticSupported() {
    method testCanvas (line 4654) | static get testCanvas() {
    method testContext (line 4658) | static get testContext() {
    method getFeatures (line 4662) | static getFeatures() {
    method setupFeatureChecks (line 4683) | static setupFeatureChecks() {
    method getSignature (line 4687) | static getSignature(kernel, argumentTypes) {
    method setFixIntegerDivisionAccuracy (line 4691) | setFixIntegerDivisionAccuracy(fix) {
    method setPrecision (line 4696) | setPrecision(flag) {
    method setFloatTextures (line 4701) | setFloatTextures(flag) {
    method nativeFunctionArguments (line 4707) | static nativeFunctionArguments(source) {
    method nativeFunctionReturnType (line 4812) | static nativeFunctionReturnType(source) {
    method combineKernels (line 4816) | static combineKernels(combinedKernel, lastKernel) {
    method constructor (line 4849) | constructor(source, settings) {
    method checkTextureSize (line 4865) | checkTextureSize() {
    method translateSource (line 4872) | translateSource() {
    method pickRenderStrategy (line 4876) | pickRenderStrategy(args) {
    method getKernelString (line 5159) | getKernelString() {
    method getMainResultTexture (line 5163) | getMainResultTexture() {
    method getMainResultKernelNumberTexture (line 5181) | getMainResultKernelNumberTexture() {
    method getMainResultSubKernelNumberTexture (line 5184) | getMainResultSubKernelNumberTexture() {
    method getMainResultKernelArray2Texture (line 5187) | getMainResultKernelArray2Texture() {
    method getMainResultSubKernelArray2Texture (line 5190) | getMainResultSubKernelArray2Texture() {
    method getMainResultKernelArray3Texture (line 5193) | getMainResultKernelArray3Texture() {
    method getMainResultSubKernelArray3Texture (line 5196) | getMainResultSubKernelArray3Texture() {
    method getMainResultKernelArray4Texture (line 5199) | getMainResultKernelArray4Texture() {
    method getMainResultSubKernelArray4Texture (line 5202) | getMainResultSubKernelArray4Texture() {
    method getMainResultGraphical (line 5205) | getMainResultGraphical() {
    method getMainResultMemoryOptimizedFloats (line 5208) | getMainResultMemoryOptimizedFloats() {
    method getMainResultPackedPixels (line 5211) | getMainResultPackedPixels() {
    method getMainResultString (line 5215) | getMainResultString() {
    method getMainResultNumberTexture (line 5228) | getMainResultNumberTexture() {
    method getMainResultArray2Texture (line 5233) | getMainResultArray2Texture() {
    method getMainResultArray3Texture (line 5238) | getMainResultArray3Texture() {
    method getMainResultArray4Texture (line 5243) | getMainResultArray4Texture() {
    method getFloatTacticDeclaration (line 5248) | getFloatTacticDeclaration() {
    method getIntTacticDeclaration (line 5253) | getIntTacticDeclaration() {
    method getSampler2DTacticDeclaration (line 5257) | getSampler2DTacticDeclaration() {
    method getSampler2DArrayTacticDeclaration (line 5261) | getSampler2DArrayTacticDeclaration() {
    method renderTexture (line 5265) | renderTexture() {
    method readPackedPixelsToUint8Array (line 5268) | readPackedPixelsToUint8Array() {
    method readPackedPixelsToFloat32Array (line 5279) | readPackedPixelsToFloat32Array() {
    method readFloatPixelsToFloat32Array (line 5283) | readFloatPixelsToFloat32Array() {
    method getPixels (line 5296) | getPixels(flip) {
    method renderKernelsToArrays (line 5307) | renderKernelsToArrays() {
    method renderKernelsToTextures (line 5317) | renderKernelsToTextures() {
    method resetSwitchingKernels (line 5333) | resetSwitchingKernels() {
    method setOutput (line 5339) | setOutput(output) {
    method renderValues (line 5394) | renderValues() {
    method switchKernels (line 5402) | switchKernels(reason) {
    method getVariablePrecisionString (line 5409) | getVariablePrecisionString(textureSize = this.texSize, tactic = this.t...
    method updateTextureArgumentRefs (line 5438) | updateTextureArgumentRefs(kernelValue, arg) {
    method onActivate (line 5472) | onActivate(previousKernel) {
    method initCanvas (line 5483) | initCanvas() {}
  class GLTextureArray2Float2D (line 5501) | class GLTextureArray2Float2D extends GLTextureFloat {
    method constructor (line 5502) | constructor(settings) {
    method toArray (line 5506) | toArray() {
  class GLTextureArray2Float3D (line 5518) | class GLTextureArray2Float3D extends GLTextureFloat {
    method constructor (line 5519) | constructor(settings) {
    method toArray (line 5523) | toArray() {
  class GLTextureArray2Float (line 5535) | class GLTextureArray2Float extends GLTextureFloat {
    method constructor (line 5536) | constructor(settings) {
    method toArray (line 5540) | toArray() {
  class GLTextureArray3Float2D (line 5552) | class GLTextureArray3Float2D extends GLTextureFloat {
    method constructor (line 5553) | constructor(settings) {
    method toArray (line 5557) | toArray() {
  class GLTextureArray3Float3D (line 5569) | class GLTextureArray3Float3D extends GLTextureFloat {
    method constructor (line 5570) | constructor(settings) {
    method toArray (line 5574) | toArray() {
  class GLTextureArray3Float (line 5586) | class GLTextureArray3Float extends GLTextureFloat {
    method constructor (line 5587) | constructor(settings) {
    method toArray (line 5591) | toArray() {
  class GLTextureArray4Float2D (line 5603) | class GLTextureArray4Float2D extends GLTextureFloat {
    method constructor (line 5604) | constructor(settings) {
    method toArray (line 5608) | toArray() {
  class GLTextureArray4Float3D (line 5620) | class GLTextureArray4Float3D extends GLTextureFloat {
    method constructor (line 5621) | constructor(settings) {
    method toArray (line 5625) | toArray() {
  class GLTextureArray4Float (line 5637) | class GLTextureArray4Float extends GLTextureFloat {
    method constructor (line 5638) | constructor(settings) {
    method toArray (line 5642) | toArray() {
  class GLTextureFloat2D (line 5654) | class GLTextureFloat2D extends GLTextureFloat {
    method constructor (line 5655) | constructor(settings) {
    method toArray (line 5659) | toArray() {
  class GLTextureFloat3D (line 5671) | class GLTextureFloat3D extends GLTextureFloat {
    method constructor (line 5672) | constructor(settings) {
    method toArray (line 5676) | toArray() {
  class GLTextureFloat (line 5688) | class GLTextureFloat extends GLTexture {
    method textureType (line 5689) | get textureType() {
    method constructor (line 5692) | constructor(settings) {
    method renderRawOutput (line 5696) | renderRawOutput() {
    method renderValues (line 5711) | renderValues() {
    method toArray (line 5715) | toArray() {
  class GLTextureGraphical (line 5726) | class GLTextureGraphical extends GLTextureUnsigned {
    method constructor (line 5727) | constructor(settings) {
    method toArray (line 5731) | toArray() {
  class GLTexture (line 5742) | class GLTexture extends Texture {
    method textureType (line 5743) | get textureType() {
    method clone (line 5747) | clone() {
    method beforeMutate (line 5751) | beforeMutate() {
    method cloneTexture (line 5759) | cloneTexture() {
    method newTexture (line 5776) | newTexture() {
    method clear (line 5791) | clear() {
    method delete (line 5810) | delete() {
    method framebuffer (line 5820) | framebuffer() {
  function selectTexture (line 5828) | function selectTexture(gl, texture) {
  class GLTextureMemoryOptimized2D (line 5842) | class GLTextureMemoryOptimized2D extends GLTextureFloat {
    method constructor (line 5843) | constructor(settings) {
    method toArray (line 5847) | toArray() {
  class GLTextureMemoryOptimized3D (line 5859) | class GLTextureMemoryOptimized3D extends GLTextureFloat {
    method constructor (line 5860) | constructor(settings) {
    method toArray (line 5864) | toArray() {
  class GLTextureMemoryOptimized (line 5876) | class GLTextureMemoryOptimized extends GLTextureFloat {
    method constructor (line 5877) | constructor(settings) {
    method toArray (line 5881) | toArray() {
  class GLTextureUnsigned2D (line 5893) | class GLTextureUnsigned2D extends GLTextureUnsigned {
    method constructor (line 5894) | constructor(settings) {
    method toArray (line 5898) | toArray() {
  class GLTextureUnsigned3D (line 5910) | class GLTextureUnsigned3D extends GLTextureUnsigned {
    method constructor (line 5911) | constructor(settings) {
    method toArray (line 5915) | toArray() {
  class GLTextureUnsigned (line 5927) | class GLTextureUnsigned extends GLTexture {
    method textureType (line 5928) | get textureType() {
    method constructor (line 5931) | constructor(settings) {
    method renderRawOutput (line 5935) | renderRawOutput() {
    method renderValues (line 5949) | renderValues() {
    method toArray (line 5953) | toArray() {
  class HeadlessGLKernel (line 5972) | class HeadlessGLKernel extends WebGLKernel {
    method isSupported (line 5973) | static get isSupported() {
    method setupFeatureChecks (line 5980) | static setupFeatureChecks() {
    method isContextMatch (line 6004) | static isContextMatch(context) {
    method getIsTextureFloat (line 6012) | static getIsTextureFloat() {
    method getIsDrawBuffers (line 6016) | static getIsDrawBuffers() {
    method getChannelCount (line 6020) | static getChannelCount() {
    method getMaxTextureSize (line 6026) | static getMaxTextureSize() {
    method testCanvas (line 6030) | static get testCanvas() {
    method testContext (line 6034) | static get testContext() {
    method features (line 6038) | static get features() {
    method initCanvas (line 6042) | initCanvas() {
    method initContext (line 6046) | initContext() {
    method initExtensions (line 6052) | initExtensions() {
    method build (line 6063) | build() {
    method destroyExtensions (line 6070) | destroyExtensions() {
    method destroyContext (line 6079) | static destroyContext(context) {
    method toString (line 6086) | toString() {
    method setOutput (line 6092) | setOutput(output) {
  class KernelValue (line 6105) | class KernelValue {
    method constructor (line 6106) | constructor(value, settings) {
    method id (line 6151) | get id() {
    method getSource (line 6155) | getSource() {
    method updateValue (line 6159) | updateValue(value) {
  class Kernel (line 6171) | class Kernel {
    method isSupported (line 6172) | static get isSupported() {
    method isContextMatch (line 6176) | static isContextMatch(context) {
    method getFeatures (line 6180) | static getFeatures() {
    method destroyContext (line 6184) | static destroyContext(context) {
    method nativeFunctionArguments (line 6188) | static nativeFunctionArguments() {
    method nativeFunctionReturnType (line 6192) | static nativeFunctionReturnType() {
    method combineKernels (line 6196) | static combineKernels() {
    method constructor (line 6200) | constructor(source, settings) {
    method mergeSettings (line 6280) | mergeSettings(settings) {
    method build (line 6319) | build() {
    method run (line 6323) | run() {
    method initCanvas (line 6327) | initCanvas() {
    method initContext (line 6331) | initContext() {
    method initPlugins (line 6335) | initPlugins(settings) {
    method addFunction (line 6339) | addFunction(source, settings = {}) {
    method addNativeFunction (line 6352) | addNativeFunction(name, source, settings = {}) {
    method setupArguments (line 6367) | setupArguments(args) {
    method setupConstants (line 6403) | setupConstants() {
    method setOptimizeFloatMemory (line 6430) | setOptimizeFloatMemory(flag) {
    method toKernelOutput (line 6435) | toKernelOutput(output) {
    method setOutput (line 6451) | setOutput(output) {
    method setDebug (line 6456) | setDebug(flag) {
    method setGraphical (line 6461) | setGraphical(flag) {
    method setLoopMaxIterations (line 6467) | setLoopMaxIterations(max) {
    method setConstants (line 6472) | setConstants(constants) {
    method setConstantTypes (line 6477) | setConstantTypes(constantTypes) {
    method setFunctions (line 6482) | setFunctions(functions) {
    method setNativeFunctions (line 6489) | setNativeFunctions(nativeFunctions) {
    method setInjectedNative (line 6498) | setInjectedNative(injectedNative) {
    method setPipeline (line 6503) | setPipeline(flag) {
    method setPrecision (line 6508) | setPrecision(flag) {
    method setDimensions (line 6513) | setDimensions(flag) {
    method setOutputToTexture (line 6519) | setOutputToTexture(flag) {
    method setImmutable (line 6525) | setImmutable(flag) {
    method setCanvas (line 6530) | setCanvas(canvas) {
    method setStrictIntegers (line 6535) | setStrictIntegers(flag) {
    method setDynamicOutput (line 6540) | setDynamicOutput(flag) {
    method setHardcodeConstants (line 6545) | setHardcodeConstants(flag) {
    method setDynamicArguments (line 6552) | setDynamicArguments(flag) {
    method setUseLegacyEncoder (line 6557) | setUseLegacyEncoder(flag) {
    method setWarnVarUsage (line 6562) | setWarnVarUsage(flag) {
    method getCanvas (line 6567) | getCanvas() {
    method getWebGl (line 6572) | getWebGl() {
    method setContext (line 6577) | setContext(context) {
    method setArgumentTypes (line 6582) | setArgumentTypes(argumentTypes) {
    method setTactic (line 6597) | setTactic(tactic) {
    method requestFallback (line 6602) | requestFallback(args) {
    method validateSettings (line 6610) | validateSettings() {
    method addSubKernel (line 6614) | addSubKernel(subKernel) {
    method destroy (line 6625) | destroy(removeCanvasReferences) {
    method getBitRatio (line 6629) | getBitRatio(value) {
    method getPixels (line 6652) | getPixels(flip) {
    method checkOutput (line 6656) | checkOutput() {
    method prependString (line 6666) | prependString(value) {
    method hasPrependString (line 6670) | hasPrependString(value) {
    method toJSON (line 6674) | toJSON() {
    method buildSignature (line 6688) | buildSignature(args) {
    method getArgumentTypes (line 6693) | static getArgumentTypes(kernel, args) {
    method getSignature (line 6716) | static getSignature(kernel, argumentTypes) {
    method functionToIGPUFunction (line 6720) | functionToIGPUFunction(source, settings = {}) {
    method onActivate (line 6742) | onActivate(previousKernel) {}
  function splitArgumentTypes (line 6745) | function splitArgumentTypes(argumentTypesObject) {
  class WebGLFunctionNode (line 7258) | class WebGLFunctionNode extends FunctionNode {
    method constructor (line 7259) | constructor(source, settings) {
    method astConditionalExpression (line 7266) | astConditionalExpression(ast, retArr) {
    method astFunction (line 7294) | astFunction(ast, retArr) {
    method astReturnStatement (line 7361) | astReturnStatement(ast, retArr) {
    method astLiteral (line 7437) | astLiteral(ast, retArr) {
    method astBinaryExpression (line 7467) | astBinaryExpression(ast, retArr) {
    method checkAndUpconvertOperator (line 7648) | checkAndUpconvertOperator(ast, retArr) {
    method checkAndUpconvertBitwiseOperators (line 7686) | checkAndUpconvertBitwiseOperators(ast, retArr) {
    method checkAndUpconvertBitwiseUnary (line 7728) | checkAndUpconvertBitwiseUnary(ast, retArr) {
    method castLiteralToInteger (line 7751) | castLiteralToInteger(ast, retArr) {
    method castLiteralToFloat (line 7758) | castLiteralToFloat(ast, retArr) {
    method castValueToInteger (line 7765) | castValueToInteger(ast, retArr) {
    method castValueToFloat (line 7774) | castValueToFloat(ast, retArr) {
    method astIdentifierExpression (line 7783) | astIdentifierExpression(idtNode, retArr) {
    method astForStatement (line 7806) | astForStatement(forNode, retArr) {
    method astWhileStatement (line 7876) | astWhileStatement(whileNode, retArr) {
    method astDoWhileStatement (line 7892) | astDoWhileStatement(doWhileNode, retArr) {
    method astAssignmentExpression (line 7909) | astAssignmentExpression(assNode, retArr) {
    method astBlockStatement (line 7942) | astBlockStatement(bNode, retArr) {
    method astVariableDeclaration (line 7959) | astVariableDeclaration(varDecNode, retArr) {
    method astIfStatement (line 8037) | astIfStatement(ifNode, retArr) {
    method astSwitchStatement (line 8062) | astSwitchStatement(ast, retArr) {
    method astThisExpression (line 8154) | astThisExpression(tNode, retArr) {
    method astMemberExpression (line 8159) | astMemberExpression(mNode, retArr) {
    method astCallExpression (line 8429) | astCallExpression(ast, retArr) {
    method astArrayExpression (line 8597) | astArrayExpression(arrNode, retArr) {
    method memberExpressionXYZ (line 8623) | memberExpressionXYZ(x, y, z, retArr) {
    method memberExpressionPropertyMarkup (line 8638) | memberExpressionPropertyMarkup(property) {
  function lookupKernelValueType (line 8875) | function lookupKernelValueType(type, dynamic, precision, value) {
  class WebGLKernelArray (line 8905) | class WebGLKernelArray extends WebGLKernelValue {
    method checkSize (line 8906) | checkSize(width, height) {
    method setup (line 8920) | setup() {
    method requestTexture (line 8926) | requestTexture() {
    method defineTexture (line 8930) | defineTexture() {
    method setupTexture (line 8940) | setupTexture() {
    method getBitRatio (line 8947) | getBitRatio(value) {
    method destroy (line 8968) | destroy() {
  class WebGLKernelValueArray2 (line 8982) | class WebGLKernelValueArray2 extends WebGLKernelValue {
    method constructor (line 8983) | constructor(value, settings) {
    method getSource (line 8987) | getSource(value) {
    method getStringValueHandler (line 8994) | getStringValueHandler() {
    method updateValue (line 8999) | updateValue(value) {
  class WebGLKernelValueArray3 (line 9011) | class WebGLKernelValueArray3 extends WebGLKernelValue {
    method constructor (line 9012) | constructor(value, settings) {
    method getSource (line 9016) | getSource(value) {
    method getStringValueHandler (line 9023) | getStringValueHandler() {
    method updateValue (line 9028) | updateValue(value) {
  class WebGLKernelValueArray4 (line 9040) | class WebGLKernelValueArray4 extends WebGLKernelValue {
    method constructor (line 9041) | constructor(value, settings) {
    method getSource (line 9045) | getSource(value) {
    method getStringValueHandler (line 9052) | getStringValueHandler() {
    method updateValue (line 9057) | updateValue(value) {
  class WebGLKernelValueBoolean (line 9070) | class WebGLKernelValueBoolean extends WebGLKernelValue {
    method constructor (line 9071) | constructor(value, settings) {
    method getSource (line 9075) | getSource(value) {
    method getStringValueHandler (line 9082) | getStringValueHandler() {
    method updateValue (line 9086) | updateValue(value) {
  class WebGLKernelValueDynamicHTMLImage (line 9099) | class WebGLKernelValueDynamicHTMLImage extends WebGLKernelValueHTMLImage {
    method getSource (line 9100) | getSource() {
    method updateValue (line 9108) | updateValue(value) {
  class WebGLKernelValueDynamicHTMLVideo (line 9125) | class WebGLKernelValueDynamicHTMLVideo extends WebGLKernelValueDynamicHT...
  class WebGLKernelValueDynamicMemoryOptimizedNumberTexture (line 9134) | class WebGLKernelValueDynamicMemoryOptimizedNumberTexture extends WebGLK...
    method getSource (line 9135) | getSource() {
    method updateValue (line 9143) | updateValue(inputTexture) {
  class WebGLKernelValueDynamicNumberTexture (line 9160) | class WebGLKernelValueDynamicNumberTexture extends WebGLKernelValueNumbe...
    method getSource (line 9161) | getSource() {
    method updateValue (line 9169) | updateValue(value) {
  class WebGLKernelValueDynamicSingleArray (line 9186) | class WebGLKernelValueDynamicSingleArray extends WebGLKernelValueSingleA...
    method getSource (line 9187) | getSource() {
    method updateValue (line 9195) | updateValue(value) {
  class WebGLKernelValueDynamicSingleArray1DI (line 9214) | class WebGLKernelValueDynamicSingleArray1DI extends WebGLKernelValueSing...
    method getSource (line 9215) | getSource() {
    method updateValue (line 9223) | updateValue(value) {
  class WebGLKernelValueDynamicSingleArray2DI (line 9238) | class WebGLKernelValueDynamicSingleArray2DI extends WebGLKernelValueSing...
    method getSource (line 9239) | getSource() {
    method updateValue (line 9247) | updateValue(value) {
  class WebGLKernelValueDynamicSingleArray3DI (line 9262) | class WebGLKernelValueDynamicSingleArray3DI extends WebGLKernelValueSing...
    method getSource (line 9263) | getSource() {
    method updateValue (line 9271) | updateValue(value) {
  class WebGLKernelValueDynamicSingleInput (line 9286) | class WebGLKernelValueDynamicSingleInput extends WebGLKernelValueSingleI...
    method getSource (line 9287) | getSource() {
    method updateValue (line 9295) | updateValue(value) {
  class WebGLKernelValueDynamicUnsignedArray (line 9315) | class WebGLKernelValueDynamicUnsignedArray extends WebGLKernelValueUnsig...
    method getSource (line 9316) | getSource() {
    method updateValue (line 9324) | updateValue(value) {
  class WebGLKernelValueDynamicUnsignedInput (line 9345) | class WebGLKernelValueDynamicUnsignedInput extends WebGLKernelValueUnsig...
    method getSource (line 9346) | getSource() {
    method updateValue (line 9354) | updateValue(value) {
  class WebGLKernelValueFloat (line 9376) | class WebGLKernelValueFloat extends WebGLKernelValue {
    method constructor (line 9377) | constructor(value, settings) {
    method getStringValueHandler (line 9381) | getStringValueHandler() {
    method getSource (line 9384) | getSource(value) {
    method updateValue (line 9394) | updateValue(value) {
  class WebGLKernelValueHTMLImage (line 9407) | class WebGLKernelValueHTMLImage extends WebGLKernelArray {
    method constructor (line 9408) | constructor(value, settings) {
    method getStringValueHandler (line 9417) | getStringValueHandler() {
    method getSource (line 9421) | getSource() {
    method updateValue (line 9429) | updateValue(inputImage) {
  class WebGLKernelValueHTMLVideo (line 9449) | class WebGLKernelValueHTMLVideo extends WebGLKernelValueHTMLImage {}
  class WebGLKernelValue (line 9458) | class WebGLKernelValue extends KernelValue {
    method constructor (line 9459) | constructor(value, settings) {
    method id (line 9472) | get id() {
    method setup (line 9476) | setup() {}
    method getTransferArrayType (line 9478) | getTransferArrayType(value) {
    method getStringValueHandler (line 9500) | getStringValueHandler() {
    method getVariablePrecisionString (line 9504) | getVariablePrecisionString() {
    method destroy (line 9508) | destroy() {}
  class WebGLKernelValueInteger (line 9518) | class WebGLKernelValueInteger extends WebGLKernelValue {
    method constructor (line 9519) | constructor(value, settings) {
    method getStringValueHandler (line 9523) | getStringValueHandler() {
    method getSource (line 9526) | getSource(value) {
    method updateValue (line 9533) | updateValue(value) {
  class WebGLKernelValueMemoryOptimizedNumberTexture (line 9548) | class WebGLKernelValueMemoryOptimizedNumberTexture extends WebGLKernelAr...
    method constructor (line 9549) | constructor(value, settings) {
    method setup (line 9559) | setup() {
    method getStringValueHandler (line 9563) | getStringValueHandler() {
    method getSource (line 9567) | getSource() {
    method updateValue (line 9575) | updateValue(inputTexture) {
  class WebGLKernelValueNumberTexture (line 9617) | class WebGLKernelValueNumberTexture extends WebGLKernelArray {
    method constructor (line 9618) | constructor(value, settings) {
    method setup (line 9630) | setup() {
    method getStringValueHandler (line 9634) | getStringValueHandler() {
    method getSource (line 9638) | getSource() {
    method updateValue (line 9646) | updateValue(inputTexture) {
  class WebGLKernelValueSingleArray (line 9686) | class WebGLKernelValueSingleArray extends WebGLKernelArray {
    method constructor (line 9687) | constructor(value, settings) {
    method getStringValueHandler (line 9697) | getStringValueHandler() {
    method getSource (line 9704) | getSource() {
    method updateValue (line 9712) | updateValue(value) {
  class WebGLKernelValueSingleArray1DI (line 9734) | class WebGLKernelValueSingleArray1DI extends WebGLKernelArray {
    method constructor (line 9735) | constructor(value, settings) {
    method setShape (line 9741) | setShape(value) {
    method getStringValueHandler (line 9750) | getStringValueHandler() {
    method getSource (line 9757) | getSource() {
    method updateValue (line 9765) | updateValue(value) {
  class WebGLKernelValueSingleArray2DI (line 9787) | class WebGLKernelValueSingleArray2DI extends WebGLKernelArray {
    method constructor (line 9788) | constructor(value, settings) {
    method setShape (line 9794) | setShape(value) {
    method getStringValueHandler (line 9803) | getStringValueHandler() {
    method getSource (line 9810) | getSource() {
    method updateValue (line 9818) | updateValue(value) {
  class WebGLKernelValueSingleArray3DI (line 9840) | class WebGLKernelValueSingleArray3DI extends WebGLKernelArray {
    method constructor (line 9841) | constructor(value, settings) {
    method setShape (line 9847) | setShape(value) {
    method getStringValueHandler (line 9856) | getStringValueHandler() {
    method getSource (line 9863) | getSource() {
    method updateValue (line 9871) | updateValue(value) {
  class WebGLKernelValueSingleInput (line 9893) | class WebGLKernelValueSingleInput extends WebGLKernelArray {
    method constructor (line 9894) | constructor(value, settings) {
    method getStringValueHandler (line 9905) | getStringValueHandler() {
    method getSource (line 9912) | getSource() {
    method updateValue (line 9920) | updateValue(input) {
  class WebGLKernelValueUnsignedArray (line 9942) | class WebGLKernelValueUnsignedArray extends WebGLKernelArray {
    method constructor (line 9943) | constructor(value, settings) {
    method getStringValueHandler (line 9955) | getStringValueHandler() {
    method getSource (line 9963) | getSource() {
    method updateValue (line 9971) | updateValue(value) {
  class WebGLKernelValueUnsignedInput (line 9993) | class WebGLKernelValueUnsignedInput extends WebGLKernelArray {
    method constructor (line 9994) | constructor(value, settings) {
    method getStringValueHandler (line 10007) | getStringValueHandler() {
    method getSource (line 10015) | getSource() {
    method updateValue (line 10023) | updateValue(input) {
  class WebGLKernel (line 10063) | class WebGLKernel extends GLKernel {
    method isSupported (line 10064) | static get isSupported() {
    method setupFeatureChecks (line 10073) | static setupFeatureChecks() {
    method isContextMatch (line 10091) | static isContextMatch(context) {
    method getIsTextureFloat (line 10098) | static getIsTextureFloat() {
    method getIsDrawBuffers (line 10102) | static getIsDrawBuffers() {
    method getChannelCount (line 10106) | static getChannelCount() {
    method getMaxTextureSize (line 10112) | static getMaxTextureSize() {
    method lookupKernelValueType (line 10116) | static lookupKernelValueType(type, dynamic, precision, value) {
    method testCanvas (line 10120) | static get testCanvas() {
    method testContext (line 10124) | static get testContext() {
    method features (line 10128) | static get features() {
    method fragmentShader (line 10132) | static get fragmentShader() {
    method vertexShader (line 10136) | static get vertexShader() {
    method constructor (line 10140) | constructor(source, settings) {
    method initCanvas (line 10176) | initCanvas() {
    method initContext (line 10187) | initContext() {
    method initPlugins (line 10196) | initPlugins(settings) {
    method initExtensions (line 10220) | initExtensions() {
    method validateSettings (line 10230) | validateSettings(args) {
    method updateMaxTexSize (line 10308) | updateMaxTexSize() {
    method setupArguments (line 10327) | setupArguments(args) {
    method createTexture (line 10397) | createTexture() {
    method setupConstants (line 10403) | setupConstants(args) {
    method build (line 10454) | build() {
    method translateSource (line 10568) | translateSource() {
    method setupReturnTypes (line 10576) | setupReturnTypes(functionBuilder) {
    method run (line 10591) | run() {
    method drawBuffers (line 10653) | drawBuffers() {
    method getInternalFormat (line 10657) | getInternalFormat() {
    method getTextureFormat (line 10660) | getTextureFormat() {
    method _replaceOutputTexture (line 10670) | _replaceOutputTexture() {
    method _setupOutputTexture (line 10678) | _setupOutputTexture() {
    method _replaceSubOutputTextures (line 10711) | _replaceSubOutputTextures() {
    method _setupSubOutputTextures (line 10722) | _setupSubOutputTextures() {
    method setUniform1f (line 10762) | setUniform1f(name, value) {
    method setUniform1i (line 10774) | setUniform1i(name, value) {
    method setUniform2f (line 10786) | setUniform2f(name, value1, value2) {
    method setUniform2fv (line 10801) | setUniform2fv(name, value) {
    method setUniform2iv (line 10816) | setUniform2iv(name, value) {
    method setUniform3fv (line 10831) | setUniform3fv(name, value) {
    method setUniform3iv (line 10847) | setUniform3iv(name, value) {
    method setUniform4fv (line 10863) | setUniform4fv(name, value) {
    method setUniform4iv (line 10880) | setUniform4iv(name, value) {
    method getUniformLocation (line 10897) | getUniformLocation(name) {
    method _getFragShaderArtifactMap (line 10904) | _getFragShaderArtifactMap(args) {
    method _getVertShaderArtifactMap (line 10925) | _getVertShaderArtifactMap(args) {
    method _getHeaderString (line 10934) | _getHeaderString() {
    method _getLoopMaxString (line 10942) | _getLoopMaxString() {
    method _getPluginsString (line 10950) | _getPluginsString() {
    method _getConstantsString (line 10955) | _getConstantsString() {
    method _getTextureCoordinate (line 10972) | _getTextureCoordinate() {
    method _getDecode32EndiannessString (line 10981) | _getDecode32EndiannessString() {
    method _getEncode32EndiannessString (line 10989) | _getEncode32EndiannessString() {
    method _getDivideWithIntegerCheckString (line 10997) | _getDivideWithIntegerCheckString() {
    method _getMainArgumentsString (line 11022) | _getMainArgumentsString(args) {
    method _getInjectedNative (line 11031) | _getInjectedNative() {
    method _getMainConstantsString (line 11035) | _getMainConstantsString() {
    method getRawValueFramebuffer (line 11048) | getRawValueFramebuffer(width, height) {
    method getKernelResultDeclaration (line 11061) | getKernelResultDeclaration() {
    method getKernelString (line 11082) | getKernelString() {
    method getMainResultGraphical (line 11126) | getMainResultGraphical() {
    method getMainResultPackedPixels (line 11134) | getMainResultPackedPixels() {
    method getMainResultKernelPackedPixels (line 11147) | getMainResultKernelPackedPixels() {
    method getMainResultSubKernelPackedPixels (line 11155) | getMainResultSubKernelPackedPixels() {
    method getMainResultMemoryOptimizedFloats (line 11173) | getMainResultMemoryOptimizedFloats() {
    method getMainResultKernelMemoryOptimizedFloats (line 11199) | getMainResultKernelMemoryOptimizedFloats(result, channel) {
    method getMainResultSubKernelMemoryOptimizedFloats (line 11207) | getMainResultSubKernelMemoryOptimizedFloats(result, channel) {
    method getMainResultKernelNumberTexture (line 11223) | getMainResultKernelNumberTexture() {
    method getMainResultSubKernelNumberTexture (line 11231) | getMainResultSubKernelNumberTexture() {
    method getMainResultKernelArray2Texture (line 11249) | getMainResultKernelArray2Texture() {
    method getMainResultSubKernelArray2Texture (line 11258) | getMainResultSubKernelArray2Texture() {
    method getMainResultKernelArray3Texture (line 11270) | getMainResultKernelArray3Texture() {
    method getMainResultSubKernelArray3Texture (line 11280) | getMainResultSubKernelArray3Texture() {
    method getMainResultKernelArray4Texture (line 11293) | getMainResultKernelArray4Texture() {
    method getMainResultSubKernelArray4Texture (line 11301) | getMainResultSubKernelArray4Texture() {
    method replaceArtifacts (line 11353) | replaceArtifacts(src, map) {
    method getFragmentShader (line 11362) | getFragmentShader(args) {
    method getVertexShader (line 11369) | getVertexShader(args) {
    method toString (line 11376) | toString() {
    method destroy (line 11383) | destroy(removeCanvasReferences) {
    method destroyExtensions (line 11456) | destroyExtensions() {
    method destroyContext (line 11463) | static destroyContext(context) {
    method toJSON (line 11470) | toJSON() {
  class WebGL2FunctionNode (line 11956) | class WebGL2FunctionNode extends WebGLFunctionNode {
    method astIdentifierExpression (line 11958) | astIdentifierExpression(idtNode, retArr) {
  function lookupKernelValueType (line 12168) | function lookupKernelValueType(type, dynamic, precision, value) {
  class WebGL2KernelValueArray2 (line 12197) | class WebGL2KernelValueArray2 extends WebGLKernelValueArray2 {}
  class WebGL2KernelValueArray3 (line 12205) | class WebGL2KernelValueArray3 extends WebGLKernelValueArray3 {}
  class WebGL2KernelValueArray4 (line 12213) | class WebGL2KernelValueArray4 extends WebGLKernelValueArray4 {}
  class WebGL2KernelValueBoolean (line 12221) | class WebGL2KernelValueBoolean extends WebGLKernelValueBoolean {}
  class WebGL2KernelValueDynamicHTMLImageArray (line 12230) | class WebGL2KernelValueDynamicHTMLImageArray extends WebGL2KernelValueHT...
    method getSource (line 12231) | getSource() {
    method updateValue (line 12240) | updateValue(images) {
  class WebGL2KernelValueDynamicHTMLImage (line 12258) | class WebGL2KernelValueDynamicHTMLImage extends WebGLKernelValueDynamicH...
    method getSource (line 12259) | getSource() {
  class WebGL2KernelValueDynamicHTMLVideo (line 12276) | class WebGL2KernelValueDynamicHTMLVideo extends WebGL2KernelValueDynamic...
  class WebGL2KernelValueDynamicMemoryOptimizedNumberTexture (line 12285) | class WebGL2KernelValueDynamicMemoryOptimizedNumberTexture extends WebGL...
    method getSource (line 12286) | getSource() {
  class WebGL2KernelValueDynamicNumberTexture (line 12302) | class WebGL2KernelValueDynamicNumberTexture extends WebGLKernelValueDyna...
    method getSource (line 12303) | getSource() {
  class WebGL2KernelValueDynamicSingleArray (line 12320) | class WebGL2KernelValueDynamicSingleArray extends WebGL2KernelValueSingl...
    method getSource (line 12321) | getSource() {
    method updateValue (line 12330) | updateValue(value) {
  class WebGL2KernelValueDynamicSingleArray1DI (line 12349) | class WebGL2KernelValueDynamicSingleArray1DI extends WebGL2KernelValueSi...
    method getSource (line 12350) | getSource() {
    method updateValue (line 12359) | updateValue(value) {
  class WebGL2KernelValueDynamicSingleArray2DI (line 12374) | class WebGL2KernelValueDynamicSingleArray2DI extends WebGL2KernelValueSi...
    method getSource (line 12375) | getSource() {
    method updateValue (line 12384) | updateValue(value) {
  class WebGL2KernelValueDynamicSingleArray3DI (line 12399) | class WebGL2KernelValueDynamicSingleArray3DI extends WebGL2KernelValueSi...
    method getSource (line 12400) | getSource() {
    method updateValue (line 12409) | updateValue(value) {
  class WebGL2KernelValueDynamicSingleInput (line 12424) | class WebGL2KernelValueDynamicSingleInput extends WebGL2KernelValueSingl...
    method getSource (line 12425) | getSource() {
    method updateValue (line 12434) | updateValue(value) {
  class WebGL2KernelValueDynamicUnsignedArray (line 12454) | class WebGL2KernelValueDynamicUnsignedArray extends WebGLKernelValueDyna...
    method getSource (line 12455) | getSource() {
  class WebGL2KernelValueDynamicUnsignedInput (line 12472) | class WebGL2KernelValueDynamicUnsignedInput extends WebGLKernelValueDyna...
    method getSource (line 12473) | getSource() {
  class WebGL2KernelValueFloat (line 12490) | class WebGL2KernelValueFloat extends WebGLKernelValueFloat {}
  class WebGL2KernelValueHTMLImageArray (line 12499) | class WebGL2KernelValueHTMLImageArray extends WebGLKernelArray {
    method constructor (line 12500) | constructor(value, settings) {
    method defineTexture (line 12506) | defineTexture() {
    method getStringValueHandler (line 12514) | getStringValueHandler() {
    method getSource (line 12517) | getSource() {
    method updateValue (line 12526) | updateValue(images) {
  class WebGL2KernelValueHTMLImage (line 12572) | class WebGL2KernelValueHTMLImage extends WebGLKernelValueHTMLImage {
    method getSource (line 12573) | getSource() {
  class WebGL2KernelValueHTMLVideo (line 12590) | class WebGL2KernelValueHTMLVideo extends WebGL2KernelValueHTMLImage {}
  class WebGL2KernelValueInteger (line 12598) | class WebGL2KernelValueInteger extends WebGLKernelValueInteger {
    method getSource (line 12599) | getSource(value) {
    method updateValue (line 12607) | updateValue(value) {
  class WebGL2KernelValueMemoryOptimizedNumberTexture (line 12620) | class WebGL2KernelValueMemoryOptimizedNumberTexture extends WebGLKernelV...
    method getSource (line 12621) | getSource() {
  class WebGL2KernelValueNumberTexture (line 12639) | class WebGL2KernelValueNumberTexture extends WebGLKernelValueNumberTextu...
    method getSource (line 12640) | getSource() {
  class WebGL2KernelValueSingleArray (line 12658) | class WebGL2KernelValueSingleArray extends WebGLKernelValueSingleArray {
    method getSource (line 12659) | getSource() {
    method updateValue (line 12668) | updateValue(value) {
  class WebGL2KernelValueSingleArray1DI (line 12690) | class WebGL2KernelValueSingleArray1DI extends WebGLKernelValueSingleArra...
    method updateValue (line 12691) | updateValue(value) {
  class WebGL2KernelValueSingleArray2DI (line 12713) | class WebGL2KernelValueSingleArray2DI extends WebGLKernelValueSingleArra...
    method updateValue (line 12714) | updateValue(value) {
  class WebGL2KernelValueSingleArray3DI (line 12736) | class WebGL2KernelValueSingleArray3DI extends WebGLKernelValueSingleArra...
    method updateValue (line 12737) | updateValue(value) {
  class WebGL2KernelValueSingleInput (line 12759) | class WebGL2KernelValueSingleInput extends WebGLKernelValueSingleInput {
    method getSource (line 12760) | getSource() {
    method updateValue (line 12769) | updateValue(input) {
  class WebGL2KernelValueUnsignedArray (line 12787) | class WebGL2KernelValueUnsignedArray extends WebGLKernelValueUnsignedArr...
    method getSource (line 12788) | getSource() {
  class WebGL2KernelValueUnsignedInput (line 12805) | class WebGL2KernelValueUnsignedInput extends WebGLKernelValueUnsignedInp...
    method getSource (line 12806) | getSource() {
  class WebGL2Kernel (line 12835) | class WebGL2Kernel extends WebGLKernel {
    method isSupported (line 12836) | static get isSupported() {
    method setupFeatureChecks (line 12845) | static setupFeatureChecks() {
    method isContextMatch (line 12861) | static isContextMatch(context) {
    method getFeatures (line 12868) | static getFeatures() {
    method getIsTextureFloat (line 12888) | static getIsTextureFloat() {
    method getChannelCount (line 12892) | static getChannelCount() {
    method getMaxTextureSize (line 12896) | static getMaxTextureSize() {
    method lookupKernelValueType (line 12900) | static lookupKernelValueType(type, dynamic, precision, value) {
    method testCanvas (line 12904) | static get testCanvas() {
    method testContext (line 12908) | static get testContext() {
    method features (line 12912) | static get features() {
    method fragmentShader (line 12916) | static get fragmentShader() {
    method vertexShader (line 12919) | static get vertexShader() {
    method initContext (line 12923) | initContext() {
    method initExtensions (line 12932) | initExtensions() {
    method validateSettings (line 12939) | validateSettings(args) {
    method translateSource (line 13010) | translateSource() {
    method drawBuffers (line 13018) | drawBuffers() {
    method getTextureFormat (line 13022) | getTextureFormat() {
    method getInternalFormat (line 13037) | getInternalFormat() {
    method _setupOutputTexture (line 13065) | _setupOutputTexture() {
    method _setupSubOutputTextures (line 13099) | _setupSubOutputTextures() {
    method _getHeaderString (line 13140) | _getHeaderString() {
    method _getTextureCoordinate (line 13144) | _getTextureCoordinate() {
    method _getMainArgumentsString (line 13154) | _getMainArgumentsString(args) {
    method getKernelString (line 13163) | getKernelString() {
    method getMainResultGraphical (line 13218) | getMainResultGraphical() {
    method getMainResultPackedPixels (line 13226) | getMainResultPackedPixels() {
    method getMainResultKernelPackedPixels (line 13239) | getMainResultKernelPackedPixels() {
    method getMainResultSubKernelPackedPixels (line 13247) | getMainResultSubKernelPackedPixels() {
    method getMainResultKernelMemoryOptimizedFloats (line 13265) | getMainResultKernelMemoryOptimizedFloats(result, channel) {
    method getMainResultSubKernelMemoryOptimizedFloats (line 13273) | getMainResultSubKernelMemoryOptimizedFloats(result, channel) {
    method getMainResultKernelNumberTexture (line 13289) | getMainResultKernelNumberTexture() {
    method getMainResultSubKernelNumberTexture (line 13297) | getMainResultSubKernelNumberTexture() {
    method getMainResultKernelArray2Texture (line 13315) | getMainResultKernelArray2Texture() {
    method getMainResultSubKernelArray2Texture (line 13324) | getMainResultSubKernelArray2Texture() {
    method getMainResultKernelArray3Texture (line 13337) | getMainResultKernelArray3Texture() {
    method getMainResultSubKernelArray3Texture (line 13347) | getMainResultSubKernelArray3Texture() {
    method getMainResultKernelArray4Texture (line 13361) | getMainResultKernelArray4Texture() {
    method getMainResultSubKernelArray4Texture (line 13369) | getMainResultSubKernelArray4Texture() {
    method destroyExtensions (line 13380) | destroyExtensions() {
    method toJSON (line 13385) | toJSON() {
  function bindTo (line 13432) | function bindTo(target) {
  class GPU (line 13465) | class GPU {
    method disableValidation (line 13466) | static disableValidation() {
    method enableValidation (line 13470) | static enableValidation() {
    method isGPUSupported (line 13474) | static get isGPUSupported() {
    method isKernelMapSupported (line 13478) | static get isKernelMapSupported() {
    method isOffscreenCanvasSupported (line 13482) | static get isOffscreenCanvasSupported() {
    method isWebGLSupported (line 13486) | static get isWebGLSupported() {
    method isWebGL2Supported (line 13490) | static get isWebGL2Supported() {
    method isHeadlessGLSupported (line 13494) | static get isHeadlessGLSupported() {
    method isCanvasSupported (line 13498) | static get isCanvasSupported() {
    method isGPUHTMLImageArraySupported (line 13502) | static get isGPUHTMLImageArraySupported() {
    method isSinglePrecisionSupported (line 13506) | static get isSinglePrecisionSupported() {
    method constructor (line 13510) | constructor(settings) {
    method chooseKernel (line 13538) | chooseKernel() {
    method createKernel (line 13593) | createKernel(source, settings) {
    method createKernelMap (line 13735) | createKernelMap() {
    method combineKernels (line 13788) | combineKernels() {
    method setFunctions (line 13811) | setFunctions(functions) {
    method setNativeFunctions (line 13816) | setNativeFunctions(nativeFunctions) {
    method addFunction (line 13821) | addFunction(source, settings) {
    method addNativeFunction (line 13826) | addNativeFunction(name, source, settings) {
    method injectNative (line 13834) | injectNative(source) {
    method destroy (line 13839) | destroy() {
  function upgradeDeprecatedCreateKernelSettings (line 13868) | function upgradeDeprecatedCreateKernelSettings(settings) {
  class Input (line 13957) | class Input {
    method constructor (line 13958) | constructor(value, size) {
    method toArray (line 13990) | toArray() {
  function input (line 14003) | function input(value, size) {
  function kernelRunShortcut (line 14014) | function kernelRunShortcut(kernel) {
  function bindKernelToShortcut (line 14056) | function bindKernelToShortcut(kernel, shortcut) {
  class Texture (line 14130) | class Texture {
    method constructor (line 14131) | constructor(settings) {
    method toArray (line 14164) | toArray() {
    method clone (line 14168) | clone() {
    method delete (line 14172) | delete() {
    method clear (line 14176) | clear() {
  method systemEndianness (line 14194) | systemEndianness() {
  method getSystemEndianness (line 14197) | getSystemEndianness() {
  method isFunction (line 14207) | isFunction(funcObj) {
  method isFunctionString (line 14211) | isFunctionString(fn) {
  method getFunctionNameFromString (line 14220) | getFunctionNameFromString(funcStr) {
  method getFunctionBodyFromString (line 14226) | getFunctionBodyFromString(funcStr) {
  method getArgumentNamesFromString (line 14230) | getArgumentNamesFromString(fn) {
  method clone (line 14239) | clone(obj) {
  method isArray (line 14255) | isArray(array) {
  method getVariableType (line 14259) | getVariableType(value, strictIntegers) {
  method getKernelTextureSize (line 14301) | getKernelTextureSize(settings, dimensions) {
  method closestSquareDimensions (line 14314) | closestSquareDimensions(length) {
  method getMemoryOptimizedFloatTextureSize (line 14325) | getMemoryOptimizedFloatTextureSize(dimensions, bitRatio) {
  method getMemoryOptimizedPackedTextureSize (line 14331) | getMemoryOptimizedPackedTextureSize(dimensions, bitRatio) {
  method roundTo (line 14338) | roundTo(n, d) {
  method getDimensions (line 14341) | getDimensions(x, pad) {
  method flatten2dArrayTo (line 14369) | flatten2dArrayTo(array, target) {
  method flatten3dArrayTo (line 14377) | flatten3dArrayTo(array, target) {
  method flatten4dArrayTo (line 14387) | flatten4dArrayTo(array, target) {
  method flattenTo (line 14399) | flattenTo(array, target) {
  method splitArray (line 14415) | splitArray(array, part) {
  method getAstString (line 14423) | getAstString(source, ast) {
  method allPropertiesOf (line 14440) | allPropertiesOf(obj) {
  method linesToString (line 14450) | linesToString(lines) {
  method warnDeprecated (line 14457) | warnDeprecated(type, oldName, newName) {
  function flatten (line 14702) | function flatten(ast) {

FILE: dist/gpu-browser.js
  function r (line 14) | function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==...
  function isInAstralSet (line 54) | function isInAstralSet(code, set) {
  function isIdentifierStart (line 66) | function isIdentifierStart(code, astral) {
  function isIdentifierChar (line 77) | function isIdentifierChar(code, astral) {
  function binop (line 108) | function binop(name, prec) {
  function kw (line 116) | function kw(name, options) {
  function isNewLine (line 211) | function isNewLine(code) {
  function nextLineBreak (line 215) | function nextLineBreak(code, from, end) {
  function wordsRegexp (line 244) | function wordsRegexp(words) {
  function codePointToString (line 248) | function codePointToString(code) {
  function getLineInfo (line 273) | function getLineInfo(input, offset) {
  function getOptions (line 308) | function getOptions(opts) {
  function pushComment (line 342) | function pushComment(options, array) {
  function functionFlags (line 370) | function functionFlags(async, generator) {
  function isPrivateNameConflicted (line 1386) | function isPrivateNameConflicted(privateNameMap, element) {
  function checkKeyName (line 1411) | function checkKeyName(node, name) {
  function isLocalVariableAccess (line 2356) | function isLocalVariableAccess(node) {
  function isPrivateFieldAccess (line 2363) | function isPrivateFieldAccess(node) {
  function finishNodeAt (line 3311) | function finishNodeAt(node, type, pos, loc) {
  function buildUnicodeData (line 3385) | function buildUnicodeData(ecmaVersion) {
  function hasProp (line 3569) | function hasProp(obj) {
  function isRegularExpressionModifier (line 3820) | function isRegularExpressionModifier(ch) {
  function isSyntaxCharacter (line 3852) | function isSyntaxCharacter(ch) {
  function isRegExpIdentifierStart (line 3955) | function isRegExpIdentifierStart(ch) {
  function isRegExpIdentifierPart (line 3976) | function isRegExpIdentifierPart(ch) {
  function isControlLetter (line 4094) | function isControlLetter(ch) {
  function isValidUnicode (line 4141) | function isValidUnicode(ch) {
  function isCharacterClassEscape (line 4216) | function isCharacterClassEscape(ch) {
  function isUnicodePropertyNameCharacter (line 4270) | function isUnicodePropertyNameCharacter(ch) {
  function isUnicodePropertyValueCharacter (line 4283) | function isUnicodePropertyValueCharacter(ch) {
  function isClassSetReservedDoublePunctuatorCharacter (line 4509) | function isClassSetReservedDoublePunctuatorCharacter(ch) {
  function isClassSetSyntaxCharacter (line 4522) | function isClassSetSyntaxCharacter(ch) {
  function isClassSetReservedPunctuator (line 4543) | function isClassSetReservedPunctuator(ch) {
  function isDecimalDigit (line 4592) | function isDecimalDigit(ch) {
  function isHexDigit (line 4606) | function isHexDigit(ch) {
  function hexToInt (line 4613) | function hexToInt(ch) {
  function isOctalDigit (line 4651) | function isOctalDigit(ch) {
  function stringToNumber (line 5099) | function stringToNumber(str, isLegacyOctalNumericLiteral) {
  function stringToBigInt (line 5107) | function stringToBigInt(str) {
  function parse (line 5429) | function parse(input, options) {
  function parseExpressionAt (line 5434) | function parseExpressionAt(input, pos, options) {
  function tokenizer (line 5439) | function tokenizer(input, options) {
  function glWiretap (line 5471) | function glWiretap(gl, options = {}) {
  function glExtensionWiretap (line 5677) | function glExtensionWiretap(extension, options) {
  function argumentsToString (line 5748) | function argumentsToString(args, options) {
  function argumentToString (line 5774) | function argumentToString(arg, options) {
  function trackablePrimitive (line 5820) | function trackablePrimitive(value) {
  function setupArguments (line 5834) | function setupArguments(args) {
  function mock1D (line 5847) | function mock1D() {
  function mock2D (line 5859) | function mock2D() {
  function mock2DGraphical (line 5875) | function mock2DGraphical() {
  function mock3D (line 5887) | function mock3D() {
  function apiDecorate (line 5907) | function apiDecorate(kernel) {
  function setupGraphical (line 6005) | function setupGraphical(kernel) {
  function setupOutput (line 6018) | function setupOutput(output) {
  function gpuMock (line 6037) | function gpuMock(fn, settings = {}) {
  function flipPixels (line 6067) | function flipPixels(pixels, width, height) {
  function alias (line 6092) | function alias(name, source) {
  class CPUFunctionNode (line 6105) | class CPUFunctionNode extends FunctionNode {
    method astFunction (line 6106) | astFunction(ast, retArr) {
    method astReturnStatement (line 6138) | astReturnStatement(ast, retArr) {
    method astLiteral (line 6164) | astLiteral(ast, retArr) {
    method astBinaryExpression (line 6178) | astBinaryExpression(ast, retArr) {
    method astIdentifierExpression (line 6187) | astIdentifierExpression(idtNode, retArr) {
    method astForStatement (line 6210) | astForStatement(forNode, retArr) {
    method astWhileStatement (line 6276) | astWhileStatement(whileNode, retArr) {
    method astDoWhileStatement (line 6297) | astDoWhileStatement(doWhileNode, retArr) {
    method astAssignmentExpression (line 6318) | astAssignmentExpression(assNode, retArr) {
    method astBlockStatement (line 6329) | astBlockStatement(bNode, retArr) {
    method astVariableDeclaration (line 6346) | astVariableDeclaration(varDecNode, retArr) {
    method astIfStatement (line 6366) | astIfStatement(ifNode, retArr) {
    method astSwitchStatement (line 6392) | astSwitchStatement(ast, retArr) {
    method astThisExpression (line 6417) | astThisExpression(tNode, retArr) {
    method astMemberExpression (line 6422) | astMemberExpression(mNode, retArr) {
    method astCallExpression (line 6583) | astCallExpression(ast, retArr) {
    method astArrayExpression (line 6621) | astArrayExpression(arrNode, retArr) {
    method astDebuggerStatement (line 6642) | astDebuggerStatement(arrNode, retArr) {
  function constantsToString (line 6654) | function constantsToString(constants, types) {
  function cpuKernelString (line 6680) | function cpuKernelString(cpuKernel, name) {
  class CPUKernel (line 6844) | class CPUKernel extends Kernel {
    method getFeatures (line 6845) | static getFeatures() {
    method features (line 6848) | static get features() {
    method isSupported (line 6854) | static get isSupported() {
    method isContextMatch (line 6857) | static isContextMatch(context) {
    method mode (line 6860) | static get mode() {
    method nativeFunctionArguments (line 6864) | static nativeFunctionArguments() {
    method nativeFunctionReturnType (line 6868) | static nativeFunctionReturnType() {
    method combineKernels (line 6872) | static combineKernels(combinedKernel) {
    method getSignature (line 6876) | static getSignature(kernel, argumentTypes) {
    method constructor (line 6880) | constructor(source, settings) {
    method initCanvas (line 6896) | initCanvas() {
    method initContext (line 6904) | initContext() {
    method initPlugins (line 6909) | initPlugins(settings) {
    method validateSettings (line 6913) | validateSettings(args) {
    method translateSource (line 6938) | translateSource() {
    method build (line 6957) | build() {
    method color (line 6997) | color(r, g, b, a) {
    method getKernelString (line 7021) | getKernelString() {
    method toString (line 7051) | toString() {
    method _getLoopMaxString (line 7055) | _getLoopMaxString() {
    method _processConstants (line 7063) | _processConstants() {
    method _earlyThrows (line 7091) | _earlyThrows() {
    method _processArguments (line 7111) | _processArguments() {
    method _mediaTo2DArray (line 7157) | _mediaTo2DArray(media) {
    method getPixels (line 7191) | getPixels(flip) {
    method _imageTo3DArray (line 7196) | _imageTo3DArray(images) {
    method _resultKernelHeader (line 7204) | _resultKernelHeader() {
    method _resultKernelBody (line 7218) | _resultKernelBody(kernelString) {
    method _graphicalKernelBody (line 7231) | _graphicalKernelBody(kernelThreadString) {
    method _graphicalOutput (line 7240) | _graphicalOutput() {
    method _getKernelResultTypeConstructorString (line 7247) | _getKernelResultTypeConstructorString() {
    method _resultImmutableKernel1DLoop (line 7266) | _resultImmutableKernel1DLoop(kernelString) {
    method _mutableKernel1DResults (line 7280) | _mutableKernel1DResults() {
    method _resultMutableKernel1DLoop (line 7288) | _resultMutableKernel1DLoop(kernelString) {
    method _resultImmutableKernel2DLoop (line 7298) | _resultImmutableKernel2DLoop(kernelString) {
    method _mutableKernel2DResults (line 7317) | _mutableKernel2DResults() {
    method _resultMutableKernel2DLoop (line 7330) | _resultMutableKernel2DLoop(kernelString) {
    method _graphicalKernel2DLoop (line 7346) | _graphicalKernel2DLoop(kernelString) {
    method _resultImmutableKernel3DLoop (line 7359) | _resultImmutableKernel3DLoop(kernelString) {
    method _mutableKernel3DResults (line 7383) | _mutableKernel3DResults() {
    method _resultMutableKernel3DLoop (line 7401) | _resultMutableKernel3DLoop(kernelString) {
    method _kernelOutput (line 7419) | _kernelOutput() {
    method _mapSubKernels (line 7429) | _mapSubKernels(fn) {
    method destroy (line 7434) | destroy(removeCanvasReference) {
    method destroyContext (line 7440) | static destroyContext(context) {}
    method toJSON (line 7442) | toJSON() {
    method setOutput (line 7448) | setOutput(output) {
    method prependString (line 7457) | prependString(value) {
    method hasPrependString (line 7462) | hasPrependString(value) {
  class FunctionBuilder (line 7471) | class FunctionBuilder {
    method fromKernel (line 7472) | static fromKernel(kernel, FunctionNode, extraNodeOptions) {
    method constructor (line 7659) | constructor(settings) {
    method addFunctionNode (line 7696) | addFunctionNode(functionNode) {
    method traceFunctionCalls (line 7704) | traceFunctionCalls(functionName, retList) {
    method getPrototypeString (line 7737) | getPrototypeString(functionName) {
    method getPrototypes (line 7741) | getPrototypes(functionName) {
    method getStringFromFunctionNames (line 7751) | getStringFromFunctionNames(functionList) {
    method getPrototypesFromFunctionNames (line 7762) | getPrototypesFromFunctionNames(functionList) {
    method toJSON (line 7779) | toJSON() {
    method fromJSON (line 7795) | fromJSON(jsonFunctionNodes, FunctionNode) {
    method getString (line 7804) | getString(functionName) {
    method lookupReturnType (line 7811) | lookupReturnType(functionName, ast, requestingNode) {
    method _getFunction (line 7855) | _getFunction(functionName) {
    method _isFunction (line 7862) | _isFunction(functionName) {
    method _getNativeFunction (line 7866) | _getNativeFunction(functionName) {
    method _isNativeFunction (line 7873) | _isNativeFunction(functionName) {
    method _lookupNativeFunctionReturnType (line 7877) | _lookupNativeFunctionReturnType(functionName) {
    method lookupFunctionArgumentTypes (line 7885) | lookupFunctionArgumentTypes(functionName) {
    method lookupFunctionArgumentName (line 7894) | lookupFunctionArgumentName(functionName, argumentIndex) {
    method lookupFunctionArgumentBitRatio (line 7898) | lookupFunctionArgumentBitRatio(functionName, argumentName) {
    method needsArgumentType (line 7920) | needsArgumentType(functionName, i) {
    method assignArgumentType (line 7926) | assignArgumentType(functionName, i, argumentType, requestingNode) {
    method assignArgumentBitRatio (line 7934) | assignArgumentBitRatio(functionName, argumentName, calleeFunctionName,...
    method trackFunctionCall (line 7960) | trackFunctionCall(functionName, calleeFunctionName, args) {
    method getKernelResultType (line 7969) | getKernelResultType() {
    method getSubKernelResultType (line 7973) | getSubKernelResultType(index) {
    method getReturnTypes (line 7988) | getReturnTypes() {
  class FunctionNode (line 8010) | class FunctionNode {
    method constructor (line 8011) | constructor(source, settings) {
    method validate (line 8074) | validate() {
    method isIdentifierConstant (line 8096) | isIdentifierConstant(name) {
    method isInput (line 8101) | isInput(argumentName) {
    method pushState (line 8105) | pushState(state) {
    method popState (line 8109) | popState(state) {
    method isState (line 8116) | isState(state) {
    method state (line 8120) | get state() {
    method astMemberExpressionUnroll (line 8124) | astMemberExpressionUnroll(ast) {
    method getJsAST (line 8155) | getJsAST(inParser) {
    method traceFunctionAST (line 8182) | traceFunctionAST(ast) {
    method getDeclaration (line 8228) | getDeclaration(ast) {
    method getVariableType (line 8238) | getVariableType(ast) {
    method getLookupType (line 8261) | getLookupType(type) {
    method getConstantType (line 8268) | getConstantType(constantName) {
    method toString (line 8280) | toString() {
    method toJSON (line 8285) | toJSON() {
    method getType (line 8310) | getType(ast) {
    method getCheckVariableType (line 8526) | getCheckVariableType(ast) {
    method inferArgumentTypesIfNeeded (line 8534) | inferArgumentTypesIfNeeded(functionName, args) {
    method isAstMathVariable (line 8545) | isAstMathVariable(ast) {
    method isAstMathFunction (line 8564) | isAstMathFunction(ast) {
    method isAstVariable (line 8612) | isAstVariable(ast) {
    method isSafe (line 8616) | isSafe(ast) {
    method isSafeDependencies (line 8620) | isSafeDependencies(dependencies) {
    method getDependencies (line 8624) | getDependencies(ast, dependencies, isNotSafe) {
    method getVariableSignature (line 8744) | getVariableSignature(ast, returnRawValue) {
    method build (line 8817) | build() {
    method astGeneric (line 8821) | astGeneric(ast, retArr) {
    method astErrorOutput (line 8896) | astErrorOutput(error, ast) {
    method astDebuggerStatement (line 8908) | astDebuggerStatement(arrNode, retArr) {
    method astConditionalExpression (line 8912) | astConditionalExpression(ast, retArr) {
    method astFunction (line 8926) | astFunction(ast, retArr) {
    method astFunctionDeclaration (line 8930) | astFunctionDeclaration(ast, retArr) {
    method astFunctionExpression (line 8936) | astFunctionExpression(ast, retArr) {
    method isChildFunction (line 8942) | isChildFunction(ast) {
    method astReturnStatement (line 8950) | astReturnStatement(ast, retArr) {
    method astLiteral (line 8953) | astLiteral(ast, retArr) {
    method astBinaryExpression (line 8957) | astBinaryExpression(ast, retArr) {
    method astIdentifierExpression (line 8960) | astIdentifierExpression(ast, retArr) {
    method astAssignmentExpression (line 8963) | astAssignmentExpression(ast, retArr) {
    method astExpressionStatement (line 8966) | astExpressionStatement(esNode, retArr) {
    method astEmptyStatement (line 8971) | astEmptyStatement(eNode, retArr) {
    method astBlockStatement (line 8974) | astBlockStatement(ast, retArr) {
    method astIfStatement (line 8977) | astIfStatement(ast, retArr) {
    method astSwitchStatement (line 8980) | astSwitchStatement(ast, retArr) {
    method astBreakStatement (line 8983) | astBreakStatement(brNode, retArr) {
    method astContinueStatement (line 8987) | astContinueStatement(crNode, retArr) {
    method astForStatement (line 8991) | astForStatement(ast, retArr) {
    method astWhileStatement (line 8994) | astWhileStatement(ast, retArr) {
    method astDoWhileStatement (line 8997) | astDoWhileStatement(ast, retArr) {
    method astVariableDeclarator (line 9000) | astVariableDeclarator(iVarDecNode, retArr) {
    method astThisExpression (line 9008) | astThisExpression(ast, retArr) {
    method astSequenceExpression (line 9011) | astSequenceExpression(sNode, retArr) {
    method astUnaryExpression (line 9027) | astUnaryExpression(uNode, retArr) {
    method checkAndUpconvertBitwiseUnary (line 9044) | checkAndUpconvertBitwiseUnary(uNode, retArr) {}
    method astUpdateExpression (line 9046) | astUpdateExpression(uNode, retArr) {
    method astLogicalExpression (line 9057) | astLogicalExpression(logNode, retArr) {
    method astMemberExpression (line 9065) | astMemberExpression(ast, retArr) {
    method astCallExpression (line 9068) | astCallExpression(ast, retArr) {
    method astArrayExpression (line 9071) | astArrayExpression(ast, retArr) {
    method getMemberExpressionDetails (line 9075) | getMemberExpressionDetails(ast) {
    method findIdentifierOrigin (line 9255) | findIdentifierOrigin(astToFind) {
    method findLastReturn (line 9279) | findLastReturn(ast) {
    method getInternalVariableName (line 9309) | getInternalVariableName(name) {
    method astKey (line 9320) | astKey(ast, separator = ',') {
  function last (line 9370) | function last(array) {
  class FunctionTracer (line 9380) | class FunctionTracer {
    method constructor (line 9381) | constructor(ast) {
    method isState (line 9396) | isState(state) {
    method hasState (line 9400) | hasState(state) {
    method pushState (line 9404) | pushState(state) {
    method popState (line 9408) | popState(state) {
    method currentFunctionContext (line 9416) | get currentFunctionContext() {
    method currentContext (line 9420) | get currentContext() {
    method newFunctionContext (line 9424) | newFunctionContext() {
    method newContext (line 9430) | newContext(run) {
    method useFunctionContext (line 9444) | useFunctionContext(run) {
    method getIdentifiers (line 9451) | getIdentifiers(run) {
    method getDeclaration (line 9460) | getDeclaration(name) {
    method scan (line 9478) | scan(ast) {
  function toStringWithoutUtils (line 9671) | function toStringWithoutUtils(fn) {
  function glKernelString (line 9678) | function glKernelString(Kernel, args, originKernel, setupContextString, ...
  function getRenderString (line 9905) | function getRenderString(targetName, kernel) {
  function getGetPixelsString (line 9917) | function getGetPixelsString(kernel) {
  function getToArrayString (line 9939) | function getToArrayString(kernelResult, textureName, framebufferName) {
  function findKernelValue (line 9976) | function findKernelValue(argument, kernelValues, values, context, upload...
  class GLKernel (line 10036) | class GLKernel extends Kernel {
    method mode (line 10037) | static get mode() {
    method getIsFloatRead (line 10041) | static getIsFloatRead() {
    method getIsIntegerDivisionAccurate (line 10061) | static getIsIntegerDivisionAccurate() {
    method getIsSpeedTacticSupported (line 10085) | static getIsSpeedTacticSupported() {
    method testCanvas (line 10108) | static get testCanvas() {
    method testContext (line 10112) | static get testContext() {
    method getFeatures (line 10116) | static getFeatures() {
    method setupFeatureChecks (line 10137) | static setupFeatureChecks() {
    method getSignature (line 10141) | static getSignature(kernel, argumentTypes) {
    method setFixIntegerDivisionAccuracy (line 10145) | setFixIntegerDivisionAccuracy(fix) {
    method setPrecision (line 10150) | setPrecision(flag) {
    method setFloatTextures (line 10155) | setFloatTextures(flag) {
    method nativeFunctionArguments (line 10161) | static nativeFunctionArguments(source) {
    method nativeFunctionReturnType (line 10266) | static nativeFunctionReturnType(source) {
    method combineKernels (line 10270) | static combineKernels(combinedKernel, lastKernel) {
    method constructor (line 10303) | constructor(source, settings) {
    method checkTextureSize (line 10319) | checkTextureSize() {
    method translateSource (line 10326) | translateSource() {
    method pickRenderStrategy (line 10330) | pickRenderStrategy(args) {
    method getKernelString (line 10613) | getKernelString() {
    method getMainResultTexture (line 10617) | getMainResultTexture() {
    method getMainResultKernelNumberTexture (line 10635) | getMainResultKernelNumberTexture() {
    method getMainResultSubKernelNumberTexture (line 10638) | getMainResultSubKernelNumberTexture() {
    method getMainResultKernelArray2Texture (line 10641) | getMainResultKernelArray2Texture() {
    method getMainResultSubKernelArray2Texture (line 10644) | getMainResultSubKernelArray2Texture() {
    method getMainResultKernelArray3Texture (line 10647) | getMainResultKernelArray3Texture() {
    method getMainResultSubKernelArray3Texture (line 10650) | getMainResultSubKernelArray3Texture() {
    method getMainResultKernelArray4Texture (line 10653) | getMainResultKernelArray4Texture() {
    method getMainResultSubKernelArray4Texture (line 10656) | getMainResultSubKernelArray4Texture() {
    method getMainResultGraphical (line 10659) | getMainResultGraphical() {
    method getMainResultMemoryOptimizedFloats (line 10662) | getMainResultMemoryOptimizedFloats() {
    method getMainResultPackedPixels (line 10665) | getMainResultPackedPixels() {
    method getMainResultString (line 10669) | getMainResultString() {
    method getMainResultNumberTexture (line 10682) | getMainResultNumberTexture() {
    method getMainResultArray2Texture (line 10687) | getMainResultArray2Texture() {
    method getMainResultArray3Texture (line 10692) | getMainResultArray3Texture() {
    method getMainResultArray4Texture (line 10697) | getMainResultArray4Texture() {
    method getFloatTacticDeclaration (line 10702) | getFloatTacticDeclaration() {
    method getIntTacticDeclaration (line 10707) | getIntTacticDeclaration() {
    method getSampler2DTacticDeclaration (line 10711) | getSampler2DTacticDeclaration() {
    method getSampler2DArrayTacticDeclaration (line 10715) | getSampler2DArrayTacticDeclaration() {
    method renderTexture (line 10719) | renderTexture() {
    method readPackedPixelsToUint8Array (line 10722) | readPackedPixelsToUint8Array() {
    method readPackedPixelsToFloat32Array (line 10733) | readPackedPixelsToFloat32Array() {
    method readFloatPixelsToFloat32Array (line 10737) | readFloatPixelsToFloat32Array() {
    method getPixels (line 10750) | getPixels(flip) {
    method renderKernelsToArrays (line 10761) | renderKernelsToArrays() {
    method renderKernelsToTextures (line 10771) | renderKernelsToTextures() {
    method resetSwitchingKernels (line 10787) | resetSwitchingKernels() {
    method setOutput (line 10793) | setOutput(output) {
    method renderValues (line 10848) | renderValues() {
    method switchKernels (line 10856) | switchKernels(reason) {
    method getVariablePrecisionString (line 10863) | getVariablePrecisionString(textureSize = this.texSize, tactic = this.t...
    method updateTextureArgumentRefs (line 10892) | updateTextureArgumentRefs(kernelValue, arg) {
    method onActivate (line 10926) | onActivate(previousKernel) {
    method initCanvas (line 10937) | initCanvas() {}
  class GLTextureArray2Float2D (line 10955) | class GLTextureArray2Float2D extends GLTextureFloat {
    method constructor (line 10956) | constructor(settings) {
    method toArray (line 10960) | toArray() {
  class GLTextureArray2Float3D (line 10972) | class GLTextureArray2Float3D extends GLTextureFloat {
    method constructor (line 10973) | constructor(settings) {
    method toArray (line 10977) | toArray() {
  class GLTextureArray2Float (line 10989) | class GLTextureArray2Float extends GLTextureFloat {
    method constructor (line 10990) | constructor(settings) {
    method toArray (line 10994) | toArray() {
  class GLTextureArray3Float2D (line 11006) | class GLTextureArray3Float2D extends GLTextureFloat {
    method constructor (line 11007) | constructor(settings) {
    method toArray (line 11011) | toArray() {
  class GLTextureArray3Float3D (line 11023) | class GLTextureArray3Float3D extends GLTextureFloat {
    method constructor (line 11024) | constructor(settings) {
    method toArray (line 11028) | toArray() {
  class GLTextureArray3Float (line 11040) | class GLTextureArray3Float extends GLTextureFloat {
    method constructor (line 11041) | constructor(settings) {
    method toArray (line 11045) | toArray() {
  class GLTextureArray4Float2D (line 11057) | class GLTextureArray4Float2D extends GLTextureFloat {
    method constructor (line 11058) | constructor(settings) {
    method toArray (line 11062) | toArray() {
  class GLTextureArray4Float3D (line 11074) | class GLTextureArray4Float3D extends GLTextureFloat {
    method constructor (line 11075) | constructor(settings) {
    method toArray (line 11079) | toArray() {
  class GLTextureArray4Float (line 11091) | class GLTextureArray4Float extends GLTextureFloat {
    method constructor (line 11092) | constructor(settings) {
    method toArray (line 11096) | toArray() {
  class GLTextureFloat2D (line 11108) | class GLTextureFloat2D extends GLTextureFloat {
    method constructor (line 11109) | constructor(settings) {
    method toArray (line 11113) | toArray() {
  class GLTextureFloat3D (line 11125) | class GLTextureFloat3D extends GLTextureFloat {
    method constructor (line 11126) | constructor(settings) {
    method toArray (line 11130) | toArray() {
  class GLTextureFloat (line 11142) | class GLTextureFloat extends GLTexture {
    method textureType (line 11143) | get textureType() {
    method constructor (line 11146) | constructor(settings) {
    method renderRawOutput (line 11150) | renderRawOutput() {
    method renderValues (line 11165) | renderValues() {
    method toArray (line 11169) | toArray() {
  class GLTextureGraphical (line 11180) | class GLTextureGraphical extends GLTextureUnsigned {
    method constructor (line 11181) | constructor(settings) {
    method toArray (line 11185) | toArray() {
  class GLTexture (line 11196) | class GLTexture extends Texture {
    method textureType (line 11197) | get textureType() {
    method clone (line 11201) | clone() {
    method beforeMutate (line 11205) | beforeMutate() {
    method cloneTexture (line 11213) | cloneTexture() {
    method newTexture (line 11230) | newTexture() {
    method clear (line 11245) | clear() {
    method delete (line 11264) | delete() {
    method framebuffer (line 11274) | framebuffer() {
  function selectTexture (line 11282) | function selectTexture(gl, texture) {
  class GLTextureMemoryOptimized2D (line 11296) | class GLTextureMemoryOptimized2D extends GLTextureFloat {
    method constructor (line 11297) | constructor(settings) {
    method toArray (line 11301) | toArray() {
  class GLTextureMemoryOptimized3D (line 11313) | class GLTextureMemoryOptimized3D extends GLTextureFloat {
    method constructor (line 11314) | constructor(settings) {
    method toArray (line 11318) | toArray() {
  class GLTextureMemoryOptimized (line 11330) | class GLTextureMemoryOptimized extends GLTextureFloat {
    method constructor (line 11331) | constructor(settings) {
    method toArray (line 11335) | toArray() {
  class GLTextureUnsigned2D (line 11347) | class GLTextureUnsigned2D extends GLTextureUnsigned {
    method constructor (line 11348) | constructor(settings) {
    method toArray (line 11352) | toArray() {
  class GLTextureUnsigned3D (line 11364) | class GLTextureUnsigned3D extends GLTextureUnsigned {
    method constructor (line 11365) | constructor(settings) {
    method toArray (line 11369) | toArray() {
  class GLTextureUnsigned (line 11381) | class GLTextureUnsigned extends GLTexture {
    method textureType (line 11382) | get textureType() {
    method constructor (line 11385) | constructor(settings) {
    method renderRawOutput (line 11389) | renderRawOutput() {
    method renderValues (line 11403) | renderValues() {
    method toArray (line 11407) | toArray() {
  class HeadlessGLKernel (line 11426) | class HeadlessGLKernel extends WebGLKernel {
    method isSupported (line 11427) | static get isSupported() {
    method setupFeatureChecks (line 11434) | static setupFeatureChecks() {
    method isContextMatch (line 11458) | static isContextMatch(context) {
    method getIsTextureFloat (line 11466) | static getIsTextureFloat() {
    method getIsDrawBuffers (line 11470) | static getIsDrawBuffers() {
    method getChannelCount (line 11474) | static getChannelCount() {
    method getMaxTextureSize (line 11480) | static getMaxTextureSize() {
    method testCanvas (line 11484) | static get testCanvas() {
    method testContext (line 11488) | static get testContext() {
    method features (line 11492) | static get features() {
    method initCanvas (line 11496) | initCanvas() {
    method initContext (line 11500) | initContext() {
    method initExtensions (line 11506) | initExtensions() {
    method build (line 11517) | build() {
    method destroyExtensions (line 11524) | destroyExtensions() {
    method destroyContext (line 11533) | static destroyContext(context) {
    method toString (line 11540) | toString() {
    method setOutput (line 11546) | setOutput(output) {
  class KernelValue (line 11559) | class KernelValue {
    method constructor (line 11560) | constructor(value, settings) {
    method id (line 11605) | get id() {
    method getSource (line 11609) | getSource() {
    method updateValue (line 11613) | updateValue(value) {
  class Kernel (line 11625) | class Kernel {
    method isSupported (line 11626) | static get isSupported() {
    method isContextMatch (line 11630) | static isContextMatch(context) {
    method getFeatures (line 11634) | static getFeatures() {
    method destroyContext (line 11638) | static destroyContext(context) {
    method nativeFunctionArguments (line 11642) | static nativeFunctionArguments() {
    method nativeFunctionReturnType (line 11646) | static nativeFunctionReturnType() {
    method combineKernels (line 11650) | static combineKernels() {
    method constructor (line 11654) | constructor(source, settings) {
    method mergeSettings (line 11734) | mergeSettings(settings) {
    method build (line 11773) | build() {
    method run (line 11777) | run() {
    method initCanvas (line 11781) | initCanvas() {
    method initContext (line 11785) | initContext() {
    method initPlugins (line 11789) | initPlugins(settings) {
    method addFunction (line 11793) | addFunction(source, settings = {}) {
    method addNativeFunction (line 11806) | addNativeFunction(name, source, settings = {}) {
    method setupArguments (line 11821) | setupArguments(args) {
    method setupConstants (line 11857) | setupConstants() {
    method setOptimizeFloatMemory (line 11884) | setOptimizeFloatMemory(flag) {
    method toKernelOutput (line 11889) | toKernelOutput(output) {
    method setOutput (line 11905) | setOutput(output) {
    method setDebug (line 11910) | setDebug(flag) {
    method setGraphical (line 11915) | setGraphical(flag) {
    method setLoopMaxIterations (line 11921) | setLoopMaxIterations(max) {
    method setConstants (line 11926) | setConstants(constants) {
    method setConstantTypes (line 11931) | setConstantTypes(constantTypes) {
    method setFunctions (line 11936) | setFunctions(functions) {
    method setNativeFunctions (line 11943) | setNativeFunctions(nativeFunctions) {
    method setInjectedNative (line 11952) | setInjectedNative(injectedNative) {
    method setPipeline (line 11957) | setPipeline(flag) {
    method setPrecision (line 11962) | setPrecision(flag) {
    method setDimensions (line 11967) | setDimensions(flag) {
    method setOutputToTexture (line 11973) | setOutputToTexture(flag) {
    method setImmutable (line 11979) | setImmutable(flag) {
    method setCanvas (line 11984) | setCanvas(canvas) {
    method setStrictIntegers (line 11989) | setStrictIntegers(flag) {
    method setDynamicOutput (line 11994) | setDynamicOutput(flag) {
    method setHardcodeConstants (line 11999) | setHardcodeConstants(flag) {
    method setDynamicArguments (line 12006) | setDynamicArguments(flag) {
    method setUseLegacyEncoder (line 12011) | setUseLegacyEncoder(flag) {
    method setWarnVarUsage (line 12016) | setWarnVarUsage(flag) {
    method getCanvas (line 12021) | getCanvas() {
    method getWebGl (line 12026) | getWebGl() {
    method setContext (line 12031) | setContext(context) {
    method setArgumentTypes (line 12036) | setArgumentTypes(argumentTypes) {
    method setTactic (line 12051) | setTactic(tactic) {
    method requestFallback (line 12056) | requestFallback(args) {
    method validateSettings (line 12064) | validateSettings() {
    method addSubKernel (line 12068) | addSubKernel(subKernel) {
    method destroy (line 12079) | destroy(removeCanvasReferences) {
    method getBitRatio (line 12083) | getBitRatio(value) {
    method getPixels (line 12106) | getPixels(flip) {
    method checkOutput (line 12110) | checkOutput() {
    method prependString (line 12120) | prependString(value) {
    method hasPrependString (line 12124) | hasPrependString(value) {
    method toJSON (line 12128) | toJSON() {
    method buildSignature (line 12142) | buildSignature(args) {
    method getArgumentTypes (line 12147) | static getArgumentTypes(kernel, args) {
    method getSignature (line 12170) | static getSignature(kernel, argumentTypes) {
    method functionToIGPUFunction (line 12174) | functionToIGPUFunction(source, settings = {}) {
    method onActivate (line 12196) | onActivate(previousKernel) {}
  function splitArgumentTypes (line 12199) | function splitArgumentTypes(argumentTypesObject) {
  class WebGLFunctionNode (line 12712) | class WebGLFunctionNode extends FunctionNode {
    method constructor (line 12713) | constructor(source, settings) {
    method astConditionalExpression (line 12720) | astConditionalExpression(ast, retArr) {
    method astFunction (line 12748) | astFunction(ast, retArr) {
    method astReturnStatement (line 12815) | astReturnStatement(ast, retArr) {
    method astLiteral (line 12891) | astLiteral(ast, retArr) {
    method astBinaryExpression (line 12921) | astBinaryExpression(ast, retArr) {
    method checkAndUpconvertOperator (line 13102) | checkAndUpconvertOperator(ast, retArr) {
    method checkAndUpconvertBitwiseOperators (line 13140) | checkAndUpconvertBitwiseOperators(ast, retArr) {
    method checkAndUpconvertBitwiseUnary (line 13182) | checkAndUpconvertBitwiseUnary(ast, retArr) {
    method castLiteralToInteger (line 13205) | castLiteralToInteger(ast, retArr) {
    method castLiteralToFloat (line 13212) | castLiteralToFloat(ast, retArr) {
    method castValueToInteger (line 13219) | castValueToInteger(ast, retArr) {
    method castValueToFloat (line 13228) | castValueToFloat(ast, retArr) {
    method astIdentifierExpression (line 13237) | astIdentifierExpression(idtNode, retArr) {
    method astForStatement (line 13260) | astForStatement(forNode, retArr) {
    method astWhileStatement (line 13330) | astWhileStatement(whileNode, retArr) {
    method astDoWhileStatement (line 13346) | astDoWhileStatement(doWhileNode, retArr) {
    method astAssignmentExpression (line 13363) | astAssignmentExpression(assNode, retArr) {
    method astBlockStatement (line 13396) | astBlockStatement(bNode, retArr) {
    method astVariableDeclaration (line 13413) | astVariableDeclaration(varDecNode, retArr) {
    method astIfStatement (line 13491) | astIfStatement(ifNode, retArr) {
    method astSwitchStatement (line 13516) | astSwitchStatement(ast, retArr) {
    method astThisExpression (line 13608) | astThisExpression(tNode, retArr) {
    method astMemberExpression (line 13613) | astMemberExpression(mNode, retArr) {
    method astCallExpression (line 13883) | astCallExpression(ast, retArr) {
    method astArrayExpression (line 14051) | astArrayExpression(arrNode, retArr) {
    method memberExpressionXYZ (line 14077) | memberExpressionXYZ(x, y, z, retArr) {
    method memberExpressionPropertyMarkup (line 14092) | memberExpressionPropertyMarkup(property) {
  function lookupKernelValueType (line 14329) | function lookupKernelValueType(type, dynamic, precision, value) {
  class WebGLKernelArray (line 14359) | class WebGLKernelArray extends WebGLKernelValue {
    method checkSize (line 14360) | checkSize(width, height) {
    method setup (line 14374) | setup() {
    method requestTexture (line 14380) | requestTexture() {
    method defineTexture (line 14384) | defineTexture() {
    method setupTexture (line 14394) | setupTexture() {
    method getBitRatio (line 14401) | getBitRatio(value) {
    method destroy (line 14422) | destroy() {
  class WebGLKernelValueArray2 (line 14436) | class WebGLKernelValueArray2 extends WebGLKernelValue {
    method constructor (line 14437) | constructor(value, settings) {
    method getSource (line 14441) | getSource(value) {
    method getStringValueHandler (line 14448) | getStringValueHandler() {
    method updateValue (line 14453) | updateValue(value) {
  class WebGLKernelValueArray3 (line 14465) | class WebGLKernelValueArray3 extends WebGLKernelValue {
    method constructor (line 14466) | constructor(value, settings) {
    method getSource (line 14470) | getSource(value) {
    method getStringValueHandler (line 14477) | getStringValueHandler() {
    method updateValue (line 14482) | updateValue(value) {
  class WebGLKernelValueArray4 (line 14494) | class WebGLKernelValueArray4 extends WebGLKernelValue {
    method constructor (line 14495) | constructor(value, settings) {
    method getSource (line 14499) | getSource(value) {
    method getStringValueHandler (line 14506) | getStringValueHandler() {
    method updateValue (line 14511) | updateValue(value) {
  class WebGLKernelValueBoolean (line 14524) | class WebGLKernelValueBoolean extends WebGLKernelValue {
    method constructor (line 14525) | constructor(value, settings) {
    method getSource (line 14529) | getSource(value) {
    method getStringValueHandler (line 14536) | getStringValueHandler() {
    method updateValue (line 14540) | updateValue(value) {
  class WebGLKernelValueDynamicHTMLImage (line 14553) | class WebGLKernelValueDynamicHTMLImage extends WebGLKernelValueHTMLImage {
    method getSource (line 14554) | getSource() {
    method updateValue (line 14562) | updateValue(value) {
  class WebGLKernelValueDynamicHTMLVideo (line 14579) | class WebGLKernelValueDynamicHTMLVideo extends WebGLKernelValueDynamicHT...
  class WebGLKernelValueDynamicMemoryOptimizedNumberTexture (line 14588) | class WebGLKernelValueDynamicMemoryOptimizedNumberTexture extends WebGLK...
    method getSource (line 14589) | getSource() {
    method updateValue (line 14597) | updateValue(inputTexture) {
  class WebGLKernelValueDynamicNumberTexture (line 14614) | class WebGLKernelValueDynamicNumberTexture extends WebGLKernelValueNumbe...
    method getSource (line 14615) | getSource() {
    method updateValue (line 14623) | updateValue(value) {
  class WebGLKernelValueDynamicSingleArray (line 14640) | class WebGLKernelValueDynamicSingleArray extends WebGLKernelValueSingleA...
    method getSource (line 14641) | getSource() {
    method updateValue (line 14649) | updateValue(value) {
  class WebGLKernelValueDynamicSingleArray1DI (line 14668) | class WebGLKernelValueDynamicSingleArray1DI extends WebGLKernelValueSing...
    method getSource (line 14669) | getSource() {
    method updateValue (line 14677) | updateValue(value) {
  class WebGLKernelValueDynamicSingleArray2DI (line 14692) | class WebGLKernelValueDynamicSingleArray2DI extends WebGLKernelValueSing...
    method getSource (line 14693) | getSource() {
    method updateValue (line 14701) | updateValue(value) {
  class WebGLKernelValueDynamicSingleArray3DI (line 14716) | class WebGLKernelValueDynamicSingleArray3DI extends WebGLKernelValueSing...
    method getSource (line 14717) | getSource() {
    method updateValue (line 14725) | updateValue(value) {
  class WebGLKernelValueDynamicSingleInput (line 14740) | class WebGLKernelValueDynamicSingleInput extends WebGLKernelValueSingleI...
    method getSource (line 14741) | getSource() {
    method updateValue (line 14749) | updateValue(value) {
  class WebGLKernelValueDynamicUnsignedArray (line 14769) | class WebGLKernelValueDynamicUnsignedArray extends WebGLKernelValueUnsig...
    method getSource (line 14770) | getSource() {
    method updateValue (line 14778) | updateValue(value) {
  class WebGLKernelValueDynamicUnsignedInput (line 14799) | class WebGLKernelValueDynamicUnsignedInput extends WebGLKernelValueUnsig...
    method getSource (line 14800) | getSource() {
    method updateValue (line 14808) | updateValue(value) {
  class WebGLKernelValueFloat (line 14830) | class WebGLKernelValueFloat extends WebGLKernelValue {
    method constructor (line 14831) | constructor(value, settings) {
    method getStringValueHandler (line 14835) | getStringValueHandler() {
    method getSource (line 14838) | getSource(value) {
    method updateValue (line 14848) | updateValue(value) {
  class WebGLKernelValueHTMLImage (line 14861) | class WebGLKernelValueHTMLImage extends WebGLKernelArray {
    method constructor (line 14862) | constructor(value, settings) {
    method getStringValueHandler (line 14871) | getStringValueHandler() {
    method getSource (line 14875) | getSource() {
    method updateValue (line 14883) | updateValue(inputImage) {
  class WebGLKernelValueHTMLVideo (line 14903) | class WebGLKernelValueHTMLVideo extends WebGLKernelValueHTMLImage {}
  class WebGLKernelValue (line 14912) | class WebGLKernelValue extends KernelValue {
    method constructor (line 14913) | constructor(value, settings) {
    method id (line 14926) | get id() {
    method setup (line 14930) | setup() {}
    method getTransferArrayType (line 14932) | getTransferArrayType(value) {
    method getStringValueHandler (line 14954) | getStringValueHandler() {
    method getVariablePrecisionString (line 14958) | getVariablePrecisionString() {
    method destroy (line 14962) | destroy() {}
  class WebGLKernelValueInteger (line 14972) | class WebGLKernelValueInteger extends WebGLKernelValue {
    method constructor (line 14973) | constructor(value, settings) {
    method getStringValueHandler (line 14977) | getStringValueHandler() {
    method getSource (line 14980) | getSource(value) {
    method updateValue (line 14987) | updateValue(value) {
  class WebGLKernelValueMemoryOptimizedNumberTexture (line 15002) | class WebGLKernelValueMemoryOptimizedNumberTexture extends WebGLKernelAr...
    method constructor (line 15003) | constructor(value, settings) {
    method setup (line 15013) | setup() {
    method getStringValueHandler (line 15017) | getStringValueHandler() {
    method getSource (line 15021) | getSource() {
    method updateValue (line 15029) | updateValue(inputTexture) {
  class WebGLKernelValueNumberTexture (line 15071) | class WebGLKernelValueNumberTexture extends WebGLKernelArray {
    method constructor (line 15072) | constructor(value, settings) {
    method setup (line 15084) | setup() {
    method getStringValueHandler (line 15088) | getStringValueHandler() {
    method getSource (line 15092) | getSource() {
    method updateValue (line 15100) | updateValue(inputTexture) {
  class WebGLKernelValueSingleArray (line 15140) | class WebGLKernelValueSingleArray extends WebGLKernelArray {
    method constructor (line 15141) | constructor(value, settings) {
    method getStringValueHandler (line 15151) | getStringValueHandler() {
    method getSource (line 15158) | getSource() {
    method updateValue (line 15166) | updateValue(value) {
  class WebGLKernelValueSingleArray1DI (line 15188) | class WebGLKernelValueSingleArray1DI extends WebGLKernelArray {
    method constructor (line 15189) | constructor(value, settings) {
    method setShape (line 15195) | setShape(value) {
    method getStringValueHandler (line 15204) | getStringValueHandler() {
    method getSource (line 15211) | getSource() {
    method updateValue (line 15219) | updateValue(value) {
  class WebGLKernelValueSingleArray2DI (line 15241) | class WebGLKernelValueSingleArray2DI extends WebGLKernelArray {
    method constructor (line 15242) | constructor(value, settings) {
    method setShape (line 15248) | setShape(value) {
    method getStringValueHandler (line 15257) | getStringValueHandler() {
    method getSource (line 15264) | getSource() {
    method updateValue (line 15272) | updateValue(value) {
  class WebGLKernelValueSingleArray3DI (line 15294) | class WebGLKernelValueSingleArray3DI extends WebGLKernelArray {
    method constructor (line 15295) | constructor(value, settings) {
    method setShape (line 15301) | setShape(value) {
    method getStringValueHandler (line 15310) | getStringValueHandler() {
    method getSource (line 15317) | getSource() {
    method updateValue (line 15325) | updateValue(value) {
  class WebGLKernelValueSingleInput (line 15347) | class WebGLKernelValueSingleInput extends WebGLKernelArray {
    method constructor (line 15348) | constructor(value, settings) {
    method getStringValueHandler (line 15359) | getStringValueHandler() {
    method getSource (line 15366) | getSource() {
    method updateValue (line 15374) | updateValue(input) {
  class WebGLKernelValueUnsignedArray (line 15396) | class WebGLKernelValueUnsignedArray extends WebGLKernelArray {
    method constructor (line 15397) | constructor(value, settings) {
    method getStringValueHandler (line 15409) | getStringValueHandler() {
    method getSource (line 15417) | getSource() {
    method updateValue (line 15425) | updateValue(value) {
  class WebGLKernelValueUnsignedInput (line 15447) | class WebGLKernelValueUnsignedInput extends WebGLKernelArray {
    method constructor (line 15448) | constructor(value, settings) {
    method getStringValueHandler (line 15461) | getStringValueHandler() {
    method getSource (line 15469) | getSource() {
    method updateValue (line 15477) | updateValue(input) {
  class WebGLKernel (line 15517) | class WebGLKernel extends GLKernel {
    method isSupported (line 15518) | static get isSupported() {
    method setupFeatureChecks (line 15527) | static setupFeatureChecks() {
    method isContextMatch (line 15545) | static isContextMatch(context) {
    method getIsTextureFloat (line 15552) | static getIsTextureFloat() {
    method getIsDrawBuffers (line 15556) | static getIsDrawBuffers() {
    method getChannelCount (line 15560) | static getChannelCount() {
    method getMaxTextureSize (line 15566) | static getMaxTextureSize() {
    method lookupKernelValueType (line 15570) | static lookupKernelValueType(type, dynamic, precision, value) {
    method testCanvas (line 15574) | static get testCanvas() {
    method testContext (line 15578) | static get testContext() {
    method features (line 15582) | static get features() {
    method fragmentShader (line 15586) | static get fragmentShader() {
    method vertexShader (line 15590) | static get vertexShader() {
    method constructor (line 15594) | constructor(source, settings) {
    method initCanvas (line 15630) | initCanvas() {
    method initContext (line 15641) | initContext() {
    method initPlugins (line 15650) | initPlugins(settings) {
    method initExtensions (line 15674) | initExtensions() {
    method validateSettings (line 15684) | validateSettings(args) {
    method updateMaxTexSize (line 15762) | updateMaxTexSize() {
    method setupArguments (line 15781) | setupArguments(args) {
    method createTexture (line 15851) | createTexture() {
    method setupConstants (line 15857) | setupConstants(args) {
    method build (line 15908) | build() {
    method translateSource (line 16022) | translateSource() {
    method setupReturnTypes (line 16030) | setupReturnTypes(functionBuilder) {
    method run (line 16045) | run() {
    method drawBuffers (line 16107) | drawBuffers() {
    method getInternalFormat (line 16111) | getInternalFormat() {
    method getTextureFormat (line 16114) | getTextureFormat() {
    method _replaceOutputTexture (line 16124) | _replaceOutputTexture() {
    method _setupOutputTexture (line 16132) | _setupOutputTexture() {
    method _replaceSubOutputTextures (line 16165) | _replaceSubOutputTextures() {
    method _setupSubOutputTextures (line 16176) | _setupSubOutputTextures() {
    method setUniform1f (line 16216) | setUniform1f(name, value) {
    method setUniform1i (line 16228) | setUniform1i(name, value) {
    method setUniform2f (line 16240) | setUniform2f(name, value1, value2) {
    method setUniform2fv (line 16255) | setUniform2fv(name, value) {
    method setUniform2iv (line 16270) | setUniform2iv(name, value) {
    method setUniform3fv (line 16285) | setUniform3fv(name, value) {
    method setUniform3iv (line 16301) | setUniform3iv(name, value) {
    method setUniform4fv (line 16317) | setUniform4fv(name, value) {
    method setUniform4iv (line 16334) | setUniform4iv(name, value) {
    method getUniformLocation (line 16351) | getUniformLocation(name) {
    method _getFragShaderArtifactMap (line 16358) | _getFragShaderArtifactMap(args) {
    method _getVertShaderArtifactMap (line 16379) | _getVertShaderArtifactMap(args) {
    method _getHeaderString (line 16388) | _getHeaderString() {
    method _getLoopMaxString (line 16396) | _getLoopMaxString() {
    method _getPluginsString (line 16404) | _getPluginsString() {
    method _getConstantsString (line 16409) | _getConstantsString() {
    method _getTextureCoordinate (line 16426) | _getTextureCoordinate() {
    method _getDecode32EndiannessString (line 16435) | _getDecode32EndiannessString() {
    method _getEncode32EndiannessString (line 16443) | _getEncode32EndiannessString() {
    method _getDivideWithIntegerCheckString (line 16451) | _getDivideWithIntegerCheckString() {
    method _getMainArgumentsString (line 16476) | _getMainArgumentsString(args) {
    method _getInjectedNative (line 16485) | _getInjectedNative() {
    method _getMainConstantsString (line 16489) | _getMainConstantsString() {
    method getRawValueFramebuffer (line 16502) | getRawValueFramebuffer(width, height) {
    method getKernelResultDeclaration (line 16515) | getKernelResultDeclaration() {
    method getKernelString (line 16536) | getKernelString() {
    method getMainResultGraphical (line 16580) | getMainResultGraphical() {
    method getMainResultPackedPixels (line 16588) | getMainResultPackedPixels() {
    method getMainResultKernelPackedPixels (line 16601) | getMainResultKernelPackedPixels() {
    method getMainResultSubKernelPackedPixels (line 16609) | getMainResultSubKernelPackedPixels() {
    method getMainResultMemoryOptimizedFloats (line 16627) | getMainResultMemoryOptimizedFloats() {
    method getMainResultKernelMemoryOptimizedFloats (line 16653) | getMainResultKernelMemoryOptimizedFloats(result, channel) {
    method getMainResultSubKernelMemoryOptimizedFloats (line 16661) | getMainResultSubKernelMemoryOptimizedFloats(result, channel) {
    method getMainResultKernelNumberTexture (line 16677) | getMainResultKernelNumberTexture() {
    method getMainResultSubKernelNumberTexture (line 16685) | getMainResultSubKernelNumberTexture() {
    method getMainResultKernelArray2Texture (line 16703) | getMainResultKernelArray2Texture() {
    method getMainResultSubKernelArray2Texture (line 16712) | getMainResultSubKernelArray2Texture() {
    method getMainResultKernelArray3Texture (line 16724) | getMainResultKernelArray3Texture() {
    method getMainResultSubKernelArray3Texture (line 16734) | getMainResultSubKernelArray3Texture() {
    method getMainResultKernelArray4Texture (line 16747) | getMainResultKernelArray4Texture() {
    method getMainResultSubKernelArray4Texture (line 16755) | getMainResultSubKernelArray4Texture() {
    method replaceArtifacts (line 16807) | replaceArtifacts(src, map) {
    method getFragmentShader (line 16816) | getFragmentShader(args) {
    method getVertexShader (line 16823) | getVertexShader(args) {
    method toString (line 16830) | toString() {
    method destroy (line 16837) | destroy(removeCanvasReferences) {
    method destroyExtensions (line 16910) | destroyExtensions() {
    method destroyContext (line 16917) | static destroyContext(context) {
    method toJSON (line 16924) | toJSON() {
  class WebGL2FunctionNode (line 17410) | class WebGL2FunctionNode extends WebGLFunctionNode {
    method astIdentifierExpression (line 17412) | astIdentifierExpression(idtNode, retArr) {
  function lookupKernelValueType (line 17622) | function lookupKernelValueType(type, dynamic, precision, value) {
  class WebGL2KernelValueArray2 (line 17651) | class WebGL2KernelValueArray2 extends WebGLKernelValueArray2 {}
  class WebGL2KernelValueArray3 (line 17659) | class WebGL2KernelValueArray3 extends WebGLKernelValueArray3 {}
  class WebGL2KernelValueArray4 (line 17667) | class WebGL2KernelValueArray4 extends WebGLKernelValueArray4 {}
  class WebGL2KernelValueBoolean (line 17675) | class WebGL2KernelValueBoolean extends WebGLKernelValueBoolean {}
  class WebGL2KernelValueDynamicHTMLImageArray (line 17684) | class WebGL2KernelValueDynamicHTMLImageArray extends WebGL2KernelValueHT...
    method getSource (line 17685) | getSource() {
    method updateValue (line 17694) | updateValue(images) {
  class WebGL2KernelValueDynamicHTMLImage (line 17712) | class WebGL2KernelValueDynamicHTMLImage extends WebGLKernelValueDynamicH...
    method getSource (line 17713) | getSource() {
  class WebGL2KernelValueDynamicHTMLVideo (line 17730) | class WebGL2KernelValueDynamicHTMLVideo extends WebGL2KernelValueDynamic...
  class WebGL2KernelValueDynamicMemoryOptimizedNumberTexture (line 17739) | class WebGL2KernelValueDynamicMemoryOptimizedNumberTexture extends WebGL...
    method getSource (line 17740) | getSource() {
  class WebGL2KernelValueDynamicNumberTexture (line 17756) | class WebGL2KernelValueDynamicNumberTexture extends WebGLKernelValueDyna...
    method getSource (line 17757) | getSource() {
  class WebGL2KernelValueDynamicSingleArray (line 17774) | class WebGL2KernelValueDynamicSingleArray extends WebGL2KernelValueSingl...
    method getSource (line 17775) | getSource() {
    method updateValue (line 17784) | updateValue(value) {
  class WebGL2KernelValueDynamicSingleArray1DI (line 17803) | class WebGL2KernelValueDynamicSingleArray1DI extends WebGL2KernelValueSi...
    method getSource (line 17804) | getSource() {
    method updateValue (line 17813) | updateValue(value) {
  class WebGL2KernelValueDynamicSingleArray2DI (line 17828) | class WebGL2KernelValueDynamicSingleArray2DI extends WebGL2KernelValueSi...
    method getSource (line 17829) | getSource() {
    method updateValue (line 17838) | updateValue(value) {
  class WebGL2KernelValueDynamicSingleArray3DI (line 17853) | class WebGL2KernelValueDynamicSingleArray3DI extends WebGL2KernelValueSi...
    method getSource (line 17854) | getSource() {
    method updateValue (line 17863) | updateValue(value) {
  class WebGL2KernelValueDynamicSingleInput (line 17878) | class WebGL2KernelValueDynamicSingleInput extends WebGL2KernelValueSingl...
    method getSource (line 17879) | getSource() {
    method updateValue (line 17888) | updateValue(value) {
  class WebGL2KernelValueDynamicUnsignedArray (line 17908) | class WebGL2KernelValueDynamicUnsignedArray extends WebGLKernelValueDyna...
    method getSource (line 17909) | getSource() {
  class WebGL2KernelValueDynamicUnsignedInput (line 17926) | class WebGL2KernelValueDynamicUnsignedInput extends WebGLKernelValueDyna...
    method getSource (line 17927) | getSource() {
  class WebGL2KernelValueFloat (line 17944) | class WebGL2KernelValueFloat extends WebGLKernelValueFloat {}
  class WebGL2KernelValueHTMLImageArray (line 17953) | class WebGL2KernelValueHTMLImageArray extends WebGLKernelArray {
    method constructor (line 17954) | constructor(value, settings) {
    method defineTexture (line 17960) | defineTexture() {
    method getStringValueHandler (line 17968) | getStringValueHandler() {
    method getSource (line 17971) | getSource() {
    method updateValue (line 17980) | updateValue(images) {
  class WebGL2KernelValueHTMLImage (line 18026) | class WebGL2KernelValueHTMLImage extends WebGLKernelValueHTMLImage {
    method getSource (line 18027) | getSource() {
  class WebGL2KernelValueHTMLVideo (line 18044) | class WebGL2KernelValueHTMLVideo extends WebGL2KernelValueHTMLImage {}
  class WebGL2KernelValueInteger (line 18052) | class WebGL2KernelValueInteger extends WebGLKernelValueInteger {
    method getSource (line 18053) | getSource(value) {
    method updateValue (line 18061) | updateValue(value) {
  class WebGL2KernelValueMemoryOptimizedNumberTexture (line 18074) | class WebGL2KernelValueMemoryOptimizedNumberTexture extends WebGLKernelV...
    method getSource (line 18075) | getSource() {
  class WebGL2KernelValueNumberTexture (line 18093) | class WebGL2KernelValueNumberTexture extends WebGLKernelValueNumberTextu...
    method getSource (line 18094) | getSource() {
  class WebGL2KernelValueSingleArray (line 18112) | class WebGL2KernelValueSingleArray extends WebGLKernelValueSingleArray {
    method getSource (line 18113) | getSource() {
    method updateValue (line 18122) | updateValue(value) {
  class WebGL2KernelValueSingleArray1DI (line 18144) | class WebGL2KernelValueSingleArray1DI extends WebGLKernelValueSingleArra...
    method updateValue (line 18145) | updateValue(value) {
  class WebGL2KernelValueSingleArray2DI (line 18167) | class WebGL2KernelValueSingleArray2DI extends WebGLKernelValueSingleArra...
    method updateValue (line 18168) | updateValue(value) {
  class WebGL2KernelValueSingleArray3DI (line 18190) | class WebGL2KernelValueSingleArray3DI extends WebGLKernelValueSingleArra...
    method updateValue (line 18191) | updateValue(value) {
  class WebGL2KernelValueSingleInput (line 18213) | class WebGL2KernelValueSingleInput extends WebGLKernelValueSingleInput {
    method getSource (line 18214) | getSource() {
    method updateValue (line 18223) | updateValue(input) {
  class WebGL2KernelValueUnsignedArray (line 18241) | class WebGL2KernelValueUnsignedArray extends WebGLKernelValueUnsignedArr...
    method getSource (line 18242) | getSource() {
  class WebGL2KernelValueUnsignedInput (line 18259) | class WebGL2KernelValueUnsignedInput extends WebGLKernelValueUnsignedInp...
    method getSource (line 18260) | getSource() {
  class WebGL2Kernel (line 18289) | class WebGL2Kernel extends WebGLKernel {
    method isSupported (line 18290) | static get isSupported() {
    method setupFeatureChecks (line 18299) | static setupFeatureChecks() {
    method isContextMatch (line 18315) | static isContextMatch(context) {
    method getFeatures (line 18322) | static getFeatures() {
    method getIsTextureFloat (line 18342) | static getIsTextureFloat() {
    method getChannelCount (line 18346) | static getChannelCount() {
    method getMaxTextureSize (line 18350) | static getMaxTextureSize() {
    method lookupKernelValueType (line 18354) | static lookupKernelValueType(type, dynamic, precision, value) {
    method testCanvas (line 18358) | static get testCanvas() {
    method testContext (line 18362) | static get testContext() {
    method features (line 18366) | static get features() {
    method fragmentShader (line 18370) | static get fragmentShader() {
    method vertexShader (line 18373) | static get vertexShader() {
    method initContext (line 18377) | initContext() {
    method initExtensions (line 18386) | initExtensions() {
    method validateSettings (line 18393) | validateSettings(args) {
    method translateSource (line 18464) | translateSource() {
    method drawBuffers (line 18472) | drawBuffers() {
    method getTextureFormat (line 18476) | getTextureFormat() {
    method getInternalFormat (line 18491) | getInternalFormat() {
    method _setupOutputTexture (line 18519) | _setupOutputTexture() {
    method _setupSubOutputTextures (line 18553) | _setupSubOutputTextures() {
    method _getHeaderString (line 18594) | _getHeaderString() {
    method _getTextureCoordinate (line 18598) | _getTextureCoordinate() {
    method _getMainArgumentsString (line 18608) | _getMainArgumentsString(args) {
    method getKernelString (line 18617) | getKernelString() {
    method getMainResultGraphical (line 18672) | getMainResultGraphical() {
    method getMainResultPackedPixels (line 18680) | getMainResultPackedPixels() {
    method getMainResultKernelPackedPixels (line 18693) | getMainResultKernelPackedPixels() {
    method getMainResultSubKernelPackedPixels (line 18701) | getMainResultSubKernelPackedPixels() {
    method getMainResultKernelMemoryOptimizedFloats (line 18719) | getMainResultKernelMemoryOptimizedFloats(result, channel) {
    method getMainResultSubKernelMemoryOptimizedFloats (line 18727) | getMainResultSubKernelMemoryOptimizedFloats(result, channel) {
    method getMainResultKernelNumberTexture (line 18743) | getMainResultKernelNumberTexture() {
    method getMainResultSubKernelNumberTexture (line 18751) | getMainResultSubKernelNumberTexture() {
    method getMainResultKernelArray2Texture (line 18769) | getMainResultKernelArray2Texture() {
    method getMainResultSubKernelArray2Texture (line 18778) | getMainResultSubKernelArray2Texture() {
    method getMainResultKernelArray3Texture (line 18791) | getMainResultKernelArray3Texture() {
    method getMainResultSubKernelArray3Texture (line 18801) | getMainResultSubKernelArray3Texture() {
    method getMainResultKernelArray4Texture (line 18815) | getMainResultKernelArray4Texture() {
    method getMainResultSubKernelArray4Texture (line 18823) | getMainResultSubKernelArray4Texture() {
    method destroyExtensions (line 18834) | destroyExtensions() {
    method toJSON (line 18839) | toJSON() {
  function bindTo (line 18886) | function bindTo(target) {
  class GPU (line 18919) | class GPU {
    method disableValidation (line 18920) | static disableValidation() {
    method enableValidation (line 18924) | static enableValidation() {
    method isGPUSupported (line 18928) | static get isGPUSupported() {
    method isKernelMapSupported (line 18932) | static get isKernelMapSupported() {
    method isOffscreenCanvasSupported (line 18936) | static get isOffscreenCanvasSupported() {
    method isWebGLSupported (line 18940) | static get isWebGLSupported() {
    method isWebGL2Supported (line 18944) | static get isWebGL2Supported() {
    method isHeadlessGLSupported (line 18948) | static get isHeadlessGLSupported() {
    method isCanvasSupported (line 18952) | static get isCanvasSupported() {
    method isGPUHTMLImageArraySupported (line 18956) | static get isGPUHTMLImageArraySupported() {
    method isSinglePrecisionSupported (line 18960) | static get isSinglePrecisionSupported() {
    method constructor (line 18964) | constructor(settings) {
    method chooseKernel (line 18992) | chooseKernel() {
    method createKernel (line 19047) | createKernel(source, settings) {
    method createKernelMap (line 19189) | createKernelMap() {
    method combineKernels (line 19242) | combineKernels() {
    method setFunctions (line 19265) | setFunctions(functions) {
    method setNativeFunctions (line 19270) | setNativeFunctions(nativeFunctions) {
    method addFunction (line 19275) | addFunction(source, settings) {
    method addNativeFunction (line 19280) | addNativeFunction(name, source, settings) {
    method injectNative (line 19288) | injectNative(source) {
    method destroy (line 19293) | destroy() {
  function upgradeDeprecatedCreateKernelSettings (line 19322) | function upgradeDeprecatedCreateKernelSettings(settings) {
  class Input (line 19411) | class Input {
    method constructor (line 19412) | constructor(value, size) {
    method toArray (line 19444) | toArray() {
  function input (line 19457) | function input(value, size) {
  function kernelRunShortcut (line 19468) | function kernelRunShortcut(kernel) {
  function bindKernelToShortcut (line 19510) | function bindKernelToShortcut(kernel, shortcut) {
  class Texture (line 19584) | class Texture {
    method constructor (line 19585) | constructor(settings) {
    method toArray (line 19618) | toArray() {
    method clone (line 19622) | clone() {
    method delete (line 19626) | delete() {
    method clear (line 19630) | clear() {
  method systemEndianness (line 19648) | systemEndianness() {
  method getSystemEndianness (line 19651) | getSystemEndianness() {
  method isFunction (line 19661) | isFunction(funcObj) {
  method isFunctionString (line 19665) | isFunctionString(fn) {
  method getFunctionNameFromString (line 19674) | getFunctionNameFromString(funcStr) {
  method getFunctionBodyFromString (line 19680) | getFunctionBodyFromString(funcStr) {
  method getArgumentNamesFromString (line 19684) | getArgumentNamesFromString(fn) {
  method clone (line 19693) | clone(obj) {
  method isArray (line 19709) | isArray(array) {
  method getVariableType (line 19713) | getVariableType(value, strictIntegers) {
  method getKernelTextureSize (line 19755) | getKernelTextureSize(settings, dimensions) {
  method closestSquareDimensions (line 19768) | closestSquareDimensions(length) {
  method getMemoryOptimizedFloatTextureSize (line 19779) | getMemoryOptimizedFloatTextureSize(dimensions, bitRatio) {
  method getMemoryOptimizedPackedTextureSize (line 19785) | getMemoryOptimizedPackedTextureSize(dimensions, bitRatio) {
  method roundTo (line 19792) | roundTo(n, d) {
  method getDimensions (line 19795) | getDimensions(x, pad) {
  method flatten2dArrayTo (line 19823) | flatten2dArrayTo(array, target) {
  method flatten3dArrayTo (line 19831) | flatten3dArrayTo(array, target) {
  method flatten4dArrayTo (line 19841) | flatten4dArrayTo(array, target) {
  method flattenTo (line 19853) | flattenTo(array, target) {
  method splitArray (line 19869) | splitArray(array, part) {
  method getAstString (line 19877) | getAstString(source, ast) {
  method allPropertiesOf (line 19894) | allPropertiesOf(obj) {
  method linesToString (line 19904) | linesToString(lines) {
  method warnDeprecated (line 19911) | warnDeprecated(type, oldName, newName) {
  function flatten (line 20156) | function flatten(ast) {

FILE: examples/advanced-typescript.ts
  type IConstants (line 24) | interface IConstants extends IConstantsThis {
  type IThis (line 28) | interface IThis extends IKernelFunctionThis {
  function kernelFunction (line 32) | function kernelFunction(this: IThis, degrees: number, divisors: [number,...
  function subKernel (line 37) | function subKernel(value: number): [number, number] {
  type IKernelMapResult (line 41) | interface IKernelMapResult extends ISubKernelsResults {

FILE: examples/simple-javascript.js
  function kernelFunction (line 6) | function kernelFunction(anInt, anArray, aNestedArray) {

FILE: src/alias.js
  function alias (line 9) | function alias(name, source) {

FILE: src/backend/cpu/function-node.js
  class CPUFunctionNode (line 8) | class CPUFunctionNode extends FunctionNode {
    method astFunction (line 15) | astFunction(ast, retArr) {
    method astReturnStatement (line 58) | astReturnStatement(ast, retArr) {
    method astLiteral (line 90) | astLiteral(ast, retArr) {
    method astBinaryExpression (line 111) | astBinaryExpression(ast, retArr) {
    method astIdentifierExpression (line 126) | astIdentifierExpression(idtNode, retArr) {
    method astForStatement (line 155) | astForStatement(forNode, retArr) {
    method astWhileStatement (line 228) | astWhileStatement(whileNode, retArr) {
    method astDoWhileStatement (line 255) | astDoWhileStatement(doWhileNode, retArr) {
    method astAssignmentExpression (line 282) | astAssignmentExpression(assNode, retArr) {
    method astBlockStatement (line 299) | astBlockStatement(bNode, retArr) {
    method astVariableDeclaration (line 322) | astVariableDeclaration(varDecNode, retArr) {
    method astIfStatement (line 348) | astIfStatement(ifNode, retArr) {
    method astSwitchStatement (line 374) | astSwitchStatement(ast, retArr) {
    method astThisExpression (line 405) | astThisExpression(tNode, retArr) {
    method astMemberExpression (line 416) | astMemberExpression(mNode, retArr) {
    method astCallExpression (line 586) | astCallExpression(ast, retArr) {
    method astArrayExpression (line 639) | astArrayExpression(arrNode, retArr) {
    method astDebuggerStatement (line 660) | astDebuggerStatement(arrNode, retArr) {

FILE: src/backend/cpu/kernel-string.js
  function constantsToString (line 3) | function constantsToString(constants, types) {
  function cpuKernelString (line 29) | function cpuKernelString(cpuKernel, name) {

FILE: src/backend/cpu/kernel.js
  class CPUKernel (line 11) | class CPUKernel extends Kernel {
    method getFeatures (line 12) | static getFeatures() {
    method features (line 15) | static get features() {
    method isSupported (line 21) | static get isSupported() {
    method isContextMatch (line 24) | static isContextMatch(context) {
    method mode (line 30) | static get mode() {
    method nativeFunctionArguments (line 34) | static nativeFunctionArguments() {
    method nativeFunctionReturnType (line 38) | static nativeFunctionReturnType() {
    method combineKernels (line 42) | static combineKernels(combinedKernel) {
    method getSignature (line 46) | static getSignature(kernel, argumentTypes) {
    method constructor (line 50) | constructor(source, settings) {
    method initCanvas (line 66) | initCanvas() {
    method initContext (line 74) | initContext() {
    method initPlugins (line 79) | initPlugins(settings) {
    method validateSettings (line 87) | validateSettings(args) {
    method translateSource (line 112) | translateSource() {
    method build (line 138) | build() {
    method color (line 178) | color(r, g, b, a) {
    method getKernelString (line 212) | getKernelString() {
    method toString (line 245) | toString() {
    method _getLoopMaxString (line 253) | _getLoopMaxString() {
    method _processConstants (line 261) | _processConstants() {
    method _earlyThrows (line 289) | _earlyThrows() {
    method _processArguments (line 309) | _processArguments() {
    method _mediaTo2DArray (line 355) | _mediaTo2DArray(media) {
    method getPixels (line 394) | getPixels(flip) {
    method _imageTo3DArray (line 400) | _imageTo3DArray(images) {
    method _resultKernelHeader (line 408) | _resultKernelHeader() {
    method _resultKernelBody (line 422) | _resultKernelBody(kernelString) {
    method _graphicalKernelBody (line 435) | _graphicalKernelBody(kernelThreadString) {
    method _graphicalOutput (line 444) | _graphicalOutput() {
    method _getKernelResultTypeConstructorString (line 451) | _getKernelResultTypeConstructorString() {
    method _resultImmutableKernel1DLoop (line 470) | _resultImmutableKernel1DLoop(kernelString) {
    method _mutableKernel1DResults (line 484) | _mutableKernel1DResults() {
    method _resultMutableKernel1DLoop (line 492) | _resultMutableKernel1DLoop(kernelString) {
    method _resultImmutableKernel2DLoop (line 502) | _resultImmutableKernel2DLoop(kernelString) {
    method _mutableKernel2DResults (line 521) | _mutableKernel2DResults() {
    method _resultMutableKernel2DLoop (line 534) | _resultMutableKernel2DLoop(kernelString) {
    method _graphicalKernel2DLoop (line 550) | _graphicalKernel2DLoop(kernelString) {
    method _resultImmutableKernel3DLoop (line 563) | _resultImmutableKernel3DLoop(kernelString) {
    method _mutableKernel3DResults (line 587) | _mutableKernel3DResults() {
    method _resultMutableKernel3DLoop (line 605) | _resultMutableKernel3DLoop(kernelString) {
    method _kernelOutput (line 623) | _kernelOutput() {
    method _mapSubKernels (line 633) | _mapSubKernels(fn) {
    method destroy (line 638) | destroy(removeCanvasReference) {
    method destroyContext (line 644) | static destroyContext(context) {}
    method toJSON (line 646) | toJSON() {
    method setOutput (line 652) | setOutput(output) {
    method prependString (line 661) | prependString(value) {
    method hasPrependString (line 666) | hasPrependString(value) {

FILE: src/backend/function-builder.js
  class FunctionBuilder (line 6) | class FunctionBuilder {
    method fromKernel (line 15) | static fromKernel(kernel, FunctionNode, extraNodeOptions) {
    method constructor (line 206) | constructor(settings) {
    method addFunctionNode (line 249) | addFunctionNode(functionNode) {
    method traceFunctionCalls (line 268) | traceFunctionCalls(functionName, retList) {
    method getPrototypeString (line 317) | getPrototypeString(functionName) {
    method getPrototypes (line 326) | getPrototypes(functionName) {
    method getStringFromFunctionNames (line 341) | getStringFromFunctionNames(functionList) {
    method getPrototypesFromFunctionNames (line 357) | getPrototypesFromFunctionNames(functionList) {
    method toJSON (line 374) | toJSON() {
    method fromJSON (line 390) | fromJSON(jsonFunctionNodes, FunctionNode) {
    method getString (line 404) | getString(functionName) {
    method lookupReturnType (line 411) | lookupReturnType(functionName, ast, requestingNode) {
    method _getFunction (line 465) | _getFunction(functionName) {
    method _isFunction (line 472) | _isFunction(functionName) {
    method _getNativeFunction (line 476) | _getNativeFunction(functionName) {
    method _isNativeFunction (line 483) | _isNativeFunction(functionName) {
    method _lookupNativeFunctionReturnType (line 487) | _lookupNativeFunctionReturnType(functionName) {
    method lookupFunctionArgumentTypes (line 495) | lookupFunctionArgumentTypes(functionName) {
    method lookupFunctionArgumentName (line 504) | lookupFunctionArgumentName(functionName, argumentIndex) {
    method lookupFunctionArgumentBitRatio (line 514) | lookupFunctionArgumentBitRatio(functionName, argumentName) {
    method needsArgumentType (line 536) | needsArgumentType(functionName, i) {
    method assignArgumentType (line 542) | assignArgumentType(functionName, i, argumentType, requestingNode) {
    method assignArgumentBitRatio (line 557) | assignArgumentBitRatio(functionName, argumentName, calleeFunctionName,...
    method trackFunctionCall (line 583) | trackFunctionCall(functionName, calleeFunctionName, args) {
    method getKernelResultType (line 592) | getKernelResultType() {
    method getSubKernelResultType (line 596) | getSubKernelResultType(index) {
    method getReturnTypes (line 611) | getReturnTypes() {

FILE: src/backend/function-node.js
  class FunctionNode (line 10) | class FunctionNode {
    method constructor (line 16) | constructor(source, settings) {
    method validate (line 79) | validate() {
    method isIdentifierConstant (line 105) | isIdentifierConstant(name) {
    method isInput (line 110) | isInput(argumentName) {
    method pushState (line 114) | pushState(state) {
    method popState (line 118) | popState(state) {
    method isState (line 125) | isState(state) {
    method state (line 129) | get state() {
    method astMemberExpressionUnroll (line 144) | astMemberExpressionUnroll(ast) {
    method getJsAST (line 186) | getJsAST(inParser) {
    method traceFunctionAST (line 214) | traceFunctionAST(ast) {
    method getDeclaration (line 260) | getDeclaration(ast) {
    method getVariableType (line 275) | getVariableType(ast) {
    method getLookupType (line 303) | getLookupType(type) {
    method getConstantType (line 310) | getConstantType(constantName) {
    method toString (line 322) | toString() {
    method toJSON (line 327) | toJSON() {
    method getType (line 357) | getType(ast) {
    method getCheckVariableType (line 574) | getCheckVariableType(ast) {
    method inferArgumentTypesIfNeeded (line 582) | inferArgumentTypesIfNeeded(functionName, args) {
    method isAstMathVariable (line 594) | isAstMathVariable(ast) {
    method isAstMathFunction (line 613) | isAstMathFunction(ast) {
    method isAstVariable (line 661) | isAstVariable(ast) {
    method isSafe (line 665) | isSafe(ast) {
    method isSafeDependencies (line 669) | isSafeDependencies(dependencies) {
    method getDependencies (line 680) | getDependencies(ast, dependencies, isNotSafe) {
    method getVariableSignature (line 800) | getVariableSignature(ast, returnRawValue) {
    method build (line 873) | build() {
    method astGeneric (line 883) | astGeneric(ast, retArr) {
    method astErrorOutput (line 963) | astErrorOutput(error, ast) {
    method astDebuggerStatement (line 975) | astDebuggerStatement(arrNode, retArr) {
    method astConditionalExpression (line 979) | astConditionalExpression(ast, retArr) {
    method astFunction (line 999) | astFunction(ast, retArr) {
    method astFunctionDeclaration (line 1009) | astFunctionDeclaration(ast, retArr) {
    method astFunctionExpression (line 1015) | astFunctionExpression(ast, retArr) {
    method isChildFunction (line 1021) | isChildFunction(ast) {
    method astReturnStatement (line 1029) | astReturnStatement(ast, retArr) {
    method astLiteral (line 1032) | astLiteral(ast, retArr) {
    method astBinaryExpression (line 1036) | astBinaryExpression(ast, retArr) {
    method astIdentifierExpression (line 1039) | astIdentifierExpression(ast, retArr) {
    method astAssignmentExpression (line 1042) | astAssignmentExpression(ast, retArr) {
    method astExpressionStatement (line 1051) | astExpressionStatement(esNode, retArr) {
    method astEmptyStatement (line 1062) | astEmptyStatement(eNode, retArr) {
    method astBlockStatement (line 1065) | astBlockStatement(ast, retArr) {
    method astIfStatement (line 1068) | astIfStatement(ast, retArr) {
    method astSwitchStatement (line 1071) | astSwitchStatement(ast, retArr) {
    method astBreakStatement (line 1080) | astBreakStatement(brNode, retArr) {
    method astContinueStatement (line 1090) | astContinueStatement(crNode, retArr) {
    method astForStatement (line 1094) | astForStatement(ast, retArr) {
    method astWhileStatement (line 1097) | astWhileStatement(ast, retArr) {
    method astDoWhileStatement (line 1100) | astDoWhileStatement(ast, retArr) {
    method astVariableDeclarator (line 1109) | astVariableDeclarator(iVarDecNode, retArr) {
    method astThisExpression (line 1117) | astThisExpression(ast, retArr) {
    method astSequenceExpression (line 1120) | astSequenceExpression(sNode, retArr) {
    method astUnaryExpression (line 1142) | astUnaryExpression(uNode, retArr) {
    method checkAndUpconvertBitwiseUnary (line 1159) | checkAndUpconvertBitwiseUnary(uNode, retArr) {}
    method astUpdateExpression (line 1167) | astUpdateExpression(uNode, retArr) {
    method astLogicalExpression (line 1184) | astLogicalExpression(logNode, retArr) {
    method astMemberExpression (line 1192) | astMemberExpression(ast, retArr) {
    method astCallExpression (line 1195) | astCallExpression(ast, retArr) {
    method astArrayExpression (line 1198) | astArrayExpression(ast, retArr) {
    method getMemberExpressionDetails (line 1207) | getMemberExpressionDetails(ast) {
    method findIdentifierOrigin (line 1387) | findIdentifierOrigin(astToFind) {
    method findLastReturn (line 1411) | findLastReturn(ast) {
    method getInternalVariableName (line 1441) | getInternalVariableName(name) {
    method astKey (line 1452) | astKey(ast, separator = ',') {

FILE: src/backend/function-tracer.js
  function last (line 3) | function last(array) {
  class FunctionTracer (line 13) | class FunctionTracer {
    method constructor (line 14) | constructor(ast) {
    method isState (line 33) | isState(state) {
    method hasState (line 37) | hasState(state) {
    method pushState (line 41) | pushState(state) {
    method popState (line 45) | popState(state) {
    method currentFunctionContext (line 53) | get currentFunctionContext() {
    method currentContext (line 57) | get currentContext() {
    method newFunctionContext (line 61) | newFunctionContext() {
    method newContext (line 67) | newContext(run) {
    method useFunctionContext (line 81) | useFunctionContext(run) {
    method getIdentifiers (line 88) | getIdentifiers(run) {
    method getDeclaration (line 101) | getDeclaration(name) {
    method scan (line 123) | scan(ast) {

FILE: src/backend/gl/kernel-string.js
  function toStringWithoutUtils (line 4) | function toStringWithoutUtils(fn) {
  function glKernelString (line 20) | function glKernelString(Kernel, args, originKernel, setupContextString, ...
  function getRenderString (line 249) | function getRenderString(targetName, kernel) {
  function getGetPixelsString (line 261) | function getGetPixelsString(kernel) {
  function getToArrayString (line 283) | function getToArrayString(kernelResult, textureName, framebufferName) {
  function findKernelValue (line 329) | function findKernelValue(argument, kernelValues, values, context, upload...

FILE: src/backend/gl/kernel.js
  class GLKernel (line 27) | class GLKernel extends Kernel {
    method mode (line 28) | static get mode() {
    method getIsFloatRead (line 32) | static getIsFloatRead() {
    method getIsIntegerDivisionAccurate (line 52) | static getIsIntegerDivisionAccurate() {
    method getIsSpeedTacticSupported (line 78) | static getIsSpeedTacticSupported() {
    method testCanvas (line 104) | static get testCanvas() {
    method testContext (line 111) | static get testContext() {
    method getFeatures (line 115) | static getFeatures() {
    method setupFeatureChecks (line 139) | static setupFeatureChecks() {
    method getSignature (line 143) | static getSignature(kernel, argumentTypes) {
    method setFixIntegerDivisionAccuracy (line 151) | setFixIntegerDivisionAccuracy(fix) {
    method setPrecision (line 160) | setPrecision(flag) {
    method setFloatTextures (line 170) | setFloatTextures(flag) {
    method nativeFunctionArguments (line 181) | static nativeFunctionArguments(source) {
    method nativeFunctionReturnType (line 295) | static nativeFunctionReturnType(source) {
    method combineKernels (line 299) | static combineKernels(combinedKernel, lastKernel) {
    method constructor (line 332) | constructor(source, settings) {
    method checkTextureSize (line 352) | checkTextureSize() {
    method translateSource (line 359) | translateSource() {
    method pickRenderStrategy (line 368) | pickRenderStrategy(args) {
    method getKernelString (line 655) | getKernelString() {
    method getMainResultTexture (line 659) | getMainResultTexture() {
    method getMainResultKernelNumberTexture (line 681) | getMainResultKernelNumberTexture() {
    method getMainResultSubKernelNumberTexture (line 688) | getMainResultSubKernelNumberTexture() {
    method getMainResultKernelArray2Texture (line 695) | getMainResultKernelArray2Texture() {
    method getMainResultSubKernelArray2Texture (line 702) | getMainResultSubKernelArray2Texture() {
    method getMainResultKernelArray3Texture (line 709) | getMainResultKernelArray3Texture() {
    method getMainResultSubKernelArray3Texture (line 716) | getMainResultSubKernelArray3Texture() {
    method getMainResultKernelArray4Texture (line 723) | getMainResultKernelArray4Texture() {
    method getMainResultSubKernelArray4Texture (line 730) | getMainResultSubKernelArray4Texture() {
    method getMainResultGraphical (line 737) | getMainResultGraphical() {
    method getMainResultMemoryOptimizedFloats (line 744) | getMainResultMemoryOptimizedFloats() {
    method getMainResultPackedPixels (line 751) | getMainResultPackedPixels() {
    method getMainResultString (line 755) | getMainResultString() {
    method getMainResultNumberTexture (line 768) | getMainResultNumberTexture() {
    method getMainResultArray2Texture (line 773) | getMainResultArray2Texture() {
    method getMainResultArray3Texture (line 778) | getMainResultArray3Texture() {
    method getMainResultArray4Texture (line 783) | getMainResultArray4Texture() {
    method getFloatTacticDeclaration (line 792) | getFloatTacticDeclaration() {
    method getIntTacticDeclaration (line 801) | getIntTacticDeclaration() {
    method getSampler2DTacticDeclaration (line 809) | getSampler2DTacticDeclaration() {
    method getSampler2DArrayTacticDeclaration (line 813) | getSampler2DArrayTacticDeclaration() {
    method renderTexture (line 817) | renderTexture() {
    method readPackedPixelsToUint8Array (line 820) | readPackedPixelsToUint8Array() {
    method readPackedPixelsToFloat32Array (line 831) | readPackedPixelsToFloat32Array() {
    method readFloatPixelsToFloat32Array (line 835) | readFloatPixelsToFloat32Array() {
    method getPixels (line 853) | getPixels(flip) {
    method renderKernelsToArrays (line 865) | renderKernelsToArrays() {
    method renderKernelsToTextures (line 875) | renderKernelsToTextures() {
    method resetSwitchingKernels (line 891) | resetSwitchingKernels() {
    method setOutput (line 897) | setOutput(output) {
    method renderValues (line 952) | renderValues() {
    method switchKernels (line 960) | switchKernels(reason) {
    method getVariablePrecisionString (line 967) | getVariablePrecisionString(textureSize = this.texSize, tactic = this.t...
    method updateTextureArgumentRefs (line 1001) | updateTextureArgumentRefs(kernelValue, arg) {
    method onActivate (line 1035) | onActivate(previousKernel) {
    method initCanvas (line 1046) | initCanvas() {}

FILE: src/backend/gl/texture/array-2-float-2d.js
  class GLTextureArray2Float2D (line 4) | class GLTextureArray2Float2D extends GLTextureFloat {
    method constructor (line 5) | constructor(settings) {
    method toArray (line 9) | toArray() {

FILE: src/backend/gl/texture/array-2-float-3d.js
  class GLTextureArray2Float3D (line 4) | class GLTextureArray2Float3D extends GLTextureFloat {
    method constructor (line 5) | constructor(settings) {
    method toArray (line 9) | toArray() {

FILE: src/backend/gl/texture/array-2-float.js
  class GLTextureArray2Float (line 4) | class GLTextureArray2Float extends GLTextureFloat {
    method constructor (line 5) | constructor(settings) {
    method toArray (line 9) | toArray() {

FILE: src/backend/gl/texture/array-3-float-2d.js
  class GLTextureArray3Float2D (line 4) | class GLTextureArray3Float2D extends GLTextureFloat {
    method constructor (line 5) | constructor(settings) {
    method toArray (line 9) | toArray() {

FILE: src/backend/gl/texture/array-3-float-3d.js
  class GLTextureArray3Float3D (line 4) | class GLTextureArray3Float3D extends GLTextureFloat {
    method constructor (line 5) | constructor(settings) {
    method toArray (line 9) | toArray() {

FILE: src/backend/gl/texture/array-3-float.js
  class GLTextureArray3Float (line 4) | class GLTextureArray3Float extends GLTextureFloat {
    method constructor (line 5) | constructor(settings) {
    method toArray (line 9) | toArray() {

FILE: src/backend/gl/texture/array-4-float-2d.js
  class GLTextureArray4Float2D (line 4) | class GLTextureArray4Float2D extends GLTextureFloat {
    method constructor (line 5) | constructor(settings) {
    method toArray (line 9) | toArray() {

FILE: src/backend/gl/texture/array-4-float-3d.js
  class GLTextureArray4Float3D (line 4) | class GLTextureArray4Float3D extends GLTextureFloat {
    method constructor (line 5) | constructor(settings) {
    method toArray (line 9) | toArray() {

FILE: src/backend/gl/texture/array-4-float.js
  class GLTextureArray4Float (line 4) | class GLTextureArray4Float extends GLTextureFloat {
    method constructor (line 5) | constructor(settings) {
    method toArray (line 9) | toArray() {

FILE: src/backend/gl/texture/float-2d.js
  class GLTextureFloat2D (line 4) | class GLTextureFloat2D extends GLTextureFloat {
    method constructor (line 5) | constructor(settings) {
    method toArray (line 9) | toArray() {

FILE: src/backend/gl/texture/float-3d.js
  class GLTextureFloat3D (line 4) | class GLTextureFloat3D extends GLTextureFloat {
    method constructor (line 5) | constructor(settings) {
    method toArray (line 9) | toArray() {

FILE: src/backend/gl/texture/float.js
  class GLTextureFloat (line 4) | class GLTextureFloat extends GLTexture {
    method textureType (line 5) | get textureType() {
    method constructor (line 8) | constructor(settings) {
    method renderRawOutput (line 12) | renderRawOutput() {
    method renderValues (line 27) | renderValues() {
    method toArray (line 31) | toArray() {

FILE: src/backend/gl/texture/graphical.js
  class GLTextureGraphical (line 3) | class GLTextureGraphical extends GLTextureUnsigned {
    method constructor (line 4) | constructor(settings) {
    method toArray (line 8) | toArray() {

FILE: src/backend/gl/texture/index.js
  class GLTexture (line 8) | class GLTexture extends Texture {
    method textureType (line 13) | get textureType() {
    method clone (line 17) | clone() {
    method beforeMutate (line 24) | beforeMutate() {
    method cloneTexture (line 35) | cloneTexture() {
    method newTexture (line 55) | newTexture() {
    method clear (line 70) | clear() {
    method delete (line 89) | delete() {
    method framebuffer (line 104) | framebuffer() {
  function selectTexture (line 112) | function selectTexture(gl, texture) {

FILE: src/backend/gl/texture/memory-optimized-2d.js
  class GLTextureMemoryOptimized2D (line 4) | class GLTextureMemoryOptimized2D extends GLTextureFloat {
    method constructor (line 5) | constructor(settings) {
    method toArray (line 9) | toArray() {

FILE: src/backend/gl/texture/memory-optimized-3d.js
  class GLTextureMemoryOptimized3D (line 4) | class GLTextureMemoryOptimized3D extends GLTextureFloat {
    method constructor (line 5) | constructor(settings) {
    method toArray (line 9) | toArray() {

FILE: src/backend/gl/texture/memory-optimized.js
  class GLTextureMemoryOptimized (line 4) | class GLTextureMemoryOptimized extends GLTextureFloat {
    method constructor (line 5) | constructor(settings) {
    method toArray (line 9) | toArray() {

FILE: src/backend/gl/texture/unsigned-2d.js
  class GLTextureUnsigned2D (line 4) | class GLTextureUnsigned2D extends GLTextureUnsigned {
    method constructor (line 5) | constructor(settings) {
    method toArray (line 9) | toArray() {

FILE: src/backend/gl/texture/unsigned-3d.js
  class GLTextureUnsigned3D (line 4) | class GLTextureUnsigned3D extends GLTextureUnsigned {
    method constructor (line 5) | constructor(settings) {
    method toArray (line 9) | toArray() {

FILE: src/backend/gl/texture/unsigned.js
  class GLTextureUnsigned (line 4) | class GLTextureUnsigned extends GLTexture {
    method textureType (line 5) | get textureType() {
    method constructor (line 8) | constructor(settings) {
    method renderRawOutput (line 12) | renderRawOutput() {
    method renderValues (line 26) | renderValues() {
    method toArray (line 30) | toArray() {

FILE: src/backend/headless-gl/kernel.js
  class HeadlessGLKernel (line 11) | class HeadlessGLKernel extends WebGLKernel {
    method isSupported (line 12) | static get isSupported() {
    method setupFeatureChecks (line 19) | static setupFeatureChecks() {
    method isContextMatch (line 43) | static isContextMatch(context) {
    method getIsTextureFloat (line 51) | static getIsTextureFloat() {
    method getIsDrawBuffers (line 55) | static getIsDrawBuffers() {
    method getChannelCount (line 59) | static getChannelCount() {
    method getMaxTextureSize (line 65) | static getMaxTextureSize() {
    method testCanvas (line 69) | static get testCanvas() {
    method testContext (line 73) | static get testContext() {
    method features (line 77) | static get features() {
    method initCanvas (line 81) | initCanvas() {
    method initContext (line 85) | initContext() {
    method initExtensions (line 91) | initExtensions() {
    method build (line 102) | build() {
    method destroyExtensions (line 109) | destroyExtensions() {
    method destroyContext (line 118) | static destroyContext(context) {
    method toString (line 128) | toString() {
    method setOutput (line 134) | setOutput(output) {

FILE: src/backend/kernel-value.js
  class KernelValue (line 4) | class KernelValue {
    method constructor (line 9) | constructor(value, settings) {
    method id (line 55) | get id() {
    method getSource (line 59) | getSource() {
    method updateValue (line 63) | updateValue(value) {

FILE: src/backend/kernel.js
  class Kernel (line 4) | class Kernel {
    method isSupported (line 8) | static get isSupported() {
    method isContextMatch (line 16) | static isContextMatch(context) {
    method getFeatures (line 24) | static getFeatures() {
    method destroyContext (line 28) | static destroyContext(context) {
    method nativeFunctionArguments (line 32) | static nativeFunctionArguments() {
    method nativeFunctionReturnType (line 36) | static nativeFunctionReturnType() {
    method combineKernels (line 40) | static combineKernels() {
    method constructor (line 49) | constructor(source, settings) {
    method mergeSettings (line 231) | mergeSettings(settings) {
    method build (line 275) | build() {
    method run (line 285) | run() {
    method initCanvas (line 293) | initCanvas() {
    method initContext (line 301) | initContext() {
    method initPlugins (line 310) | initPlugins(settings) {
    method addFunction (line 320) | addFunction(source, settings = {}) {
    method addNativeFunction (line 339) | addNativeFunction(name, source, settings = {}) {
    method setupArguments (line 360) | setupArguments(args) {
    method setupConstants (line 400) | setupConstants() {
    method setOptimizeFloatMemory (line 432) | setOptimizeFloatMemory(flag) {
    method toKernelOutput (line 442) | toKernelOutput(output) {
    method setOutput (line 463) | setOutput(output) {
    method setDebug (line 473) | setDebug(flag) {
    method setGraphical (line 483) | setGraphical(flag) {
    method setLoopMaxIterations (line 494) | setLoopMaxIterations(max) {
    method setConstants (line 503) | setConstants(constants) {
    method setConstantTypes (line 513) | setConstantTypes(constantTypes) {
    method setFunctions (line 523) | setFunctions(functions) {
    method setNativeFunctions (line 535) | setNativeFunctions(nativeFunctions) {
    method setInjectedNative (line 549) | setInjectedNative(injectedNative) {
    method setPipeline (line 559) | setPipeline(flag) {
    method setPrecision (line 569) | setPrecision(flag) {
    method setDimensions (line 579) | setDimensions(flag) {
    method setOutputToTexture (line 590) | setOutputToTexture(flag) {
    method setImmutable (line 601) | setImmutable(flag) {
    method setCanvas (line 611) | setCanvas(canvas) {
    method setStrictIntegers (line 620) | setStrictIntegers(flag) {
    method setDynamicOutput (line 630) | setDynamicOutput(flag) {
    method setHardcodeConstants (line 640) | setHardcodeConstants(flag) {
    method setDynamicArguments (line 652) | setDynamicArguments(flag) {
    method setUseLegacyEncoder (line 661) | setUseLegacyEncoder(flag) {
    method setWarnVarUsage (line 671) | setWarnVarUsage(flag) {
    method getCanvas (line 680) | getCanvas() {
    method getWebGl (line 689) | getWebGl() {
    method setContext (line 698) | setContext(context) {
    method setArgumentTypes (line 708) | setArgumentTypes(argumentTypes) {
    method setTactic (line 728) | setTactic(tactic) {
    method requestFallback (line 733) | requestFallback(args) {
    method validateSettings (line 745) | validateSettings() {
    method addSubKernel (line 755) | addSubKernel(subKernel) {
    method destroy (line 770) | destroy(removeCanvasReferences) {
    method getBitRatio (line 779) | getBitRatio(value) {
    method getPixels (line 807) | getPixels(flip) {
    method checkOutput (line 811) | checkOutput() {
    method prependString (line 825) | prependString(value) {
    method hasPrependString (line 834) | hasPrependString(value) {
    method toJSON (line 841) | toJSON() {
    method buildSignature (line 858) | buildSignature(args) {
    method getArgumentTypes (line 868) | static getArgumentTypes(kernel, args) {
    method getSignature (line 897) | static getSignature(kernel, argumentTypes) {
    method functionToIGPUFunction (line 907) | functionToIGPUFunction(source, settings = {}) {
    method onActivate (line 934) | onActivate(previousKernel) {}
  function splitArgumentTypes (line 937) | function splitArgumentTypes(argumentTypesObject) {

FILE: src/backend/web-gl/function-node.js
  class WebGLFunctionNode (line 7) | class WebGLFunctionNode extends FunctionNode {
    method constructor (line 8) | constructor(source, settings) {
    method astConditionalExpression (line 15) | astConditionalExpression(ast, retArr) {
    method astFunction (line 50) | astFunction(ast, retArr) {
    method astReturnStatement (line 131) | astReturnStatement(ast, retArr) {
    method astLiteral (line 217) | astLiteral(ast, retArr) {
    method astBinaryExpression (line 254) | astBinaryExpression(ast, retArr) {
    method checkAndUpconvertOperator (line 436) | checkAndUpconvertOperator(ast, retArr) {
    method checkAndUpconvertBitwiseOperators (line 474) | checkAndUpconvertBitwiseOperators(ast, retArr) {
    method checkAndUpconvertBitwiseUnary (line 516) | checkAndUpconvertBitwiseUnary(ast, retArr) {
    method castLiteralToInteger (line 545) | castLiteralToInteger(ast, retArr) {
    method castLiteralToFloat (line 558) | castLiteralToFloat(ast, retArr) {
    method castValueToInteger (line 571) | castValueToInteger(ast, retArr) {
    method castValueToFloat (line 586) | castValueToFloat(ast, retArr) {
    method astIdentifierExpression (line 601) | astIdentifierExpression(idtNode, retArr) {
    method astForStatement (line 631) | astForStatement(forNode, retArr) {
    method astWhileStatement (line 708) | astWhileStatement(whileNode, retArr) {
    method astDoWhileStatement (line 730) | astDoWhileStatement(doWhileNode, retArr) {
    method astAssignmentExpression (line 753) | astAssignmentExpression(assNode, retArr) {
    method astBlockStatement (line 793) | astBlockStatement(bNode, retArr) {
    method astVariableDeclaration (line 816) | astVariableDeclaration(varDecNode, retArr) {
    method astIfStatement (line 903) | astIfStatement(ifNode, retArr) {
    method astSwitchStatement (line 928) | astSwitchStatement(ast, retArr) {
    method astThisExpression (line 1030) | astThisExpression(tNode, retArr) {
    method astMemberExpression (line 1041) | astMemberExpression(mNode, retArr) {
    method astCallExpression (line 1323) | astCallExpression(ast, retArr) {
    method astArrayExpression (line 1506) | astArrayExpression(arrNode, retArr) {
    method memberExpressionXYZ (line 1532) | memberExpressionXYZ(x, y, z, retArr) {
    method memberExpressionPropertyMarkup (line 1547) | memberExpressionPropertyMarkup(property) {

FILE: src/backend/web-gl/kernel-value-maps.js
  function lookupKernelValueType (line 177) | function lookupKernelValueType(type, dynamic, precision, value) {

FILE: src/backend/web-gl/kernel-value/array.js
  class WebGLKernelArray (line 7) | class WebGLKernelArray extends WebGLKernelValue {
    method checkSize (line 13) | checkSize(width, height) {
    method setup (line 27) | setup() {
    method requestTexture (line 33) | requestTexture() {
    method defineTexture (line 37) | defineTexture() {
    method setupTexture (line 47) | setupTexture() {
    method getBitRatio (line 59) | getBitRatio(value) {
    method destroy (line 80) | destroy() {

FILE: src/backend/web-gl/kernel-value/array2.js
  class WebGLKernelValueArray2 (line 3) | class WebGLKernelValueArray2 extends WebGLKernelValue {
    method constructor (line 4) | constructor(value, settings) {
    method getSource (line 8) | getSource(value) {
    method getStringValueHandler (line 15) | getStringValueHandler() {
    method updateValue (line 21) | updateValue(value) {

FILE: src/backend/web-gl/kernel-value/array3.js
  class WebGLKernelValueArray3 (line 3) | class WebGLKernelValueArray3 extends WebGLKernelValue {
    method constructor (line 4) | constructor(value, settings) {
    method getSource (line 8) | getSource(value) {
    method getStringValueHandler (line 15) | getStringValueHandler() {
    method updateValue (line 21) | updateValue(value) {

FILE: src/backend/web-gl/kernel-value/array4.js
  class WebGLKernelValueArray4 (line 3) | class WebGLKernelValueArray4 extends WebGLKernelValue {
    method constructor (line 4) | constructor(value, settings) {
    method getSource (line 8) | getSource(value) {
    method getStringValueHandler (line 15) | getStringValueHandler() {
    method updateValue (line 21) | updateValue(value) {

FILE: src/backend/web-gl/kernel-value/boolean.js
  class WebGLKernelValueBoolean (line 4) | class WebGLKernelValueBoolean extends WebGLKernelValue {
    method constructor (line 5) | constructor(value, settings) {
    method getSource (line 9) | getSource(value) {
    method getStringValueHandler (line 16) | getStringValueHandler() {
    method updateValue (line 20) | updateValue(value) {

FILE: src/backend/web-gl/kernel-value/dynamic-html-image.js
  class WebGLKernelValueDynamicHTMLImage (line 4) | class WebGLKernelValueDynamicHTMLImage extends WebGLKernelValueHTMLImage {
    method getSource (line 5) | getSource() {
    method updateValue (line 13) | updateValue(value) {

FILE: src/backend/web-gl/kernel-value/dynamic-html-video.js
  class WebGLKernelValueDynamicHTMLVideo (line 3) | class WebGLKernelValueDynamicHTMLVideo extends WebGLKernelValueDynamicHT...

FILE: src/backend/web-gl/kernel-value/dynamic-memory-optimized-number-texture.js
  class WebGLKernelValueDynamicMemoryOptimizedNumberTexture (line 4) | class WebGLKernelValueDynamicMemoryOptimizedNumberTexture extends WebGLK...
    method getSource (line 5) | getSource() {
    method updateValue (line 13) | updateValue(inputTexture) {

FILE: src/backend/web-gl/kernel-value/dynamic-number-texture.js
  class WebGLKernelValueDynamicNumberTexture (line 4) | class WebGLKernelValueDynamicNumberTexture extends WebGLKernelValueNumbe...
    method getSource (line 5) | getSource() {
    method updateValue (line 13) | updateValue(value) {

FILE: src/backend/web-gl/kernel-value/dynamic-single-array.js
  class WebGLKernelValueDynamicSingleArray (line 4) | class WebGLKernelValueDynamicSingleArray extends WebGLKernelValueSingleA...
    method getSource (line 5) | getSource() {
    method updateValue (line 13) | updateValue(value) {

FILE: src/backend/web-gl/kernel-value/dynamic-single-array1d-i.js
  class WebGLKernelValueDynamicSingleArray1DI (line 4) | class WebGLKernelValueDynamicSingleArray1DI extends WebGLKernelValueSing...
    method getSource (line 5) | getSource() {
    method updateValue (line 13) | updateValue(value) {

FILE: src/backend/web-gl/kernel-value/dynamic-single-array2d-i.js
  class WebGLKernelValueDynamicSingleArray2DI (line 4) | class WebGLKernelValueDynamicSingleArray2DI extends WebGLKernelValueSing...
    method getSource (line 5) | getSource() {
    method updateValue (line 13) | updateValue(value) {

FILE: src/backend/web-gl/kernel-value/dynamic-single-array3d-i.js
  class WebGLKernelValueDynamicSingleArray3DI (line 4) | class WebGLKernelValueDynamicSingleArray3DI extends WebGLKernelValueSing...
    method getSource (line 5) | getSource() {
    method updateValue (line 13) | updateValue(value) {

FILE: src/backend/web-gl/kernel-value/dynamic-single-input.js
  class WebGLKernelValueDynamicSingleInput (line 4) | class WebGLKernelValueDynamicSingleInput extends WebGLKernelValueSingleI...
    method getSource (line 5) | getSource() {
    method updateValue (line 13) | updateValue(value) {

FILE: src/backend/web-gl/kernel-value/dynamic-unsigned-array.js
  class WebGLKernelValueDynamicUnsignedArray (line 4) | class WebGLKernelValueDynamicUnsignedArray extends WebGLKernelValueUnsig...
    method getSource (line 5) | getSource() {
    method updateValue (line 13) | updateValue(value) {

FILE: src/backend/web-gl/kernel-value/dynamic-unsigned-input.js
  class WebGLKernelValueDynamicUnsignedInput (line 4) | class WebGLKernelValueDynamicUnsignedInput extends WebGLKernelValueUnsig...
    method getSource (line 5) | getSource() {
    method updateValue (line 13) | updateValue(value) {

FILE: src/backend/web-gl/kernel-value/float.js
  class WebGLKernelValueFloat (line 4) | class WebGLKernelValueFloat extends WebGLKernelValue {
    method constructor (line 5) | constructor(value, settings) {
    method getStringValueHandler (line 9) | getStringValueHandler() {
    method getSource (line 12) | getSource(value) {
    method updateValue (line 22) | updateValue(value) {

FILE: src/backend/web-gl/kernel-value/html-image.js
  class WebGLKernelValueHTMLImage (line 4) | class WebGLKernelValueHTMLImage extends WebGLKernelArray {
    method constructor (line 5) | constructor(value, settings) {
    method getStringValueHandler (line 14) | getStringValueHandler() {
    method getSource (line 18) | getSource() {
    method updateValue (line 26) | updateValue(inputImage) {

FILE: src/backend/web-gl/kernel-value/html-video.js
  class WebGLKernelValueHTMLVideo (line 3) | class WebGLKernelValueHTMLVideo extends WebGLKernelValueHTMLImage {}

FILE: src/backend/web-gl/kernel-value/index.js
  class WebGLKernelValue (line 4) | class WebGLKernelValue extends KernelValue {
    method constructor (line 9) | constructor(value, settings) {
    method id (line 22) | get id() {
    method setup (line 26) | setup() {}
    method getTransferArrayType (line 28) | getTransferArrayType(value) {
    method getStringValueHandler (line 53) | getStringValueHandler() {
    method getVariablePrecisionString (line 57) | getVariablePrecisionString() {
    method destroy (line 61) | destroy() {}

FILE: src/backend/web-gl/kernel-value/integer.js
  class WebGLKernelValueInteger (line 4) | class WebGLKernelValueInteger extends WebGLKernelValue {
    method constructor (line 5) | constructor(value, settings) {
    method getStringValueHandler (line 9) | getStringValueHandler() {
    method getSource (line 12) | getSource(value) {
    method updateValue (line 19) | updateValue(value) {

FILE: src/backend/web-gl/kernel-value/memory-optimized-number-texture.js
  class WebGLKernelValueMemoryOptimizedNumberTexture (line 6) | class WebGLKernelValueMemoryOptimizedNumberTexture extends WebGLKernelAr...
    method constructor (line 7) | constructor(value, settings) {
    method setup (line 17) | setup() {
    method getStringValueHandler (line 21) | getStringValueHandler() {
    method getSource (line 25) | getSource() {
    method updateValue (line 36) | updateValue(inputTexture) {

FILE: src/backend/web-gl/kernel-value/number-texture.js
  class WebGLKernelValueNumberTexture (line 5) | class WebGLKernelValueNumberTexture extends WebGLKernelArray {
    method constructor (line 6) | constructor(value, settings) {
    method setup (line 18) | setup() {
    method getStringValueHandler (line 22) | getStringValueHandler() {
    method getSource (line 26) | getSource() {
    method updateValue (line 38) | updateValue(inputTexture) {

FILE: src/backend/web-gl/kernel-value/single-array.js
  class WebGLKernelValueSingleArray (line 4) | class WebGLKernelValueSingleArray extends WebGLKernelArray {
    method constructor (line 5) | constructor(value, settings) {
    method getStringValueHandler (line 15) | getStringValueHandler() {
    method getSource (line 22) | getSource() {
    method updateValue (line 30) | updateValue(value) {

FILE: src/backend/web-gl/kernel-value/single-array1d-i.js
  class WebGLKernelValueSingleArray1DI (line 4) | class WebGLKernelValueSingleArray1DI extends WebGLKernelArray {
    method constructor (line 5) | constructor(value, settings) {
    method setShape (line 11) | setShape(value) {
    method getStringValueHandler (line 20) | getStringValueHandler() {
    method getSource (line 27) | getSource() {
    method updateValue (line 35) | updateValue(value) {

FILE: src/backend/web-gl/kernel-value/single-array2d-i.js
  class WebGLKernelValueSingleArray2DI (line 4) | class WebGLKernelValueSingleArray2DI extends WebGLKernelArray {
    method constructor (line 5) | constructor(value, settings) {
    method setShape (line 11) | setShape(value) {
    method getStringValueHandler (line 20) | getStringValueHandler() {
    method getSource (line 27) | getSource() {
    method updateValue (line 35) | updateValue(value) {

FILE: src/backend/web-gl/kernel-value/single-array3d-i.js
  class WebGLKernelValueSingleArray3DI (line 4) | class WebGLKernelValueSingleArray3DI extends WebGLKernelArray {
    method constructor (line 5) | constructor(value, settings) {
    method setShape (line 11) | setShape(value) {
    method getStringValueHandler (line 20) | getStringValueHandler() {
    method getSource (line 27) | getSource() {
    method updateValue (line 35) | updateValue(value) {

FILE: src/backend/web-gl/kernel-value/single-input.js
  class WebGLKernelValueSingleInput (line 4) | class WebGLKernelValueSingleInput extends WebGLKernelArray {
    method constructor (line 5) | constructor(value, settings) {
    method getStringValueHandler (line 16) | getStringValueHandler() {
    method getSource (line 23) | getSource() {
    method updateValue (line 31) | updateValue(input) {

FILE: src/backend/web-gl/kernel-value/unsigned-array.js
  class WebGLKernelValueUnsignedArray (line 4) | class WebGLKernelValueUnsignedArray extends WebGLKernelArray {
    method constructor (line 5) | constructor(value, settings) {
    method getStringValueHandler (line 17) | getStringValueHandler() {
    method getSource (line 25) | getSource() {
    method updateValue (line 33) | updateValue(value) {

FILE: src/backend/web-gl/kernel-value/unsigned-input.js
  class WebGLKernelValueUnsignedInput (line 4) | class WebGLKernelValueUnsignedInput extends WebGLKernelArray {
    method constructor (line 5) | constructor(value, settings) {
    method getStringValueHandler (line 18) | getStringValueHandler() {
    method getSource (line 26) | getSource() {
    method updateValue (line 34) | updateValue(input) {

FILE: src/backend/web-gl/kernel.js
  class WebGLKernel (line 48) | class WebGLKernel extends GLKernel {
    method isSupported (line 49) | static get isSupported() {
    method setupFeatureChecks (line 58) | static setupFeatureChecks() {
    method isContextMatch (line 76) | static isContextMatch(context) {
    method getIsTextureFloat (line 83) | static getIsTextureFloat() {
    method getIsDrawBuffers (line 87) | static getIsDrawBuffers() {
    method getChannelCount (line 91) | static getChannelCount() {
    method getMaxTextureSize (line 97) | static getMaxTextureSize() {
    method lookupKernelValueType (line 109) | static lookupKernelValueType(type, dynamic, precision, value) {
    method testCanvas (line 113) | static get testCanvas() {
    method testContext (line 117) | static get testContext() {
    method features (line 121) | static get features() {
    method fragmentShader (line 125) | static get fragmentShader() {
    method vertexShader (line 129) | static get vertexShader() {
    method constructor (line 138) | constructor(source, settings) {
    method initCanvas (line 182) | initCanvas() {
    method initContext (line 198) | initContext() {
    method initPlugins (line 212) | initPlugins(settings) {
    method initExtensions (line 238) | initExtensions() {
    method validateSettings (line 252) | validateSettings(args) {
    method updateMaxTexSize (line 330) | updateMaxTexSize() {
    method setupArguments (line 349) | setupArguments(args) {
    method createTexture (line 421) | createTexture() {
    method setupConstants (line 427) | setupConstants(args) {
    method build (line 478) | build() {
    method translateSource (line 592) | translateSource() {
    method setupReturnTypes (line 600) | setupReturnTypes(functionBuilder) {
    method run (line 615) | run() {
    method drawBuffers (line 677) | drawBuffers() {
    method getInternalFormat (line 681) | getInternalFormat() {
    method getTextureFormat (line 684) | getTextureFormat() {
    method _replaceOutputTexture (line 698) | _replaceOutputTexture() {
    method _setupOutputTexture (line 709) | _setupOutputTexture() {
    method _replaceSubOutputTextures (line 747) | _replaceSubOutputTextures() {
    method _setupSubOutputTextures (line 761) | _setupSubOutputTextures() {
    method setUniform1f (line 802) | setUniform1f(name, value) {
    method setUniform1i (line 814) | setUniform1i(name, value) {
    method setUniform2f (line 826) | setUniform2f(name, value1, value2) {
    method setUniform2fv (line 841) | setUniform2fv(name, value) {
    method setUniform2iv (line 856) | setUniform2iv(name, value) {
    method setUniform3fv (line 871) | setUniform3fv(name, value) {
    method setUniform3iv (line 887) | setUniform3iv(name, value) {
    method setUniform4fv (line 903) | setUniform4fv(name, value) {
    method setUniform4iv (line 920) | setUniform4iv(name, value) {
    method getUniformLocation (line 942) | getUniformLocation(name) {
    method _getFragShaderArtifactMap (line 956) | _getFragShaderArtifactMap(args) {
    method _getVertShaderArtifactMap (line 984) | _getVertShaderArtifactMap(args) {
    method _getHeaderString (line 999) | _getHeaderString() {
    method _getLoopMaxString (line 1011) | _getLoopMaxString() {
    method _getPluginsString (line 1019) | _getPluginsString() {
    method _getConstantsString (line 1028) | _getConstantsString() {
    method _getTextureCoordinate (line 1049) | _getTextureCoordinate() {
    method _getDecode32EndiannessString (line 1062) | _getDecode32EndiannessString() {
    method _getEncode32EndiannessString (line 1074) | _getEncode32EndiannessString() {
    method _getDivideWithIntegerCheckString (line 1086) | _getDivideWithIntegerCheckString() {
    method _getMainArgumentsString (line 1116) | _getMainArgumentsString(args) {
    method _getInjectedNative (line 1125) | _getInjectedNative() {
    method _getMainConstantsString (line 1129) | _getMainConstantsString() {
    method getRawValueFramebuffer (line 1142) | getRawValueFramebuffer(width, height) {
    method getKernelResultDeclaration (line 1155) | getKernelResultDeclaration() {
    method getKernelString (line 1180) | getKernelString() {
    method getMainResultGraphical (line 1224) | getMainResultGraphical() {
    method getMainResultPackedPixels (line 1232) | getMainResultPackedPixels() {
    method getMainResultKernelPackedPixels (line 1248) | getMainResultKernelPackedPixels() {
    method getMainResultSubKernelPackedPixels (line 1259) | getMainResultSubKernelPackedPixels() {
    method getMainResultMemoryOptimizedFloats (line 1277) | getMainResultMemoryOptimizedFloats() {
    method getMainResultKernelMemoryOptimizedFloats (line 1303) | getMainResultKernelMemoryOptimizedFloats(result, channel) {
    method getMainResultSubKernelMemoryOptimizedFloats (line 1311) | getMainResultSubKernelMemoryOptimizedFloats(result, channel) {
    method getMainResultKernelNumberTexture (line 1327) | getMainResultKernelNumberTexture() {
    method getMainResultSubKernelNumberTexture (line 1335) | getMainResultSubKernelNumberTexture() {
    method getMainResultKernelArray2Texture (line 1353) | getMainResultKernelArray2Texture() {
    method getMainResultSubKernelArray2Texture (line 1362) | getMainResultSubKernelArray2Texture() {
    method getMainResultKernelArray3Texture (line 1374) | getMainResultKernelArray3Texture() {
    method getMainResultSubKernelArray3Texture (line 1384) | getMainResultSubKernelArray3Texture() {
    method getMainResultKernelArray4Texture (line 1397) | getMainResultKernelArray4Texture() {
    method getMainResultSubKernelArray4Texture (line 1405) | getMainResultSubKernelArray4Texture() {
    method replaceArtifacts (line 1461) | replaceArtifacts(src, map) {
    method getFragmentShader (line 1478) | getFragmentShader(args) {
    method getVertexShader (line 1490) | getVertexShader(args) {
    method toString (line 1500) | toString() {
    method destroy (line 1507) | destroy(removeCanvasReferences) {
    method destroyExtensions (line 1580) | destroyExtensions() {
    method destroyContext (line 1587) | static destroyContext(context) {
    method toJSON (line 1597) | toJSON() {

FILE: src/backend/web-gl2/function-node.js
  class WebGL2FunctionNode (line 10) | class WebGL2FunctionNode extends WebGLFunctionNode {
    method astIdentifierExpression (line 18) | astIdentifierExpression(idtNode, retArr) {

FILE: src/backend/web-gl2/kernel-value-maps.js
  function lookupKernelValueType (line 180) | function lookupKernelValueType(type, dynamic, precision, value) {

FILE: src/backend/web-gl2/kernel-value/array2.js
  class WebGL2KernelValueArray2 (line 3) | class WebGL2KernelValueArray2 extends WebGLKernelValueArray2 {}

FILE: src/backend/web-gl2/kernel-value/array3.js
  class WebGL2KernelValueArray3 (line 3) | class WebGL2KernelValueArray3 extends WebGLKernelValueArray3 {}

FILE: src/backend/web-gl2/kernel-value/array4.js
  class WebGL2KernelValueArray4 (line 3) | class WebGL2KernelValueArray4 extends WebGLKernelValueArray4 {}

FILE: src/backend/web-gl2/kernel-value/boolean.js
  class WebGL2KernelValueBoolean (line 3) | class WebGL2KernelValueBoolean extends WebGLKernelValueBoolean {}

FILE: src/backend/web-gl2/kernel-value/dynamic-html-image-array.js
  class WebGL2KernelValueDynamicHTMLImageArray (line 4) | class WebGL2KernelValueDynamicHTMLImageArray extends WebGL2KernelValueHT...
    method getSource (line 5) | getSource() {
    method updateValue (line 14) | updateValue(images) {

FILE: src/backend/web-gl2/kernel-value/dynamic-html-image.js
  class WebGL2KernelValueDynamicHTMLImage (line 4) | class WebGL2KernelValueDynamicHTMLImage extends WebGLKernelValueDynamicH...
    method getSource (line 5) | getSource() {

FILE: src/backend/web-gl2/kernel-value/dynamic-html-video.js
  class WebGL2KernelValueDynamicHTMLVideo (line 4) | class WebGL2KernelValueDynamicHTMLVideo extends WebGL2KernelValueDynamic...

FILE: src/backend/web-gl2/kernel-value/dynamic-memory-optimized-number-texture.js
  class WebGL2KernelValueDynamicMemoryOptimizedNumberTexture (line 4) | class WebGL2KernelValueDynamicMemoryOptimizedNumberTexture extends WebGL...
    method getSource (line 5) | getSource() {

FILE: src/backend/web-gl2/kernel-value/dynamic-number-texture.js
  class WebGL2KernelValueDynamicNumberTexture (line 4) | class WebGL2KernelValueDynamicNumberTexture extends WebGLKernelValueDyna...
    method getSource (line 5) | getSource() {

FILE: src/backend/web-gl2/kernel-value/dynamic-single-array.js
  class WebGL2KernelValueDynamicSingleArray (line 4) | class WebGL2KernelValueDynamicSingleArray extends WebGL2KernelValueSingl...
    method getSource (line 5) | getSource() {
    method updateValue (line 14) | updateValue(value) {

FILE: src/backend/web-gl2/kernel-value/dynamic-single-array1d-i.js
  class WebGL2KernelValueDynamicSingleArray1DI (line 4) | class WebGL2KernelValueDynamicSingleArray1DI extends WebGL2KernelValueSi...
    method getSource (line 5) | getSource() {
    method updateValue (line 14) | updateValue(value) {

FILE: src/backend/web-gl2/kernel-value/dynamic-single-array2d-i.js
  class WebGL2KernelValueDynamicSingleArray2DI (line 4) | class WebGL2KernelValueDynamicSingleArray2DI extends WebGL2KernelValueSi...
    method getSource (line 5) | getSource() {
    method updateValue (line 14) | updateValue(value) {

FILE: src/backend/web-gl2/kernel-value/dynamic-single-array3d-i.js
  class WebGL2KernelValueDynamicSingleArray3DI (line 4) | class WebGL2KernelValueDynamicSingleArray3DI extends WebGL2KernelValueSi...
    method getSource (line 5) | getSource() {
    method updateValue (line 14) | updateValue(value) {

FILE: src/backend/web-gl2/kernel-value/dynamic-single-input.js
  class WebGL2KernelValueDynamicSingleInput (line 4) | class WebGL2KernelValueDynamicSingleInput extends WebGL2KernelValueSingl...
    method getSource (line 5) | getSource() {
    method updateValue (line 14) | updateValue(value) {

FILE: src/backend/web-gl2/kernel-value/dynamic-unsigned-array.js
  class WebGL2KernelValueDynamicUnsignedArray (line 4) | class WebGL2KernelValueDynamicUnsignedArray extends WebGLKernelValueDyna...
    method getSource (line 5) | getSource() {

FILE: src/backend/web-gl2/kernel-value/dynamic-unsigned-input.js
  class WebGL2KernelValueDynamicUnsignedInput (line 4) | class WebGL2KernelValueDynamicUnsignedInput extends WebGLKernelValueDyna...
    method getSource (line 5) | getSource() {

FILE: src/backend/web-gl2/kernel-value/float.js
  class WebGL2KernelValueFloat (line 4) | class WebGL2KernelValueFloat extends WebGLKernelValueFloat {}

FILE: src/backend/web-gl2/kernel-value/html-image-array.js
  class WebGL2KernelValueHTMLImageArray (line 4) | class WebGL2KernelValueHTMLImageArray extends WebGLKernelArray {
    method constructor (line 5) | constructor(value, settings) {
    method defineTexture (line 11) | defineTexture() {
    method getStringValueHandler (line 19) | getStringValueHandler() {
    method getSource (line 22) | getSource() {
    method updateValue (line 31) | updateValue(images) {

FILE: src/backend/web-gl2/kernel-value/html-image.js
  class WebGL2KernelValueHTMLImage (line 4) | class WebGL2KernelValueHTMLImage extends WebGLKernelValueHTMLImage {
    method getSource (line 5) | getSource() {

FILE: src/backend/web-gl2/kernel-value/html-video.js
  class WebGL2KernelValueHTMLVideo (line 4) | class WebGL2KernelValueHTMLVideo extends WebGL2KernelValueHTMLImage {}

FILE: src/backend/web-gl2/kernel-value/integer.js
  class WebGL2KernelValueInteger (line 3) | class WebGL2KernelValueInteger extends WebGLKernelValueInteger {
    method getSource (line 4) | getSource(value) {
    method updateValue (line 12) | updateValue(value) {

FILE: src/backend/web-gl2/kernel-value/memory-optimized-number-texture.js
  class WebGL2KernelValueMemoryOptimizedNumberTexture (line 4) | class WebGL2KernelValueMemoryOptimizedNumberTexture extends WebGLKernelV...
    method getSource (line 5) | getSource() {

FILE: src/backend/web-gl2/kernel-value/number-texture.js
  class WebGL2KernelValueNumberTexture (line 4) | class WebGL2KernelValueNumberTexture extends WebGLKernelValueNumberTextu...
    method getSource (line 5) | getSource() {

FILE: src/backend/web-gl2/kernel-value/single-array.js
  class WebGL2KernelValueSingleArray (line 4) | class WebGL2KernelValueSingleArray extends WebGLKernelValueSingleArray {
    method getSource (line 5) | getSource() {
    method updateValue (line 14) | updateValue(value) {

FILE: src/backend/web-gl2/kernel-value/single-array1d-i.js
  class WebGL2KernelValueSingleArray1DI (line 4) | class WebGL2KernelValueSingleArray1DI extends WebGLKernelValueSingleArra...
    method updateValue (line 5) | updateValue(value) {

FILE: src/backend/web-gl2/kernel-value/single-array2d-i.js
  class WebGL2KernelValueSingleArray2DI (line 4) | class WebGL2KernelValueSingleArray2DI extends WebGLKernelValueSingleArra...
    method updateValue (line 5) | updateValue(value) {

FILE: src/backend/web-gl2/kernel-value/single-array3d-i.js
  class WebGL2KernelValueSingleArray3DI (line 4) | class WebGL2KernelValueSingleArray3DI extends WebGLKernelValueSingleArra...
    method updateValue (line 5) | updateValue(value) {

FILE: src/backend/web-gl2/kernel-value/single-input.js
  class WebGL2KernelValueSingleInput (line 4) | class WebGL2KernelValueSingleInput extends WebGLKernelValueSingleInput {
    method getSource (line 5) | getSource() {
    method updateValue (line 14) | updateValue(input) {

FILE: src/backend/web-gl2/kernel-value/unsigned-array.js
  class WebGL2KernelValueUnsignedArray (line 4) | class WebGL2KernelValueUnsignedArray extends WebGLKernelValueUnsignedArr...
    method getSource (line 5) | getSource() {

FILE: src/backend/web-gl2/kernel-value/unsigned-input.js
  class WebGL2KernelValueUnsignedInput (line 4) | class WebGL2KernelValueUnsignedInput extends WebGLKernelValueUnsignedInp...
    method getSource (line 5) | getSource() {

FILE: src/backend/web-gl2/kernel.js
  class WebGL2Kernel (line 31) | class WebGL2Kernel extends WebGLKernel {
    method isSupported (line 32) | static get isSupported() {
    method setupFeatureChecks (line 41) | static setupFeatureChecks() {
    method isContextMatch (line 57) | static isContextMatch(context) {
    method getFeatures (line 69) | static getFeatures() {
    method getIsTextureFloat (line 89) | static getIsTextureFloat() {
    method getChannelCount (line 93) | static getChannelCount() {
    method getMaxTextureSize (line 97) | static getMaxTextureSize() {
    method lookupKernelValueType (line 101) | static lookupKernelValueType(type, dynamic, precision, value) {
    method testCanvas (line 105) | static get testCanvas() {
    method testContext (line 109) | static get testContext() {
    method features (line 117) | static get features() {
    method fragmentShader (line 121) | static get fragmentShader() {
    method vertexShader (line 124) | static get vertexShader() {
    method initContext (line 132) | initContext() {
    method initExtensions (line 141) | initExtensions() {
    method validateSettings (line 152) | validateSettings(args) {
    method translateSource (line 223) | translateSource() {
    method drawBuffers (line 231) | drawBuffers() {
    method getTextureFormat (line 235) | getTextureFormat() {
    method getInternalFormat (line 250) | getInternalFormat() {
    method _setupOutputTexture (line 278) | _setupOutputTexture() {
    method _setupSubOutputTextures (line 313) | _setupSubOutputTextures() {
    method _getHeaderString (line 364) | _getHeaderString() {
    method _getTextureCoordinate (line 372) | _getTextureCoordinate() {
    method _getMainArgumentsString (line 387) | _getMainArgumentsString(args) {
    method getKernelString (line 400) | getKernelString() {
    method getMainResultGraphical (line 455) | getMainResultGraphical() {
    method getMainResultPackedPixels (line 463) | getMainResultPackedPixels() {
    method getMainResultKernelPackedPixels (line 479) | getMainResultKernelPackedPixels() {
    method getMainResultSubKernelPackedPixels (line 490) | getMainResultSubKernelPackedPixels() {
    method getMainResultKernelMemoryOptimizedFloats (line 508) | getMainResultKernelMemoryOptimizedFloats(result, channel) {
    method getMainResultSubKernelMemoryOptimizedFloats (line 516) | getMainResultSubKernelMemoryOptimizedFloats(result, channel) {
    method getMainResultKernelNumberTexture (line 532) | getMainResultKernelNumberTexture() {
    method getMainResultSubKernelNumberTexture (line 540) | getMainResultSubKernelNumberTexture() {
    method getMainResultKernelArray2Texture (line 558) | getMainResultKernelArray2Texture() {
    method getMainResultSubKernelArray2Texture (line 567) | getMainResultSubKernelArray2Texture() {
    method getMainResultKernelArray3Texture (line 580) | getMainResultKernelArray3Texture() {
    method getMainResultSubKernelArray3Texture (line 590) | getMainResultSubKernelArray3Texture() {
    method getMainResultKernelArray4Texture (line 604) | getMainResultKernelArray4Texture() {
    method getMainResultSubKernelArray4Texture (line 612) | getMainResultSubKernelArray4Texture() {
    method destroyExtensions (line 623) | destroyExtensions() {
    method toJSON (line 631) | toJSON() {

FILE: src/browser.js
  constant GPU (line 2) | const GPU = lib.GPU;
  function bindTo (line 16) | function bindTo(target) {

FILE: src/gpu.js
  class GPU (line 36) | class GPU {
    method disableValidation (line 37) | static disableValidation() {
    method enableValidation (line 41) | static enableValidation() {
    method isGPUSupported (line 45) | static get isGPUSupported() {
    method isKernelMapSupported (line 53) | static get isKernelMapSupported() {
    method isOffscreenCanvasSupported (line 60) | static get isOffscreenCanvasSupported() {
    method isWebGLSupported (line 67) | static get isWebGLSupported() {
    method isWebGL2Supported (line 74) | static get isWebGL2Supported() {
    method isHeadlessGLSupported (line 81) | static get isHeadlessGLSupported() {
    method isCanvasSupported (line 89) | static get isCanvasSupported() {
    method isGPUHTMLImageArraySupported (line 96) | static get isGPUHTMLImageArraySupported() {
    method isSinglePrecisionSupported (line 104) | static get isSinglePrecisionSupported() {
    method constructor (line 113) | constructor(settings) {
    method chooseKernel (line 146) | chooseKernel() {
    method createKernel (line 211) | createKernel(source, settings) {
    method createKernelMap (line 393) | createKernelMap() {
    method combineKernels (line 468) | combineKernels() {
    method setFunctions (line 491) | setFunctions(functions) {
    method setNativeFunctions (line 496) | setNativeFunctions(nativeFunctions) {
    method addFunction (line 507) | addFunction(source, settings) {
    method addNativeFunction (line 519) | addNativeFunction(name, source, settings) {
    method injectNative (line 532) | injectNative(source) {
    method destroy (line 543) | destroy() {
  function upgradeDeprecatedCreateKernelSettings (line 576) | function upgradeDeprecatedCreateKernelSettings(settings) {

FILE: src/index.d.ts
  class GPU (line 1) | class GPU {
  type ISubKernelObject (line 52) | interface ISubKernelObject {
  type ISubKernelArray (line 58) | interface ISubKernelArray {
  type ISubKernelsResults (line 64) | interface ISubKernelsResults {
  type IGPUFunction (line 68) | interface IGPUFunction extends IFunctionSettings {
  type IGPUNativeFunction (line 72) | interface IGPUNativeFunction extends IGPUFunctionSettings {
  type IMappedKernelResult (line 77) | interface IMappedKernelResult {
  type INativeFunction (line 82) | interface INativeFunction extends IGPUFunctionSettings {
  type IInternalNativeFunction (line 87) | interface IInternalNativeFunction extends IArgumentTypes {
  type INativeFunctionList (line 92) | interface INativeFunctionList {
  type GPUMode (line 96) | type GPUMode = 'gpu' | 'cpu' | 'dev';
  type GPUInternalMode (line 97) | type GPUInternalMode = 'webgl' | 'webgl2' | 'headlessgl';
  type IGPUSettings (line 99) | interface IGPUSettings {
  type GPUVariableType (line 108) | type GPUVariableType
  type GPUTextureType (line 131) | type GPUTextureType
  type IGPUArgumentTypes (line 135) | interface IGPUArgumentTypes {
  type IGPUFunctionSettings (line 139) | interface IGPUFunctionSettings {
  class Kernel (line 144) | class Kernel {
  type GPUFunction (line 236) | type GPUFunction<ArgTypes extends ThreadKernelVariable[] = ThreadKernelV...
  type ThreadFunction (line 242) | type ThreadFunction<ArgTypes extends ThreadKernelVariable[] = ThreadKern...
  type Precision (line 245) | type Precision = 'single' | 'unsigned';
  class CPUKernel (line 247) | class CPUKernel extends Kernel {
  class GLKernel (line 250) | class GLKernel extends Kernel {
  class WebGLKernel (line 253) | class WebGLKernel extends GLKernel {
  class WebGL2Kernel (line 256) | class WebGL2Kernel extends WebGLKernel {
  class HeadlessGLKernel (line 259) | class HeadlessGLKernel extends WebGLKernel {
  type IArgumentTypes (line 263) | interface IArgumentTypes {
  type IConstants (line 268) | interface IConstants {
  type IKernelValueTypes (line 272) | interface IKernelValueTypes {
  type IWebGLKernelValueSettings (line 276) | interface IWebGLKernelValueSettings extends IKernelValueSettings {
  type IKernelValueSettings (line 283) | interface IKernelValueSettings {
  type Tactic (line 299) | type Tactic = 'speed' | 'balanced' | 'precision';
  type IConstantsThis (line 301) | interface IConstantsThis {
  type IKernelXYZ (line 305) | interface IKernelXYZ {
  type FunctionList (line 311) | interface FunctionList {
  type IGPUKernelSettings (line 315) | interface IGPUKernelSettings extends IKernelSettings {
  type IKernelSettings (line 322) | interface IKernelSettings {
  type IDirectKernelSettings (line 342) | interface IDirectKernelSettings extends IKernelSettings {
  type ITypesList (line 347) | interface ITypesList {
  type IKernelRunShortcutBase (line 351) | interface IKernelRunShortcutBase<T = KernelOutput> extends Kernel {
  type IKernelRunShortcut (line 357) | interface IKernelRunShortcut extends IKernelRunShortcutBase {
  type IKernelMapRunShortcut (line 361) | interface IKernelMapRunShortcut<SubKernelType> extends IKernelRunShortcu...
  type IKernelFeatures (line 364) | interface IKernelFeatures {
  type IKernelFunctionThis (line 381) | interface IKernelFunctionThis<ConstantsT = {}> {
  type KernelVariable (line 391) | type KernelVariable =
  type ThreadFunctionResult (line 410) | type ThreadFunctionResult
  type ThreadKernelVariable (line 420) | type ThreadKernelVariable
  type Pixel (line 450) | type Pixel = {
  type KernelFunction (line 462) | interface KernelFunction<ArgT extends ThreadKernelVariable[] = ThreadKer...
  type KernelOutput (line 469) | type KernelOutput = void
  type IFunction (line 493) | interface IFunction {
  type IFunctionSettings (line 498) | interface IFunctionSettings {
  type ISubKernel (line 521) | interface ISubKernel {
  class FunctionBuilder (line 529) | class FunctionBuilder {
  type IFunctionBuilderSettings (line 541) | interface IFunctionBuilderSettings {
  class FunctionNode (line 550) | class FunctionNode implements IFunctionSettings {
  type IFunctionNodeSettings (line 554) | interface IFunctionNodeSettings extends IFunctionSettings {
  class WebGLFunctionNode (line 558) | class WebGLFunctionNode extends FunctionNode {}
  class WebGL2FunctionNode (line 559) | class WebGL2FunctionNode extends WebGLFunctionNode {}
  class CPUFunctionNode (line 560) | class CPUFunctionNode extends FunctionNode {}
  type IGPUTextureSettings (line 562) | interface IGPUTextureSettings {
  class Texture (line 573) | class Texture {
  type TextureArrayOutput (line 582) | type TextureArrayOutput
  type IPlugin (line 604) | interface IPlugin {
  type OutputDimensions (line 613) | type OutputDimensions = [number] | [number, number] | [number, number, n...
  type TextureDimensions (line 614) | type TextureDimensions = [number, number];
  class Input (line 616) | class Input {
  type input (line 622) | type input = (value: number[], size: OutputDimensions) => Input;
  class KernelValue (line 626) | class KernelValue {
  class WebGLKernelValue (line 633) | class WebGLKernelValue {
  type IFunctionNodeMemberExpressionDetails (line 637) | interface IFunctionNodeMemberExpressionDetails {
  type IKernelJSON (line 647) | interface IKernelJSON {
  type IJSONSettings (line 652) | interface IJSONSettings {
  type IReason (line 668) | interface IReason {
  type IDeclaration (line 673) | interface IDeclaration {

FILE: src/input.js
  class Input (line 1) | class Input {
    method constructor (line 2) | constructor(value, size) {
    method toArray (line 34) | toArray() {
  function input (line 47) | function input(value, size) {

FILE: src/kernel-run-shortcut.js
  function kernelRunShortcut (line 8) | function kernelRunShortcut(kernel) {
  function bindKernelToShortcut (line 54) | function bindKernelToShortcut(kernel, shortcut) {

FILE: src/texture.js
  class Texture (line 5) | class Texture {
    method constructor (line 6) | constructor(settings) {
    method toArray (line 46) | toArray() {
    method clone (line 54) | clone() {
    method delete (line 61) | delete() {
    method clear (line 65) | clear() {

FILE: src/utils.js
  constant FUNCTION_NAME (line 5) | const FUNCTION_NAME = /function ([^(]*)/;
  constant STRIP_COMMENTS (line 6) | const STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
  constant ARGUMENT_NAMES (line 7) | const ARGUMENT_NAMES = /([^\s,]+)/g;
  method systemEndianness (line 22) | systemEndianness() {
  method getSystemEndianness (line 25) | getSystemEndianness() {
  method isFunction (line 40) | isFunction(funcObj) {
  method isFunctionString (line 51) | isFunctionString(fn) {
  method getFunctionNameFromString (line 65) | getFunctionNameFromString(funcStr) {
  method getFunctionBodyFromString (line 71) | getFunctionBodyFromString(funcStr) {
  method getArgumentNamesFromString (line 80) | getArgumentNamesFromString(fn) {
  method clone (line 94) | clone(obj) {
  method isArray (line 115) | isArray(array) {
  method getVariableType (line 125) | getVariableType(value, strictIntegers) {
  method getKernelTextureSize (line 167) | getKernelTextureSize(settings, dimensions) {
  method closestSquareDimensions (line 186) | closestSquareDimensions(length) {
  method getMemoryOptimizedFloatTextureSize (line 203) | getMemoryOptimizedFloatTextureSize(dimensions, bitRatio) {
  method getMemoryOptimizedPackedTextureSize (line 215) | getMemoryOptimizedPackedTextureSize(dimensions, bitRatio) {
  method roundTo (line 222) | roundTo(n, d) {
  method getDimensions (line 231) | getDimensions(x, pad) {
  method flatten2dArrayTo (line 264) | flatten2dArrayTo(array, target) {
  method flatten3dArrayTo (line 277) | flatten3dArrayTo(array, target) {
  method flatten4dArrayTo (line 292) | flatten4dArrayTo(array, target) {
  method flattenTo (line 309) | flattenTo(array, target) {
  method splitArray (line 335) | splitArray(array, part) {
  method getAstString (line 343) | getAstString(source, ast) {
  method allPropertiesOf (line 360) | allPropertiesOf(obj) {
  method linesToString (line 374) | linesToString(lines) {
  method warnDeprecated (line 381) | warnDeprecated(type, oldName, newName) {
  function flatten (line 637) | function flatten(ast) {

FILE: test/benchmark.js
  function randomMatrix (line 12) | function randomMatrix(width, height) {

FILE: test/browser-test-utils.js
  function imageToArray (line 1) | function imageToArray(image) {
  function loadImage (line 30) | function loadImage(image) {
  function loadImages (line 43) | function loadImages(images) {
  function check2DImage (line 47) | function check2DImage(result, expected, channel) {
  function greenCanvas (line 60) | function greenCanvas(mode, width, height) {

FILE: test/features/add-custom-function.js
Condensed preview — 432 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3,207K chars).
[
  {
    "path": ".gitignore",
    "chars": 421,
    "preview": "# Logs\nlogs\n*.log\nnpm-debug.log*\n\n# Runtime data\npids\n*.pid\n*.seed\n\n# Directory for instrumented libs generated by jscov"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 636,
    "preview": "Thanks for taking the time to contribute to gpu.js. Follow these guidelines to make the process smoother:\n\n1. One featur"
  },
  {
    "path": "ISSUE_TEMPLATE.md",
    "chars": 645,
    "preview": "<!-- If you don't mind add a fun gif or meme, but no pressure -->\n![A GIF or MEME to give some spice of the internet](ur"
  },
  {
    "path": "LICENSE",
    "chars": 1072,
    "preview": "The MIT License\n\nCopyright (c) 2019 gpu.js Team\n\nPermission is hereby granted, free of charge, to any person obtaining a"
  },
  {
    "path": "README.md",
    "chars": 46971,
    "preview": "[<img width=\"100\" alt=\"Logo\" src=\"http://gpu.rocks/static/media/jelly.3587de60.png\">](http://gpu.rocks/)\n# GPU.js\nGPU.js"
  },
  {
    "path": "dist/gpu-browser-core.js",
    "chars": 480659,
    "preview": "/**\n * gpu.js\n * http://gpu.rocks/\n *\n * GPU Accelerated JavaScript\n *\n * @version 2.16.0\n * @date Thu Feb 13 2025 11:46"
  },
  {
    "path": "dist/gpu-browser.js",
    "chars": 677402,
    "preview": "/**\n * gpu.js\n * http://gpu.rocks/\n *\n * GPU Accelerated JavaScript\n *\n * @version 2.16.0\n * @date Thu Feb 13 2025 11:46"
  },
  {
    "path": "examples/advanced-typescript.ts",
    "chars": 1562,
    "preview": "/**\n * This is an arbitrary example (overly complex with types for overly simplified kernel) to show type inheritance\n *"
  },
  {
    "path": "examples/cat-image/index.html",
    "chars": 2065,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\">\n  <title>Cat image with GPU.js</title>\n  <script src=\"."
  },
  {
    "path": "examples/fluid.html",
    "chars": 35914,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\">\n  <title>SSPS - Chadams Studios (slightly upgraded)</ti"
  },
  {
    "path": "examples/internal-variable-precision.html",
    "chars": 1429,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\">\n  <title>GPU.js Internal Variable Precision</title>\n</h"
  },
  {
    "path": "examples/json-saving.js",
    "chars": 492,
    "preview": "const { GPU } = require('../src');\nconst gpu1 = new GPU();\n\nconst kernel1 = gpu1.createKernel(function(value) {\n  return"
  },
  {
    "path": "examples/mandelbrot-set.html",
    "chars": 3172,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<script src=\"../dist/gpu-browser.min.js\"></script>\n<style>\n  body {\n    text-align: cen"
  },
  {
    "path": "examples/mandelbulb.html",
    "chars": 16805,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\">\n  <meta name=\"viewport\" content=\"width=device-width, in"
  },
  {
    "path": "examples/parallel-raytracer.html",
    "chars": 44850,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\">\n  <meta name=\"viewport\" content=\"width=device-width\">\n "
  },
  {
    "path": "examples/random.html",
    "chars": 1492,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\">\n  <title>GPU.js Random Examples</title>\n</head>\n<body>\n"
  },
  {
    "path": "examples/raster-globe/index.html",
    "chars": 4243,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\">\n  <title>Raster projection with GPU.js</title>\n  <scrip"
  },
  {
    "path": "examples/raytracer.html",
    "chars": 19321,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\">\n  <meta name=\"viewport\" content=\"width=device-width ini"
  },
  {
    "path": "examples/simple-javascript.js",
    "chars": 422,
    "preview": "const { GPU } = require('../src');\n\nconst gpu = new GPU({ mode: 'gpu' });\n\n// Look ma! I can javascript on my GPU!\nfunct"
  },
  {
    "path": "examples/simple-typescript.ts",
    "chars": 527,
    "preview": "import { GPU, KernelFunction, IKernelRunShortcut } from '../src';\n\nconst gpu = new GPU({ mode: 'gpu' });\n\n// Look ma! I "
  },
  {
    "path": "examples/slow-fade.html",
    "chars": 935,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\">\n  <title>Slow Fade</title>\n</head>\n<body>\n  <h1>Slow Fa"
  },
  {
    "path": "examples/video/index.html",
    "chars": 3182,
    "preview": "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\">\n  <title>Video input with GPU.js</title>\n  <script src="
  },
  {
    "path": "gulpfile.js",
    "chars": 3695,
    "preview": "const fs = require('fs');\nconst gulp = require('gulp');\nconst rename = require('gulp-rename');\nconst header = require('g"
  },
  {
    "path": "package.json",
    "chars": 1745,
    "preview": "{\n  \"name\": \"gpu.js\",\n  \"version\": \"2.16.0\",\n  \"description\": \"GPU Accelerated JavaScript\",\n  \"engines\": {\n    \"node\": \""
  },
  {
    "path": "src/alias.js",
    "chars": 374,
    "preview": "const { utils } = require('./utils');\n\n/**\n *\n * @param name\n * @param source\n * @returns {Function}\n */\nfunction alias("
  },
  {
    "path": "src/backend/cpu/function-node.js",
    "chars": 19280,
    "preview": "const { FunctionNode } = require('../function-node');\n\n/**\n * @desc [INTERNAL] Represents a single function, inside JS\n "
  },
  {
    "path": "src/backend/cpu/kernel-string.js",
    "chars": 5758,
    "preview": "const { utils } = require('../../utils');\n\nfunction constantsToString(constants, types) {\n  const results = [];\n  for (c"
  },
  {
    "path": "src/backend/cpu/kernel.js",
    "chars": 21742,
    "preview": "const { Kernel } = require('../kernel');\nconst { FunctionBuilder } = require('../function-builder');\nconst { CPUFunction"
  },
  {
    "path": "src/backend/function-builder.js",
    "chars": 20466,
    "preview": "/**\n * @desc This handles all the raw state, converted state, etc. of a single function.\n * [INTERNAL] A collection of f"
  },
  {
    "path": "src/backend/function-node.js",
    "chars": 46431,
    "preview": "const acorn = require('acorn');\nconst { utils } = require('../utils');\nconst { FunctionTracer } = require('./function-tr"
  },
  {
    "path": "src/backend/function-tracer.js",
    "chars": 8346,
    "preview": "const { utils } = require('../utils');\n\nfunction last(array) {\n  return array.length > 0 ? array[array.length - 1] : nul"
  },
  {
    "path": "src/backend/gl/kernel-string.js",
    "chars": 12221,
    "preview": "const { glWiretap } = require('gl-wiretap');\nconst { utils } = require('../../utils');\n\nfunction toStringWithoutUtils(fn"
  },
  {
    "path": "src/backend/gl/kernel.js",
    "chars": 33887,
    "preview": "const { Kernel } = require('../kernel');\nconst { utils } = require('../../utils');\nconst { GLTextureArray2Float } = requ"
  },
  {
    "path": "src/backend/gl/texture/array-2-float-2d.js",
    "chars": 385,
    "preview": "const { utils } = require('../../../utils');\nconst { GLTextureFloat } = require('./float');\n\nclass GLTextureArray2Float2"
  },
  {
    "path": "src/backend/gl/texture/array-2-float-3d.js",
    "chars": 401,
    "preview": "const { utils } = require('../../../utils');\nconst { GLTextureFloat } = require('./float');\n\nclass GLTextureArray2Float3"
  },
  {
    "path": "src/backend/gl/texture/array-2-float.js",
    "chars": 379,
    "preview": "const { utils } = require('../../../utils');\nconst { GLTextureFloat } = require('./float');\n\nclass GLTextureArray2Float "
  },
  {
    "path": "src/backend/gl/texture/array-3-float-2d.js",
    "chars": 385,
    "preview": "const { utils } = require('../../../utils');\nconst { GLTextureFloat } = require('./float');\n\nclass GLTextureArray3Float2"
  },
  {
    "path": "src/backend/gl/texture/array-3-float-3d.js",
    "chars": 401,
    "preview": "const { utils } = require('../../../utils');\nconst { GLTextureFloat } = require('./float');\n\nclass GLTextureArray3Float3"
  },
  {
    "path": "src/backend/gl/texture/array-3-float.js",
    "chars": 363,
    "preview": "const { utils } = require('../../../utils');\nconst { GLTextureFloat } = require('./float');\n\nclass GLTextureArray3Float "
  },
  {
    "path": "src/backend/gl/texture/array-4-float-2d.js",
    "chars": 385,
    "preview": "const { utils } = require('../../../utils');\nconst { GLTextureFloat } = require('./float');\n\nclass GLTextureArray4Float2"
  },
  {
    "path": "src/backend/gl/texture/array-4-float-3d.js",
    "chars": 401,
    "preview": "const { utils } = require('../../../utils');\nconst { GLTextureFloat } = require('./float');\n\nclass GLTextureArray4Float3"
  },
  {
    "path": "src/backend/gl/texture/array-4-float.js",
    "chars": 363,
    "preview": "const { utils } = require('../../../utils');\nconst { GLTextureFloat } = require('./float');\n\nclass GLTextureArray4Float "
  },
  {
    "path": "src/backend/gl/texture/float-2d.js",
    "chars": 372,
    "preview": "const { utils } = require('../../../utils');\nconst { GLTextureFloat } = require('./float');\n\nclass GLTextureFloat2D exte"
  },
  {
    "path": "src/backend/gl/texture/float-3d.js",
    "chars": 388,
    "preview": "const { utils } = require('../../../utils');\nconst { GLTextureFloat } = require('./float');\n\nclass GLTextureFloat3D exte"
  },
  {
    "path": "src/backend/gl/texture/float.js",
    "chars": 918,
    "preview": "const { utils } = require('../../../utils');\nconst { GLTexture } = require('./index');\n\nclass GLTextureFloat extends GLT"
  },
  {
    "path": "src/backend/gl/texture/graphical.js",
    "chars": 288,
    "preview": "const { GLTextureUnsigned } = require('./unsigned');\n\nclass GLTextureGraphical extends GLTextureUnsigned {\n  constructor"
  },
  {
    "path": "src/backend/gl/texture/index.js",
    "chars": 3670,
    "preview": "const { Texture } = require('../../../texture');\n\n/**\n * @class\n * @property framebuffer\n * @extends Texture\n */\nclass G"
  },
  {
    "path": "src/backend/gl/texture/memory-optimized-2d.js",
    "chars": 420,
    "preview": "const { utils } = require('../../../utils');\nconst { GLTextureFloat } = require('./float');\n\nclass GLTextureMemoryOptimi"
  },
  {
    "path": "src/backend/gl/texture/memory-optimized-3d.js",
    "chars": 436,
    "preview": "const { utils } = require('../../../utils');\nconst { GLTextureFloat } = require('./float');\n\nclass GLTextureMemoryOptimi"
  },
  {
    "path": "src/backend/gl/texture/memory-optimized.js",
    "chars": 398,
    "preview": "const { utils } = require('../../../utils');\nconst { GLTextureFloat } = require('./float');\n\nclass GLTextureMemoryOptimi"
  },
  {
    "path": "src/backend/gl/texture/unsigned-2d.js",
    "chars": 391,
    "preview": "const { utils } = require('../../../utils');\nconst { GLTextureUnsigned } = require('./unsigned');\n\nclass GLTextureUnsign"
  },
  {
    "path": "src/backend/gl/texture/unsigned-3d.js",
    "chars": 407,
    "preview": "const { utils } = require('../../../utils');\nconst { GLTextureUnsigned } = require('./unsigned');\n\nclass GLTextureUnsign"
  },
  {
    "path": "src/backend/gl/texture/unsigned.js",
    "chars": 964,
    "preview": "const { utils } = require('../../../utils');\nconst { GLTexture } = require('./index');\n\nclass GLTextureUnsigned extends "
  },
  {
    "path": "src/backend/headless-gl/kernel.js",
    "chars": 4427,
    "preview": "const getContext = require('gl');\nconst { WebGLKernel } = require('../web-gl/kernel');\nconst { glKernelString } = requir"
  },
  {
    "path": "src/backend/kernel-value.js",
    "chars": 1768,
    "preview": "/**\n * @class KernelValue\n */\nclass KernelValue {\n  /**\n   * @param {KernelVariable} value\n   * @param {IKernelValueSett"
  },
  {
    "path": "src/backend/kernel.js",
    "chars": 22325,
    "preview": "const { utils } = require('../utils');\nconst { Input } = require('../input');\n\nclass Kernel {\n  /**\n   * @type {Boolean}"
  },
  {
    "path": "src/backend/web-gl/fragment-shader.js",
    "chars": 12135,
    "preview": "// language=GLSL\nconst fragmentShader = `__HEADER__;\n__FLOAT_TACTIC_DECLARATION__;\n__INT_TACTIC_DECLARATION__;\n__SAMPLER"
  },
  {
    "path": "src/backend/web-gl/function-node.js",
    "chars": 51900,
    "preview": "const { utils } = require('../../utils');\nconst { FunctionNode } = require('../function-node');\n\n/**\n * @desc [INTERNAL]"
  },
  {
    "path": "src/backend/web-gl/kernel-value/array.js",
    "chars": 2499,
    "preview": "const { WebGLKernelValue } = require('./index');\nconst { Input } = require('../../../input');\n\n/**\n * @abstract\n */\nclas"
  },
  {
    "path": "src/backend/web-gl/kernel-value/array2.js",
    "chars": 766,
    "preview": "const { WebGLKernelValue } = require('./index');\n\nclass WebGLKernelValueArray2 extends WebGLKernelValue {\n  constructor("
  },
  {
    "path": "src/backend/web-gl/kernel-value/array3.js",
    "chars": 778,
    "preview": "const { WebGLKernelValue } = require('./index');\n\nclass WebGLKernelValueArray3 extends WebGLKernelValue {\n  constructor("
  },
  {
    "path": "src/backend/web-gl/kernel-value/array4.js",
    "chars": 790,
    "preview": "const { WebGLKernelValue } = require('./index');\n\nclass WebGLKernelValueArray4 extends WebGLKernelValue {\n  constructor("
  },
  {
    "path": "src/backend/web-gl/kernel-value/boolean.js",
    "chars": 697,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValue } = require('./index');\n\nclass WebGLKernelValueBoo"
  },
  {
    "path": "src/backend/web-gl/kernel-value/dynamic-html-image.js",
    "chars": 765,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValueHTMLImage } = require('./html-image');\n\nclass WebGL"
  },
  {
    "path": "src/backend/web-gl/kernel-value/dynamic-html-video.js",
    "chars": 219,
    "preview": "const { WebGLKernelValueDynamicHTMLImage } = require('./dynamic-html-image');\n\nclass WebGLKernelValueDynamicHTMLVideo ex"
  },
  {
    "path": "src/backend/web-gl/kernel-value/dynamic-memory-optimized-number-texture.js",
    "chars": 875,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValueMemoryOptimizedNumberTexture } = require('./memory-"
  },
  {
    "path": "src/backend/web-gl/kernel-value/dynamic-number-texture.js",
    "chars": 756,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValueNumberTexture } = require('./number-texture');\n\ncla"
  },
  {
    "path": "src/backend/web-gl/kernel-value/dynamic-single-array.js",
    "chars": 989,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValueSingleArray } = require('./single-array');\n\nclass W"
  },
  {
    "path": "src/backend/web-gl/kernel-value/dynamic-single-array1d-i.js",
    "chars": 663,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValueSingleArray1DI } = require('./single-array1d-i');\n\n"
  },
  {
    "path": "src/backend/web-gl/kernel-value/dynamic-single-array2d-i.js",
    "chars": 663,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValueSingleArray2DI } = require('./single-array2d-i');\n\n"
  },
  {
    "path": "src/backend/web-gl/kernel-value/dynamic-single-array3d-i.js",
    "chars": 663,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValueSingleArray3DI } = require('./single-array3d-i');\n\n"
  },
  {
    "path": "src/backend/web-gl/kernel-value/dynamic-single-input.js",
    "chars": 1029,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValueSingleInput } = require('./single-input');\n\nclass W"
  },
  {
    "path": "src/backend/web-gl/kernel-value/dynamic-unsigned-array.js",
    "chars": 1119,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValueUnsignedArray } = require('./unsigned-array');\n\ncla"
  },
  {
    "path": "src/backend/web-gl/kernel-value/dynamic-unsigned-input.js",
    "chars": 1165,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValueUnsignedInput } = require('./unsigned-input');\n\ncla"
  },
  {
    "path": "src/backend/web-gl/kernel-value/float.js",
    "chars": 796,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValue } = require('./index');\n\nclass WebGLKernelValueFlo"
  },
  {
    "path": "src/backend/web-gl/kernel-value/html-image.js",
    "chars": 1361,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelArray } = require('./array');\n\nclass WebGLKernelValueHTM"
  },
  {
    "path": "src/backend/web-gl/kernel-value/html-video.js",
    "chars": 183,
    "preview": "const { WebGLKernelValueHTMLImage } = require('./html-image');\n\nclass WebGLKernelValueHTMLVideo extends WebGLKernelValue"
  },
  {
    "path": "src/backend/web-gl/kernel-value/index.js",
    "chars": 1788,
    "preview": "const { utils } = require('../../../utils');\nconst { KernelValue } = require('../../kernel-value');\n\nclass WebGLKernelVa"
  },
  {
    "path": "src/backend/web-gl/kernel-value/integer.js",
    "chars": 706,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValue } = require('./index');\n\nclass WebGLKernelValueInt"
  },
  {
    "path": "src/backend/web-gl/kernel-value/memory-optimized-number-texture.js",
    "chars": 2343,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelArray } = require('./array');\n\nconst sameError = `Source"
  },
  {
    "path": "src/backend/web-gl/kernel-value/number-texture.js",
    "chars": 2289,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelArray } = require('./array');\nconst { sameError } = requ"
  },
  {
    "path": "src/backend/web-gl/kernel-value/single-array.js",
    "chars": 1751,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelArray } = require('./array');\n\nclass WebGLKernelValueSin"
  },
  {
    "path": "src/backend/web-gl/kernel-value/single-array1d-i.js",
    "chars": 1887,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelArray } = require('./array');\n\nclass WebGLKernelValueSin"
  },
  {
    "path": "src/backend/web-gl/kernel-value/single-array2d-i.js",
    "chars": 1904,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelArray } = require('./array');\n\nclass WebGLKernelValueSin"
  },
  {
    "path": "src/backend/web-gl/kernel-value/single-array3d-i.js",
    "chars": 1921,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelArray } = require('./array');\n\nclass WebGLKernelValueSin"
  },
  {
    "path": "src/backend/web-gl/kernel-value/single-input.js",
    "chars": 1803,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelArray } = require('./array');\n\nclass WebGLKernelValueSin"
  },
  {
    "path": "src/backend/web-gl/kernel-value/unsigned-array.js",
    "chars": 2052,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelArray } = require('./array');\n\nclass WebGLKernelValueUns"
  },
  {
    "path": "src/backend/web-gl/kernel-value/unsigned-input.js",
    "chars": 2112,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelArray } = require('./array');\n\nclass WebGLKernelValueUns"
  },
  {
    "path": "src/backend/web-gl/kernel-value-maps.js",
    "chars": 8972,
    "preview": "const { WebGLKernelValueBoolean } = require('./kernel-value/boolean');\nconst { WebGLKernelValueFloat } = require('./kern"
  },
  {
    "path": "src/backend/web-gl/kernel.js",
    "chars": 49972,
    "preview": "const { GLKernel } = require('../gl/kernel');\nconst { FunctionBuilder } = require('../function-builder');\nconst { WebGLF"
  },
  {
    "path": "src/backend/web-gl/vertex-shader.js",
    "chars": 375,
    "preview": "// language=GLSL\nconst vertexShader = `__FLOAT_TACTIC_DECLARATION__;\n__INT_TACTIC_DECLARATION__;\n__SAMPLER_2D_TACTIC_DEC"
  },
  {
    "path": "src/backend/web-gl2/fragment-shader.js",
    "chars": 11385,
    "preview": "// language=GLSL\nconst fragmentShader = `#version 300 es\n__HEADER__;\n__FLOAT_TACTIC_DECLARATION__;\n__INT_TACTIC_DECLARAT"
  },
  {
    "path": "src/backend/web-gl2/function-node.js",
    "chars": 1312,
    "preview": "const { utils } = require('../../utils');\nconst { WebGLFunctionNode } = require('../web-gl/function-node');\n\n/**\n * @cla"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/array2.js",
    "chars": 193,
    "preview": "const { WebGLKernelValueArray2 } = require('../../web-gl/kernel-value/array2');\n\nclass WebGL2KernelValueArray2 extends W"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/array3.js",
    "chars": 193,
    "preview": "const { WebGLKernelValueArray3 } = require('../../web-gl/kernel-value/array3');\n\nclass WebGL2KernelValueArray3 extends W"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/array4.js",
    "chars": 193,
    "preview": "const { WebGLKernelValueArray4 } = require('../../web-gl/kernel-value/array4');\n\nclass WebGL2KernelValueArray4 extends W"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/boolean.js",
    "chars": 198,
    "preview": "const { WebGLKernelValueBoolean } = require('../../web-gl/kernel-value/boolean');\n\nclass WebGL2KernelValueBoolean extend"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/dynamic-html-image-array.js",
    "chars": 952,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGL2KernelValueHTMLImageArray } = require('./html-image-array');\n"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/dynamic-html-image.js",
    "chars": 606,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValueDynamicHTMLImage } = require('../../web-gl/kernel-v"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/dynamic-html-video.js",
    "chars": 268,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGL2KernelValueDynamicHTMLImage } = require('./dynamic-html-image"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/dynamic-memory-optimized-number-texture.js",
    "chars": 569,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValueDynamicMemoryOptimizedNumberTexture } = require('.."
  },
  {
    "path": "src/backend/web-gl2/kernel-value/dynamic-number-texture.js",
    "chars": 626,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValueDynamicNumberTexture } = require('../../web-gl/kern"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/dynamic-single-array.js",
    "chars": 1152,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGL2KernelValueSingleArray } = require('../../web-gl2/kernel-valu"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/dynamic-single-array1d-i.js",
    "chars": 826,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGL2KernelValueSingleArray1DI } = require('../../web-gl2/kernel-v"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/dynamic-single-array2d-i.js",
    "chars": 826,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGL2KernelValueSingleArray2DI } = require('../../web-gl2/kernel-v"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/dynamic-single-array3d-i.js",
    "chars": 826,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGL2KernelValueSingleArray3DI } = require('../../web-gl2/kernel-v"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/dynamic-single-input.js",
    "chars": 1192,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGL2KernelValueSingleInput } = require('../../web-gl2/kernel-valu"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/dynamic-unsigned-array.js",
    "chars": 626,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValueDynamicUnsignedArray } = require('../../web-gl/kern"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/dynamic-unsigned-input.js",
    "chars": 626,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValueDynamicUnsignedInput } = require('../../web-gl/kern"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/float.js",
    "chars": 233,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValueFloat } = require('../../web-gl/kernel-value/float'"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/html-image-array.js",
    "chars": 2243,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelArray } = require('../../web-gl/kernel-value/array');\n\nc"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/html-image.js",
    "chars": 687,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValueHTMLImage } = require('../../web-gl/kernel-value/ht"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/html-video.js",
    "chars": 232,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGL2KernelValueHTMLImage } = require('./html-image');\n\nclass WebG"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/integer.js",
    "chars": 621,
    "preview": "const { WebGLKernelValueInteger } = require('../../web-gl/kernel-value/integer');\n\nclass WebGL2KernelValueInteger extend"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/memory-optimized-number-texture.js",
    "chars": 793,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValueMemoryOptimizedNumberTexture } = require('../../web"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/number-texture.js",
    "chars": 739,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValueNumberTexture } = require('../../web-gl/kernel-valu"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/single-array.js",
    "chars": 1264,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValueSingleArray } = require('../../web-gl/kernel-value/"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/single-array1d-i.js",
    "chars": 847,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValueSingleArray1DI } = require('../../web-gl/kernel-val"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/single-array2d-i.js",
    "chars": 847,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValueSingleArray2DI } = require('../../web-gl/kernel-val"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/single-array3d-i.js",
    "chars": 847,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValueSingleArray3DI } = require('../../web-gl/kernel-val"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/single-input.js",
    "chars": 1135,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValueSingleInput } = require('../../web-gl/kernel-value/"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/unsigned-array.js",
    "chars": 707,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValueUnsignedArray } = require('../../web-gl/kernel-valu"
  },
  {
    "path": "src/backend/web-gl2/kernel-value/unsigned-input.js",
    "chars": 707,
    "preview": "const { utils } = require('../../../utils');\nconst { WebGLKernelValueUnsignedInput } = require('../../web-gl/kernel-valu"
  },
  {
    "path": "src/backend/web-gl2/kernel-value-maps.js",
    "chars": 9414,
    "preview": "const { WebGL2KernelValueBoolean } = require('./kernel-value/boolean');\nconst { WebGL2KernelValueFloat } = require('./ke"
  },
  {
    "path": "src/backend/web-gl2/kernel.js",
    "chars": 19595,
    "preview": "const { WebGLKernel } = require('../web-gl/kernel');\nconst { WebGL2FunctionNode } = require('./function-node');\nconst { "
  },
  {
    "path": "src/backend/web-gl2/vertex-shader.js",
    "chars": 373,
    "preview": "// language=GLSL\nconst vertexShader = `#version 300 es\n__FLOAT_TACTIC_DECLARATION__;\n__INT_TACTIC_DECLARATION__;\n__SAMPL"
  },
  {
    "path": "src/browser-header.txt",
    "chars": 256,
    "preview": "/**\n * <%= pkg.name %>\n * <%= pkg.homepage %>\n *\n * <%= pkg.description %>\n *\n * @version <%= pkg.version %>\n * @date <%"
  },
  {
    "path": "src/browser.js",
    "chars": 467,
    "preview": "const lib = require('./index');\nconst GPU = lib.GPU;\nfor (const p in lib) {\n  if (!lib.hasOwnProperty(p)) continue;\n  if"
  },
  {
    "path": "src/gpu.js",
    "chars": 18493,
    "preview": "const { gpuMock } = require('gpu-mock.js');\nconst { utils } = require('./utils');\nconst { Kernel } = require('./backend/"
  },
  {
    "path": "src/index.d.ts",
    "chars": 18627,
    "preview": "export class GPU {\n  static isGPUSupported: boolean;\n  static isCanvasSupported: boolean;\n  static isHeadlessGLSupported"
  },
  {
    "path": "src/index.js",
    "chars": 1594,
    "preview": "const { GPU } = require('./gpu');\nconst { alias } = require('./alias');\nconst { utils } = require('./utils');\nconst { In"
  },
  {
    "path": "src/input.js",
    "chars": 1462,
    "preview": "class Input {\n  constructor(value, size) {\n    this.value = value;\n    if (Array.isArray(size)) {\n      this.size = size"
  },
  {
    "path": "src/kernel-run-shortcut.js",
    "chars": 2456,
    "preview": "const { utils } = require('./utils');\n\n/**\n * Makes kernels easier for mortals (including me)\n * @param kernel\n * @retur"
  },
  {
    "path": "src/plugins/math-random-triangle-noise.js",
    "chars": 1189,
    "preview": "const source = `\nuniform highp float triangle_noise_seed;\nhighp float triangle_noise_shift = 0.000001;\n\n//https://www.sh"
  },
  {
    "path": "src/plugins/math-random-uniformly-distributed.js",
    "chars": 1118,
    "preview": "// language=GLSL\nconst source = `// https://www.shadertoy.com/view/4t2SDh\n//note: uniformly distributed, normalized rand"
  },
  {
    "path": "src/texture.js",
    "chars": 1643,
    "preview": "/**\n * @desc WebGl Texture implementation in JS\n * @param {IGPUTextureSettings} settings\n */\nclass Texture {\n  construct"
  },
  {
    "path": "src/utils.js",
    "chars": 32899,
    "preview": "const acorn = require('acorn');\nconst { Input } = require('./input');\nconst { Texture } = require('./texture');\n\nconst F"
  },
  {
    "path": "test/all-template.html",
    "chars": 1144,
    "preview": "<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"utf-8\">\n  <title>GPU.JS : Test All</title>\n  <link rel=\"stylesheet\" href="
  },
  {
    "path": "test/all.html",
    "chars": 24726,
    "preview": "<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"utf-8\">\n  <title>GPU.JS : Test All</title>\n  <link rel=\"stylesheet\" href="
  },
  {
    "path": "test/benchmark-faster.js",
    "chars": 1307,
    "preview": "const { GPU } = require('../src/index.js');\nconst Benchmark = require('benchmark');\n\nconst suite = new Benchmark.Suite;\n"
  },
  {
    "path": "test/benchmark.js",
    "chars": 1573,
    "preview": "const { GPU } = require('../src/index.js');\nconst Benchmark = require('benchmark');\n\nconst suite = new Benchmark.Suite()"
  },
  {
    "path": "test/browser-test-utils.js",
    "chars": 1993,
    "preview": "function imageToArray(image) {\n  const canvas = document.createElement('canvas');\n  canvas.width = image.width;\n  canvas"
  },
  {
    "path": "test/features/add-custom-function.js",
    "chars": 11079,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/add-custom-native-function.js",
    "chars": 11530,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/add-typed-functions.js",
    "chars": 2703,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/argument-array-types.js",
    "chars": 6874,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/argument-array1d-types.js",
    "chars": 6661,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/argument-array2d-types.js",
    "chars": 9094,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/argument-array3d-types.js",
    "chars": 10696,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/arithmetic-operators.js",
    "chars": 8294,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/assignment-operators.js",
    "chars": 5599,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/basic-math.js",
    "chars": 2237,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/bitwise-operators.js",
    "chars": 17053,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/boolean-from-expression.js",
    "chars": 903,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/canvas.js",
    "chars": 2357,
    "preview": "const { assert, skip, test, module: describe } = require('qunit');\nconst { GPU } = require('../../src');\nconst { greenCa"
  },
  {
    "path": "test/features/clear-textures.js",
    "chars": 2775,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/clone-textures.js",
    "chars": 4807,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/combine-kernels.js",
    "chars": 4506,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/constants-array.js",
    "chars": 922,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/constants-bool.js",
    "chars": 1875,
    "preview": "const { assert, skip, test, module: describe } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe('feat"
  },
  {
    "path": "test/features/constants-canvas.js",
    "chars": 1254,
    "preview": "const { assert, skip, test, module: describe } = require('qunit');\nconst { GPU } = require('../../src');\nconst { greenCa"
  },
  {
    "path": "test/features/constants-float.js",
    "chars": 1113,
    "preview": "const { assert, skip, test, module: describe } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe('feat"
  },
  {
    "path": "test/features/constants-image-array.js",
    "chars": 2018,
    "preview": "const { assert, skip, test, module: describe } = require('qunit');\nconst { GPU, WebGLKernel } = require('../../src');\n\nd"
  },
  {
    "path": "test/features/constants-image.js",
    "chars": 1604,
    "preview": "const { assert, skip, test, module: describe } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe('feat"
  },
  {
    "path": "test/features/constants-integer.js",
    "chars": 1058,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/constants-texture.js",
    "chars": 3310,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/cpu-with-textures.js",
    "chars": 11309,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/create-kernel-map.js",
    "chars": 11621,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU, alias } = require('../../src');\n\nd"
  },
  {
    "path": "test/features/demo.js",
    "chars": 1492,
    "preview": "const { assert, skip, test, module: describe } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe('feat"
  },
  {
    "path": "test/features/destroy.js",
    "chars": 4740,
    "preview": "const { assert, skip, test, module: describe } = require('qunit');\nconst { GPU, WebGLKernel } = require('../../src');\nco"
  },
  {
    "path": "test/features/destructured-assignment.js",
    "chars": 2398,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/dev-mode.js",
    "chars": 4527,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU, input } = require('../../src');\n\nd"
  },
  {
    "path": "test/features/dynamic-arguments.js",
    "chars": 33781,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU, input } = require('../../src');\n\nd"
  },
  {
    "path": "test/features/dynamic-output.js",
    "chars": 23072,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/function-return.js",
    "chars": 5157,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/get-canvas.js",
    "chars": 1594,
    "preview": "const { assert, skip, test, module: describe } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe('get "
  },
  {
    "path": "test/features/get-pixels.js",
    "chars": 4439,
    "preview": "const { assert, test, module: describe, only, skip } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/if-else.js",
    "chars": 2628,
    "preview": "const { assert, skip, test, module: describe } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe('if e"
  },
  {
    "path": "test/features/image-array.js",
    "chars": 13128,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU, CPUKernel } = require('../../src')"
  },
  {
    "path": "test/features/image.js",
    "chars": 1326,
    "preview": "const { assert, skip, test, module: describe } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe('imag"
  },
  {
    "path": "test/features/infinity.js",
    "chars": 2431,
    "preview": "const { assert, skip, test, module: describe } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe('infi"
  },
  {
    "path": "test/features/inject-native.js",
    "chars": 1742,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/input.js",
    "chars": 8169,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU, input } = require('../../src');\n\nd"
  },
  {
    "path": "test/features/internally-defined-matrices.js",
    "chars": 3597,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/json.js",
    "chars": 873,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/legacy-encoder.js",
    "chars": 7725,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU, HeadlessGLKernel, WebGLKernel, Web"
  },
  {
    "path": "test/features/loops.js",
    "chars": 7856,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/math-object.js",
    "chars": 5451,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/nested-function.js",
    "chars": 2102,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/offscreen-canvas.js",
    "chars": 1659,
    "preview": "if (typeof importScripts !== 'undefined') {\n  // inside Worker\n  importScripts('../../dist/gpu-browser.js');\n  onmessage"
  },
  {
    "path": "test/features/optimize-float-memory.js",
    "chars": 11149,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU, utils } = require('../../src');\n\nd"
  },
  {
    "path": "test/features/output.js",
    "chars": 8222,
    "preview": "const { assert, test, module: describe, only, skip } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/promise-api.js",
    "chars": 1319,
    "preview": "const { assert, skip, test, module: describe } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe('feat"
  },
  {
    "path": "test/features/raw-output.js",
    "chars": 3109,
    "preview": "const { assert, skip, test, module: describe } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe('feat"
  },
  {
    "path": "test/features/read-color-texture.js",
    "chars": 5489,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  },
  {
    "path": "test/features/read-from-texture.js",
    "chars": 2535,
    "preview": "const { assert, skip, test, module: describe } = require('qunit');\nconst { GPU, HeadlessGLKernel } = require('../../src'"
  },
  {
    "path": "test/features/read-image-bitmap.js",
    "chars": 1673,
    "preview": "const { assert, skip, test, module: describe } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe('feat"
  },
  {
    "path": "test/features/read-image-data.js",
    "chars": 1393,
    "preview": "const { assert, skip, test, module: describe } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe('feat"
  },
  {
    "path": "test/features/read-offscreen-canvas.js",
    "chars": 1899,
    "preview": "if (typeof importScripts !== 'undefined') {\n  // inside Worker\n  importScripts('../../dist/gpu-browser.js');\n  onmessage"
  },
  {
    "path": "test/features/return-arrays.js",
    "chars": 16797,
    "preview": "const { assert, skip, test, module: describe, only } = require('qunit');\nconst { GPU } = require('../../src');\n\ndescribe"
  }
]

// ... and 232 more files (download for full content)

About this extraction

This page contains the full source code of the gpujs/gpu.js GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 432 files (2.9 MB), approximately 790.0k tokens, and a symbol index with 3246 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!