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

Function CreateFp16StringParsingTestRun

delegate/test/DelegateOptionsTest.cpp:288–321  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

286}
287
288void CreateFp16StringParsingTestRun(std::vector<std::string>& keys,
289 std::vector<std::string>& values,
290 std::stringstream& ss)
291{
292 StreamRedirector redirect(std::cout, ss.rdbuf());
293
294 std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef };
295 std::vector<int32_t> tensorShape { 1, 2, 2, 1 };
296 std::vector<float> inputData = { 1, 2, 3, 4 };
297 std::vector<float> divData = { 2, 2, 3, 4 };
298 std::vector<float> expectedResult = { 1, 2, 2, 2 };
299
300 // Create options_keys and options_values char array
301 size_t num_options = keys.size();
302 std::unique_ptr<const char*[]> options_keys =
303 std::unique_ptr<const char*[]>(new const char*[num_options + 1]);
304 std::unique_ptr<const char*[]> options_values =
305 std::unique_ptr<const char*[]>(new const char*[num_options + 1]);
306 for (size_t i=0; i<num_options; ++i)
307 {
308 options_keys.get()[i] = keys[i].c_str();
309 options_values.get()[i] = values[i].c_str();
310 }
311
312 armnnDelegate::DelegateOptions delegateOptions(options_keys.get(), options_values.get(),
313 num_options, nullptr);
314 DelegateOptionTest<float>(::tflite::TensorType_FLOAT32,
315 tensorShape,
316 inputData,
317 inputData,
318 divData,
319 expectedResult,
320 delegateOptions);
321}
322
323TEST_CASE ("ArmnnDelegateStringParsingOptionReduceFp32ToFp16")
324{

Callers 1

Calls 3

sizeMethod · 0.45
getMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected