This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| C:\Users\Jonathan\Documents\GitHub\brain.js>nvm use 10.0.0 | |
| Now using node v10.0.0 (64-bit) | |
| C:\Users\Jonathan\Documents\GitHub\brain.js>npm i gl | |
| > gl@4.2.2 install C:\Users\Jonathan\Documents\GitHub\brain.js\node_modules\gl | |
| > prebuild-install || node-gyp rebuild | |
| prebuild-install WARN install No prebuilt binaries found (target=10.15.3 runtime=node arch=x64 libc= platform=win32) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| C:\Users\Jonathan\Documents\GitHub\brain.js>npm i | |
| > deasync@0.1.14 install C:\Users\Jonathan\Documents\GitHub\brain.js\node_modules\deasync | |
| > node ./build.js | |
| `win32-x64-node-10` exists; testing | |
| Binary is fine; exiting | |
| > gl@4.2.2 install C:\Users\Jonathan\Documents\GitHub\brain.js\node_modules\gl | |
| > prebuild-install || node-gyp rebuild |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| C:\Users\Jonathan\Documents\GitHub\brain.js>npm install | |
| > gl@4.2.2 install C:\Users\Jonathan\Documents\GitHub\brain.js\node_modules\gl | |
| > prebuild-install || node-gyp rebuild | |
| prebuild-install WARN install No prebuilt binaries found (target=10.15.3 runtime=node arch=x64 libc= platform=win32) | |
| C:\Users\Jonathan\Documents\GitHub\brain.js\node_modules\gl>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild ) | |
| gyp ERR! configure error | |
| gyp ERR! stack Error: Command failed: C:\Users\Jonathan\AppData\Local\Programs\Python\Python37\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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]); | |
| // a set of Textures output by a previous batch, ready for further processing | |
| const inputs = [ 1 : [ 1 : Texture, 2: Texture, /* ... */ 1000: texture ], /* ... */ 1000 : [ 1 : Texture, 2: Texture, /* ... */ 1000: texture ] ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| C:\Users\Jonathan\Documents\GitHub\gpu.js>npm install | |
| npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents): | |
| npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) | |
| npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\chokidar\node_modules\fsevents): | |
| npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) | |
| audited 7280 packages in 5.767s | |
| found 11 vulnerabilities (4 low, 1 moderate, 6 high) | |
| run `npm audit fix` to fix them, or `npm audit` for details |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| C:\Users\Jonathan\Documents\GitHub\gpu.js>npm install | |
| npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents): | |
| npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) | |
| npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\chokidar\node_modules\fsevents): | |
| npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) | |
| audited 7280 packages in 5.767s | |
| found 11 vulnerabilities (4 low, 1 moderate, 6 high) | |
| run `npm audit fix` to fix them, or `npm audit` for details |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const gl = document.createElement('canvas').getContext('webgl'); | |
| gl.canvas.width = 2048; | |
| gl.canvas.width = 2048; | |
| twgl.addExtensionsToContext(gl); | |
| const vs = ` | |
| attribute vec4 position; | |
| void main() { | |
| gl_Position = position; | |
| } | |
| `; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let edge = this.gpu | |
| .createKernel(function(data, channelWidth) { | |
| let threshold = 124; | |
| let remainder = this.thread.x % 4; | |
| let sourceIndex = this.thread.x - remainder; | |
| let x = (sourceIndex % channelWidth) / 4; | |
| let y = Math.floor((sourceIndex / channelWidth) / 4); | |
| let sourceR = data[sourceIndex]; | |
| let sourceG = data[sourceIndex + 1]; | |
| let sourceB = data[sourceIndex + 2]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let edge = this.gpu | |
| .createKernel(function(data, channelWidth) { | |
| let threshold = 124; | |
| let remainder = this.thread.x % 4; | |
| let sourceIndex = this.thread.x - remainder; | |
| let x = (sourceIndex % channelWidth) / 4; | |
| let y = Math.floor((sourceIndex / channelWidth) / 4); | |
| let sourceR = data[sourceIndex]; | |
| let sourceG = data[sourceIndex + 1]; | |
| let sourceB = data[sourceIndex + 2]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let edge = this.gpu | |
| .createKernel(function(data, channelWidth) { | |
| let threshold = 124; | |
| let remainder = this.thread.x % 4; | |
| let sourceIndex = this.thread.x - remainder; | |
| let x = (sourceIndex % channelWidth) / 4; | |
| let y = Math.floor((sourceIndex / channelWidth) / 4); | |
| let sourceR = data[sourceIndex]; | |
| let sourceG = data[sourceIndex + 1]; | |
| let sourceB = data[sourceIndex + 2]; |