(mode)
| 5 | describe('internal: deep types'); |
| 6 | |
| 7 | function oneLayerDeepFloat(mode) { |
| 8 | const gpu = new GPU({ mode }); |
| 9 | function childFunction(childFunctionArgument1) { |
| 10 | return childFunctionArgument1 + 1; |
| 11 | } |
| 12 | gpu.addFunction(childFunction); |
| 13 | |
| 14 | const kernel = gpu.createKernel(function(kernelArgument1) { |
| 15 | return childFunction(kernelArgument1); |
| 16 | }, { output: [1] }); |
| 17 | sinon.spy(FunctionBuilder.prototype, 'lookupReturnType'); |
| 18 | try { |
| 19 | const result = kernel(1.5); |
| 20 | assert.equal(result[0], 2.5); |
| 21 | assert.equal(FunctionBuilder.prototype.lookupReturnType.callCount, 1); |
| 22 | assert.equal(FunctionBuilder.prototype.lookupReturnType.args[0][0], 'childFunction'); |
| 23 | } finally { |
| 24 | FunctionBuilder.prototype.lookupReturnType.restore(); |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | (GPU.isWebGLSupported ? test : skip)('one layer deep float WebGL', () => { |
| 29 | oneLayerDeepFloat('webgl'); |
no test coverage detected
searching dependent graphs…