MCPcopy Create free account
hub / github.com/AnswerDotAI/gpu.cpp / MatmulShader

Function MatmulShader

experimental/legacy/transformer/shaders.h:166–173  ·  view source on GitHub ↗

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. * */

Source from the content-addressed store, hash-verified

164 * This is intended to be run ahead of time, so is not performance critical.
165 * */
166KernelCode 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:

Callers 1

testMatmulFunction · 0.85

Calls 1

replaceAllFunction · 0.85

Tested by 1

testMatmulFunction · 0.68