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

Function check

gpu.hpp:743–751  ·  view source on GitHub ↗

* @brief Checks a condition and logs an error message if the condition is * false. * @param[in] condition The condition to check. * @param[in] message The error message to log if the condition is false. * @param[in] file The source file where the check is performed. * @param[in] line The line number in the source file where the check is * performed. */

Source from the content-addressed store, hash-verified

741 * performed.
742 */
743inline void check(bool condition, const char *message,
744 const char *file = "unkown", int line = -1) {
745 if (!condition) {
746 LOG(kDefLog, kError, "Error in file %s line %d:\n%s", file, line, message);
747 } else {
748 LOG(kDefLog, kTrace, "Success in file %s line %d:\n%s", file, line,
749 message);
750 }
751}
752
753/**
754 * @brief Factory function to create a GPU context, which aggregates WebGPU API

Callers 4

createContextFunction · 0.70
createContextByGpuIdxFunction · 0.70
toCPUFunction · 0.70
dispatchKernelFunction · 0.70

Calls 1

LOGFunction · 0.85

Tested by

no test coverage detected