mirror of
https://github.com/gpujs/gpu.js.git
synced 2025-12-08 20:35:56 +00:00
fix: Add `Kernel.features.channelCount` to each kernel, and unit test fix: Was curios for code relating to https://github.com/gpujs/gpu.js/wiki/Quick-Concepts and so added a unit tests for matrix-multiply-precision.js
35 lines
889 B
JavaScript
35 lines
889 B
JavaScript
const { assert, test, module: describe, only, skip } = require('qunit');
|
|
const { GPU } = require('../../src');
|
|
|
|
describe('internal: constructor features');
|
|
|
|
function channelCount(mode) {
|
|
const gpu = new GPU({ mode });
|
|
const kernel = gpu.createKernel(function() {
|
|
return 1;
|
|
}, { output: [1] });
|
|
kernel();
|
|
assert.ok(kernel.kernel.constructor.features.channelCount >= 1);
|
|
gpu.destroy();
|
|
}
|
|
|
|
(GPU.isGPUSupported ? test : skip)('channelCount auto', () => {
|
|
channelCount();
|
|
});
|
|
|
|
(GPU.isGPUSupported ? test : skip)('channelCount gpu', () => {
|
|
channelCount('gpu');
|
|
});
|
|
|
|
(GPU.isWebGLSupported ? test : skip)('channelCount webgl', () => {
|
|
channelCount('webgl');
|
|
});
|
|
|
|
(GPU.isWebGL2Supported ? test : skip)('channelCount webgl2', () => {
|
|
channelCount('webgl2');
|
|
});
|
|
|
|
(GPU.isHeadlessGLSupported ? test : skip)('channelCount headlessgl', () => {
|
|
channelCount('headlessgl');
|
|
});
|