MCPcopy Create free account
hub / github.com/ARM-software/armnn / compareCTypes

Function compareCTypes

include/armnn/Numpy.hpp:281–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

279
280 template <typename T>
281 inline bool compareCTypes(std::string& descr)
282 {
283 if(descr.find("f4") != std::string::npos || descr.find("f8") != std::string::npos)
284 {
285 return std::is_same<T, float>::value;
286 }
287 else if (descr.find("i8") != std::string::npos)
288 {
289 return std::is_same<T, int64_t>::value;
290 }
291 else if (descr.find("i4") != std::string::npos)
292 {
293 return std::is_same<T, int32_t>::value;
294 }
295 else if (descr.find("i2") != std::string::npos)
296 {
297 return std::is_same<T, int16_t>::value;
298 }
299 else if (descr.find("i1") != std::string::npos)
300 {
301 return std::is_same<T, int8_t>::value;
302 }
303 else if (descr.find("u1") != std::string::npos)
304 {
305 return std::is_same<T, uint8_t>::value;
306 }
307 else
308 {
309 throw armnn::Exception(fmt::format("Numpy data type:{} not supported. {}",
310 descr, CHECK_LOCATION().AsString()));
311 }
312 }
313
314 inline unsigned int getNumElements(Header& header)
315 {

Callers

nothing calls this directly

Calls 3

formatEnum · 0.85
ExceptionClass · 0.70
AsStringMethod · 0.45

Tested by

no test coverage detected