From 939d0b7c8934304ee9586e0c0871ec6bcf214822 Mon Sep 17 00:00:00 2001 From: Mikael Olsson Date: Wed, 15 May 2024 10:08:26 +0200 Subject: Change to use uint32_t in Arm profiler for ticks Currently the profiler uses signed 32-bit integers to hold the start and end tick values. This is not appropriate because the tick values will never be negative and the current ticks are returned as an unsigned 32-bit integer value. To address this, the start and end ticks will now be stored as unsigned 32-bit integers instead. Change-Id: I6358f3fde7c034c5e40409a9d3f7a576ff4897ce Signed-off-by: Mikael Olsson --- lib/arm_profiler/include/arm_profiler.hpp | 7 +++---- lib/arm_profiler/src/arm_profiler.cpp | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/arm_profiler/include/arm_profiler.hpp b/lib/arm_profiler/include/arm_profiler.hpp index 9c7b5f3..9d9f543 100644 --- a/lib/arm_profiler/include/arm_profiler.hpp +++ b/lib/arm_profiler/include/arm_profiler.hpp @@ -1,6 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright 2021-2022 Arm Limited and/or its affiliates - * + * SPDX-FileCopyrightText: Copyright 2021-2022, 2024 Arm Limited and/or its affiliates * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the License); you may @@ -36,8 +35,8 @@ public: private: size_t max_events_; std::unique_ptr tags_; - std::unique_ptr start_ticks_; - std::unique_ptr end_ticks_; + std::unique_ptr start_ticks_; + std::unique_ptr end_ticks_; size_t num_events_; diff --git a/lib/arm_profiler/src/arm_profiler.cpp b/lib/arm_profiler/src/arm_profiler.cpp index 2977474..d09cdf0 100644 --- a/lib/arm_profiler/src/arm_profiler.cpp +++ b/lib/arm_profiler/src/arm_profiler.cpp @@ -1,6 +1,5 @@ /* - * Copyright (c) 2021-2022 Arm Limited. All rights reserved. - * + * SPDX-FileCopyrightText: Copyright 2021-2022, 2024 Arm Limited and/or its affiliates * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the License); you may @@ -30,8 +29,8 @@ namespace tflite { ArmProfiler::ArmProfiler(size_t max_events) : max_events_(max_events), num_events_(0) { tags_ = std::make_unique(max_events_); - start_ticks_ = std::make_unique(max_events_); - end_ticks_ = std::make_unique(max_events_); + start_ticks_ = std::make_unique(max_events_); + end_ticks_ = std::make_unique(max_events_); } uint32_t ArmProfiler::BeginEvent(const char *tag) { -- cgit v1.2.1