FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
gpu.js/examples/json-saving.js at develop · gpujs/gpu.js · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
gpujs
/
gpu.js
Public
Notifications
You must be signed in to change notification settings
Fork
663
Star
15.4k
Code
Issues
64
Pull requests
2
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
gpu.js
/
examples
/
json-saving.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
17 lines (13 loc) · 492 Bytes
Breadcrumbs
gpu.js
/
examples
/
json-saving.js
Copy path
File metadata and controls
17 lines (13 loc) · 492 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const
{
GPU
}
=
require
(
'../src'
)
;
const
gpu1
=
new
GPU
(
)
;
const
kernel1
=
gpu1
.
createKernel
(
function
(
value
)
{
return
value
*
100
;
}
,
{
output
:
[
1
]
}
)
;
const
resultFromRegularKernel
=
kernel1
(
42
)
;
const
json
=
kernel1
.
toJSON
(
)
;
console
.
log
(
resultFromRegularKernel
)
;
// Use bin/gpu-browser-core.js to get "CORE" mode, which works only with JSON
const
gpu2
=
new
GPU
(
)
;
const
kernel2
=
gpu2
.
createKernel
(
json
)
;
const
resultFromJsonKernel
=
kernel2
(
42
)
;
console
.
log
(
resultFromJsonKernel
)
;
Back
|
FazBrowse Home
|
New Git URL