forked from gpujs/gpu.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path422-warnings.js
More file actions
37 lines (29 loc) · 841 Bytes
/
422-warnings.js
File metadata and controls
37 lines (29 loc) · 841 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
36
37
const { assert, skip, test, module: describe } = require('qunit');
const { GPU } = require('../../src');
describe('issue #422 - warnings');
function warnings(mode) {
const gpu = new GPU({ mode });
const kernel = gpu.createKernel(function(a, b) {
return a[this.thread.x] + b[this.thread.x];
}).setOutput([10]);
assert.deepEqual(Array.from(kernel([0,1,2,3,4,5,6,7,8,9], [0,1,2,3,4,5,6,7,8,9])), [0,2,4,6,8,10,12,14,16,18]);
gpu.destroy();
}
test('auto', () => {
warnings();
});
test('gpu', () => {
warnings('gpu');
});
(GPU.isWebGLSupported ? test : skip)('webgl', () => {
warnings('webgl');
});
(GPU.isWebGL2Supported ? test : skip)('webgl2', () => {
warnings('webgl2');
});
(GPU.isHeadlessGLSupported ? test : skip)('headlessgl', () => {
warnings('headlessgl');
});
test('cpu', () => {
warnings('cpu');
});