Mikael Olsson | 578af8f | 2023-12-11 17:24:49 +0100 | [diff] [blame] | 1 | /* |
| 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 |
| 30 | struct ethosu_profiler_context {}; |
| 31 | #endif |
| 32 | |
| 33 | void ethosu_profiler_start(struct ethosu_profiler_context *ctx); |
| 34 | |
| 35 | void ethosu_profiler_end(struct ethosu_profiler_context *ctx); |
| 36 | |
| 37 | void ethosu_profiler_reset(struct ethosu_profiler_context *ctx); |
| 38 | |
| 39 | uint64_t ethosu_profiler_get_pmu_cycles(struct ethosu_profiler_context *ctx); |
| 40 | |
| 41 | void ethosu_profiler_add_to_pmu_cycles(struct ethosu_profiler_context *ctx, uint64_t cycles); |
| 42 | |
| 43 | void ethosu_profiler_add_to_pmu_event(struct ethosu_profiler_context *ctx, uint32_t index, uint32_t value); |
| 44 | |
| 45 | void ethosu_profiler_report(struct ethosu_profiler_context *ctx); |