ArmNN
 22.05.01
JsonPrinterTestImpl.hpp File Reference
#include <armnn/BackendId.hpp>
#include <vector>

Go to the source code of this file.

Functions

void RunSoftmaxProfilerJsonPrinterTest (const std::vector< armnn::BackendId > &backends)
 

Function Documentation

◆ RunSoftmaxProfilerJsonPrinterTest()

void RunSoftmaxProfilerJsonPrinterTest ( const std::vector< armnn::BackendId > &  backends)

Definition at line 251 of file JsonPrinterTestImpl.cpp.

References armnn::CpuAcc, GetSoftmaxProfilerJson(), armnn::GpuAcc, and ValidateProfilerJson().

Referenced by TEST_CASE_FIXTURE(), and TEST_SUITE().

252 {
253  // setup the test fixture and obtain JSON Printer result
254  std::string result = GetSoftmaxProfilerJson(backends);
255 
256  // validate the JSON Printer result
257  ValidateProfilerJson(result);
258 
259  const armnn::BackendId& firstBackend = backends.at(0);
260  if (firstBackend == armnn::Compute::GpuAcc)
261  {
262  CHECK(result.find("OpenClKernelTimer/: softmax_layer_max_shift_exp_sum_quantized_serial GWS[,,]")
263  != std::string::npos);
264  }
265  else if (firstBackend == armnn::Compute::CpuAcc)
266  {
267  CHECK(result.find("NeonKernelTimer") != std::string::npos); // Validate backend
268 
269  bool softmaxCheck = ((result.find("softmax") != std::string::npos) || // Validate softmax
270  (result.find("Softmax") != std::string::npos) ||
271  (result.find("SoftMax") != std::string::npos));
272  CHECK(softmaxCheck);
273 
274  }
275 }
std::string GetSoftmaxProfilerJson(const std::vector< armnn::BackendId > &backends)
GPU Execution: OpenCL: ArmCompute.
CPU Execution: NEON: ArmCompute.
void ValidateProfilerJson(std::string &result)