ArmNN
 21.08
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 246 of file JsonPrinterTestImpl.cpp.

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

Referenced by TEST_CASE_FIXTURE(), and TEST_SUITE().

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