mirror of
https://github.com/gpujs/gpu.js.git
synced 2025-12-08 20:35:56 +00:00
35 lines
819 B
JavaScript
35 lines
819 B
JavaScript
(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();
|
|
});
|
|
})(); |