forked from fingerecho/gpu.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinfinity.js
More file actions
35 lines (30 loc) · 819 Bytes
/
infinity.js
File metadata and controls
35 lines (30 loc) · 819 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
34
35
(function() {
var gpu;
function input(mode) {
gpu = new GPU({ mode: mode || undefined });
return gpu.createKernel(function() {
return Infinity;
})
.setOutput([1])();
}
QUnit.test( "Infinity (auto)", function() {
QUnit.assert.deepEqual(input()[0], NaN);
gpu.destroy();
});
QUnit.test( "Infinity (cpu)", function() {
QUnit.assert.deepEqual(input('cpu')[0], Infinity);
gpu.destroy();
});
QUnit.test( "Infinity (gpu)", function() {
QUnit.assert.deepEqual(input('gpu')[0], NaN);
gpu.destroy();
});
QUnit.test( "Infinity (webgl)", function() {
QUnit.assert.deepEqual(input('webgl')[0], NaN);
gpu.destroy();
});
QUnit.test( "Infinity (webgl2)", function() {
QUnit.assert.deepEqual(input('webgl2')[0], NaN);
gpu.destroy();
});
})();