blob: dc56d0b4c97a9f4ef282fa387fa239eaca9b413e [file] [log] [blame]
Mikael Olsson578af8f2023-12-11 17:24:49 +01001/*
2 * SPDX-FileCopyrightText: Copyright 2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the License); you may
6 * not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#pragma once
19
20#include <stdint.h>
21
22#if defined __has_include
23#if __has_include(<ethosu_profiler_impl.hpp>)
24#define HAS_IMPL
25#include <ethosu_profiler_impl.hpp>
26#endif
27#endif
28
29#ifndef HAS_IMPL
30struct ethosu_profiler_context {};
31#endif
32
33void ethosu_profiler_start(struct ethosu_profiler_context *ctx);
34
35void ethosu_profiler_end(struct ethosu_profiler_context *ctx);
36
37void ethosu_profiler_reset(struct ethosu_profiler_context *ctx);
38
39uint64_t ethosu_profiler_get_pmu_cycles(struct ethosu_profiler_context *ctx);
40
41void ethosu_profiler_add_to_pmu_cycles(struct ethosu_profiler_context *ctx, uint64_t cycles);
42
43void ethosu_profiler_add_to_pmu_event(struct ethosu_profiler_context *ctx, uint32_t index, uint32_t value);
44
45void ethosu_profiler_report(struct ethosu_profiler_context *ctx);