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

Function replaceAll

gpu.hpp:275–282  ·  view source on GitHub ↗

* @brief simple in-place string replacement helper function for substituting * placeholders in a WGSL string template. * * Note this is not meant to be used in performance-critical code paths and * should be used ahead-of-time before any performance-critical codepath to * preprocess WGSL code strings. * * @param[in] str String to mutate with substitution replacements. * @param[in] from Sub

Source from the content-addressed store, hash-verified

273 * @endcode
274 */
275inline void replaceAll(std::string &str, const std::string &from,
276 const std::string &to) {
277 size_t start_pos = 0;
278 while ((start_pos = str.find(from, start_pos)) != std::string::npos) {
279 str.replace(start_pos, from.length(), to);
280 start_pos += to.length();
281 }
282}
283
284/**
285 * @brief KernelCode is the representation of WGSL GPU code with template

Callers 12

KernelCodeMethod · 0.85
createMatmul1Function · 0.85
createMatmul2Function · 0.85
createMatmul3Function · 0.85
createMatmul4Function · 0.85
createNoOpFunction · 0.85
createTranspose1Function · 0.85
createTranspose2Function · 0.85
MatmulShaderFunction · 0.85
createMatmulFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected