()
| 110 | } |
| 111 | |
| 112 | translateSource() { |
| 113 | this.leadingReturnStatement = this.output.length > 1 ? 'resultX[x] = ' : 'result[x] = '; |
| 114 | if (this.subKernels) { |
| 115 | const followingReturnStatement = []; |
| 116 | for (let i = 0; i < this.subKernels.length; i++) { |
| 117 | const { |
| 118 | name |
| 119 | } = this.subKernels[i]; |
| 120 | followingReturnStatement.push(this.output.length > 1 ? `resultX_${ name }[x] = subKernelResult_${ name };\n` : `result_${ name }[x] = subKernelResult_${ name };\n`); |
| 121 | } |
| 122 | this.followingReturnStatement = followingReturnStatement.join(''); |
| 123 | } |
| 124 | const functionBuilder = FunctionBuilder.fromKernel(this, CPUFunctionNode); |
| 125 | this.translatedSources = functionBuilder.getPrototypes('kernel'); |
| 126 | if (!this.graphical && !this.returnType) { |
| 127 | this.returnType = functionBuilder.getKernelResultType(); |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | /** |
| 132 | * @desc Builds the Kernel, by generating the kernel |
no test coverage detected