MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / validate_static_cast

Function validate_static_cast

tests/validation/NEON/Cast.cpp:128–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126
127template <typename T>
128void validate_static_cast(const TensorShape &shape, DataType src_dtype, DataType dst_dtype)
129{
130 Tensor input = create_tensor<Tensor>(shape, src_dtype, 1);
131 Tensor output = create_tensor<Tensor>(shape, dst_dtype, 1);
132
133 NECast cast;
134 cast.configure(&input, &output, ConvertPolicy::SATURATE);
135 input.allocator()->allocate();
136 output.allocator()->allocate();
137
138 library->fill_tensor_value(Accessor(input), 1.99f);
139 cast.run();
140
141 for (unsigned int i = 0; i < shape.x(); ++i)
142 {
143 const T ref = 1;
144 const T target = reinterpret_cast<T *>(output.buffer())[i];
145
146 ARM_COMPUTE_EXPECT(ref == target, framework::LogLevel::ERRORS);
147 }
148}
149
150} // namespace
151

Callers

nothing calls this directly

Calls 8

AccessorClass · 0.85
fill_tensor_valueMethod · 0.80
configureMethod · 0.45
allocateMethod · 0.45
allocatorMethod · 0.45
runMethod · 0.45
xMethod · 0.45
bufferMethod · 0.45

Tested by

no test coverage detected