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

Function Cast

src/backends/reference/workloads/RefCastWorkload.cpp:14–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12namespace
13{
14 void Cast(armnn::Decoder<float>& in, armnn::Encoder<float>& out,
15 const uint32_t numElements, const armnn::DataType OutputDataType)
16 {
17 for (unsigned int i = 0; i < numElements; ++i)
18 {
19 switch (OutputDataType)
20 {
21 case armnn::DataType::Float32:
22 case armnn::DataType::Float16:
23 case armnn::DataType::BFloat16:
24 out.Set(in.Get());
25 break;
26 default:
27 out.Set(std::floor(in.Get()));
28 break;
29 }
30 ++in;
31 ++out;
32 }
33 }
34
35
36 // Cast Float to Int64

Callers 1

ExecuteMethod · 0.85

Calls 3

floorFunction · 0.85
SetMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected