Handle empty pmuConfigs in InferenceJob for runJob

Verify that the size of the pmueventconfig argument is the expected size
before accessing the vector and set up the pmu counters to be
ETHOSU_PMU_NO_EVENT if it's not.

Change-Id: Icfcf5255e7e99fd3bcae6535d54f8c18e89e24f2
diff --git a/applications/inference_process/src/inference_process.cpp b/applications/inference_process/src/inference_process.cpp
index 727c340..743ed64 100644
--- a/applications/inference_process/src/inference_process.cpp
+++ b/applications/inference_process/src/inference_process.cpp
@@ -203,10 +203,12 @@
     tflite::MicroProfiler profiler;
 
 #if defined(INFERENCE_PROC_TFLU_PROFILER) && defined(ETHOSU)
-    profiler.MonitorEthosuPMUEvents(ethosu_pmu_event_type(job.pmuEventConfig[0]),
-                                    ethosu_pmu_event_type(job.pmuEventConfig[1]),
-                                    ethosu_pmu_event_type(job.pmuEventConfig[2]),
-                                    ethosu_pmu_event_type(job.pmuEventConfig[3]));
+    vector<ethosu_pmu_event_type> pmu_events(ETHOSU_PMU_NCOUNTERS, ETHOSU_PMU_NO_EVENT);
+
+    for (size_t i = 0; i < job.pmuEventConfig.size(); i++) {
+        pmu_events[i] = ethosu_pmu_event_type(job.pmuEventConfig[i]);
+    }
+    profiler.MonitorEthosuPMUEvents(pmu_events[0], pmu_events[1], pmu_events[2], pmu_events[3]);
 #endif
     tflite::MicroInterpreter interpreter(model, resolver, tensorArena, tensorArenaSize, reporter, &profiler);