| 124 | )"; |
| 125 | |
| 126 | inline KernelCode createMatmul2(const char *shaderTemplate, const size_t M, |
| 127 | const size_t K, const size_t N, |
| 128 | const Shape &workgroupSize = {256, 1, 1}, |
| 129 | NumType precision = kf32) { |
| 130 | std::string codeString(shaderTemplate); |
| 131 | replaceAll(codeString, |
| 132 | {{"{{workgroupSize}}", toString(workgroupSize)}, |
| 133 | {"{{precision}}", toString(precision)}, |
| 134 | {"{{M}}", toString(M)}, |
| 135 | {"{{K}}", toString(K)}, |
| 136 | {"{{N}}", toString(N)}, |
| 137 | {"{{tileSize}}", |
| 138 | toString(static_cast<size_t>(sqrt(workgroupSize[0])))}}); |
| 139 | return {codeString, workgroupSize, precision}; |
| 140 | } |
| 141 | |
| 142 | /* 1D block-tiling |
| 143 | * |
no test coverage detected