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

Function sizeBytes

gpu.hpp:206–218  ·  view source on GitHub ↗

* @brief Returns the number of bytes of a number type. */

Source from the content-addressed store, hash-verified

204 * @brief Returns the number of bytes of a number type.
205 */
206inline size_t sizeBytes(const NumType &type) {
207 switch (type) {
208 case kf16:
209 return sizeof(uint16_t);
210 case kf32:
211 return sizeof(float);
212 case ki32:
213 return sizeof(int32_t);
214 default:
215 LOG(kDefLog, kError, "Invalid NumType in size calculation.");
216 return 0;
217 }
218}
219
220/**
221 * @brief Converts NumType to string.

Callers 1

createTensorFunction · 0.85

Calls 1

LOGFunction · 0.85

Tested by

no test coverage detected