forked from gpujs/gpu.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction-return.js
More file actions
33 lines (28 loc) · 790 Bytes
/
Copy pathfunction-return.js
File metadata and controls
33 lines (28 loc) · 790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
(function() {
function functionReturn( mode ) {
var gpu = new GPU({ mode: mode });
var f = gpu.createKernel(function() {
return 42.0;
}, {
output : [1]
});
QUnit.assert.ok( f !== null, "function generated test");
QUnit.assert.close(f()[0], 42.0, 0.01, "basic return function test");
gpu.destroy();
}
QUnit.test( "functionReturn (auto)", function() {
functionReturn(null);
});
QUnit.test( "functionReturn (gpu)", function() {
functionReturn("gpu");
});
QUnit.test( "functionReturn (webgl)", function() {
functionReturn("webgl");
});
QUnit.test( "functionReturn (webgl2)", function() {
functionReturn("webgl2");
});
QUnit.test( "functionReturn (CPU)", function() {
functionReturn("cpu");
});
})();