aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMikael Olsson <mikael.olsson@arm.com>2024-05-15 10:08:26 +0200
committerMikael Olsson <mikael.olsson@arm.com>2024-05-15 14:25:57 +0200
commit939d0b7c8934304ee9586e0c0871ec6bcf214822 (patch)
treee706969c818562e886d7fb9afc6f84c9828a8b24 /lib
parentf922fd1acb5064cd160e1395dc67a2cd5bb3cdfb (diff)
downloadethos-u-core-software-main.tar.gz
Change to use uint32_t in Arm profiler for ticksHEAD24.05-rc1main
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 <mikael.olsson@arm.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/arm_profiler/include/arm_profiler.hpp7
-rw-r--r--lib/arm_profiler/src/arm_profiler.cpp7
2 files changed, 6 insertions, 8 deletions
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 <open-source-office@arm.com>
- *
+ * SPDX-FileCopyrightText: Copyright 2021-2022, 2024 Arm Limited and/or its affiliates <open-source-office@arm.com>
* 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<const char *[]> tags_;
- std::unique_ptr<int32_t[]> start_ticks_;
- std::unique_ptr<int32_t[]> end_ticks_;
+ std::unique_ptr<uint32_t[]> start_ticks_;
+ std::unique_ptr<uint32_t[]> 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 <open-source-office@arm.com>
* 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<const char *[]>(max_events_);
- start_ticks_ = std::make_unique<int32_t[]>(max_events_);
- end_ticks_ = std::make_unique<int32_t[]>(max_events_);
+ start_ticks_ = std::make_unique<uint32_t[]>(max_events_);
+ end_ticks_ = std::make_unique<uint32_t[]>(max_events_);
}
uint32_t ArmProfiler::BeginEvent(const char *tag) {