aboutsummaryrefslogtreecommitdiff
path: root/lib/layer_by_layer_profiler/include/layer_by_layer_profiler.hpp
diff options
context:
space:
mode:
authorKristofer Jonsson <kristofer.jonsson@arm.com>2022-01-27 17:36:55 +0100
committerKristofer Jonsson <kristofer.jonsson@arm.com>2022-01-31 13:27:17 +0100
commit5a15bf4c86fad79523517afff5f2df2f6298d8da (patch)
treeb8e750d2471d480dd4c271bf2a376816ad1ac412 /lib/layer_by_layer_profiler/include/layer_by_layer_profiler.hpp
parentdcc1ce0f9b64198f3bb82d9858ec79663808a35f (diff)
downloadethos-u-core-software-5a15bf4c86fad79523517afff5f2df2f6298d8da.tar.gz
Set TFLu external context
Remove PMU configuration from the InferenceJob struct and add an external context parameter intead. The external context is passed to the TFLu interpreter and will be returned in the ethosu_inference_begin() and ethosu_inference_end() callbacks. Change-Id: I6dab04c0ab5088b1325be365d77d65d1182e7441
Diffstat (limited to 'lib/layer_by_layer_profiler/include/layer_by_layer_profiler.hpp')
-rw-r--r--lib/layer_by_layer_profiler/include/layer_by_layer_profiler.hpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/lib/layer_by_layer_profiler/include/layer_by_layer_profiler.hpp b/lib/layer_by_layer_profiler/include/layer_by_layer_profiler.hpp
index a547576..0c50bc8 100644
--- a/lib/layer_by_layer_profiler/include/layer_by_layer_profiler.hpp
+++ b/lib/layer_by_layer_profiler/include/layer_by_layer_profiler.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Arm Limited. All rights reserved.
+ * Copyright (c) 2021-2022 Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -22,7 +22,6 @@
#include "EventRecorder.h"
#include "tensorflow/lite/kernels/internal/compatibility.h"
#include <memory>
-#include <pmu_ethosu.h>
#include <vector>
// NOTE: This profiler only works on systems with 1 NPU due to the use of
@@ -31,29 +30,21 @@ namespace tflite {
class LayerByLayerProfiler : public MicroProfiler {
public:
enum Backend { PRINTF, EVENT_RECORDER };
- LayerByLayerProfiler(const std::vector<uint8_t> &event_config = {},
- bool pmu_cycle_counter_enable = true,
- size_t max_events = 200,
- Backend backend = PRINTF,
- int32_t event_id = EventID(EventLevelError, EvtStatistics_No, EventRecordNone));
+
+ LayerByLayerProfiler(size_t max_events = 200,
+ Backend backend = PRINTF,
+ int32_t event_id = EventID(EventLevelError, EvtStatistics_No, EventRecordNone));
+
uint32_t BeginEvent(const char *tag);
void EndEvent(uint32_t event_handle);
int32_t GetTotalTicks() const;
void Log() const;
- uint64_t GetPmuCycleCounterCount() const;
- const std::vector<uint32_t> &GetPmuEventCount() const;
-
private:
std::unique_ptr<const char *[]> tags_;
std::unique_ptr<uint64_t[]> start_ticks_;
std::unique_ptr<uint64_t[]> end_ticks_;
- std::vector<uint8_t> pmu_event_config;
- std::vector<uint32_t> pmu_event_count;
- bool pmu_cycle_counter_enable;
- uint64_t pmu_cycle_counter_count;
-
size_t max_events_;
Backend backend;
int32_t event_id;