Generates KernelCode instance for all matmul kernels - pass in * the template code via `shaderRaw`. * * This is intended to be run ahead of time, so is not performance critical. * */
| 164 | * This is intended to be run ahead of time, so is not performance critical. |
| 165 | * */ |
| 166 | KernelCode MatmulShader(size_t workgroupSize, const char *shaderRaw, |
| 167 | NumType precision, size_t M, size_t K, size_t N) { |
| 168 | KernelCode shader = {shaderRaw, workgroupSize, precision}; |
| 169 | replaceAll(shader.data, "{{M}}", std::to_string(M)); |
| 170 | replaceAll(shader.data, "{{K}}", std::to_string(K)); |
| 171 | replaceAll(shader.data, "{{N}}", std::to_string(N)); |
| 172 | return shader; |
| 173 | } |
| 174 | |
| 175 | /* Softmax |
| 176 | * v1: |