aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arm_compute/core/Utils.h6
-rw-r--r--arm_compute/runtime/TensorAllocator.h2
-rw-r--r--src/core/ITensor.cpp5
-rw-r--r--src/runtime/MultiImage.cpp10
-rw-r--r--src/runtime/TensorAllocator.cpp2
5 files changed, 18 insertions, 7 deletions
diff --git a/arm_compute/core/Utils.h b/arm_compute/core/Utils.h
index a37559d269..b0e26328ed 100644
--- a/arm_compute/core/Utils.h
+++ b/arm_compute/core/Utils.h
@@ -32,6 +32,7 @@
#include <algorithm>
#include <cstdint>
#include <cstdlib>
+#include <iomanip>
#include <numeric>
#include <sstream>
#include <string>
@@ -1150,6 +1151,8 @@ template <typename T>
void print_consecutive_elements_impl(std::ostream &s, const T *ptr, unsigned int n, int stream_width = 0, const std::string &element_delim = " ")
{
using print_type = typename std::conditional<std::is_floating_point<T>::value, T, int>::type;
+ std::ios stream_status(nullptr);
+ stream_status.copyfmt(s);
for(unsigned int i = 0; i < n; ++i)
{
@@ -1169,6 +1172,9 @@ void print_consecutive_elements_impl(std::ostream &s, const T *ptr, unsigned int
s << std::right << static_cast<print_type>(ptr[i]) << element_delim;
}
}
+
+ // Restore output stream flags
+ s.copyfmt(stream_status);
}
/** Identify the maximum width of n consecutive elements.
diff --git a/arm_compute/runtime/TensorAllocator.h b/arm_compute/runtime/TensorAllocator.h
index bf574fa0c9..c2a370fb58 100644
--- a/arm_compute/runtime/TensorAllocator.h
+++ b/arm_compute/runtime/TensorAllocator.h
@@ -72,7 +72,7 @@ public:
* @param[in] coords The starting coordinates of the new tensor inside the parent tensor.
* @param[in] sub_info The new tensor information (e.g. shape etc)
*/
- void init(const TensorAllocator &allocator, const Coordinates &coords, TensorInfo sub_info);
+ void init(const TensorAllocator &allocator, const Coordinates &coords, TensorInfo &sub_info);
/** Returns the pointer to the allocated data.
*
diff --git a/src/core/ITensor.cpp b/src/core/ITensor.cpp
index 7cf04b51c4..607f5cedbf 100644
--- a/src/core/ITensor.cpp
+++ b/src/core/ITensor.cpp
@@ -81,6 +81,8 @@ void ITensor::print(std::ostream &s, IOFormatInfo io_fmt) const
const Strides strides = this->info()->strides_in_bytes();
const PaddingSize padding = this->info()->padding();
const size_t num_channels = this->info()->num_channels();
+ std::ios stream_status(nullptr);
+ stream_status.copyfmt(s);
// Set precision
if(is_data_type_float(dt) && (io_fmt.precision_type != IOFormatInfo::PrecisionType::Default))
@@ -151,6 +153,9 @@ void ITensor::print(std::ostream &s, IOFormatInfo io_fmt) const
s << io_fmt.row_delim;
}
}
+
+ // Restore output stream flags
+ s.copyfmt(stream_status);
}
#endif /* ARM_COMPUTE_ASSERTS_ENABLED */
diff --git a/src/runtime/MultiImage.cpp b/src/runtime/MultiImage.cpp
index 6eba71bf1d..eec58d3ef4 100644
--- a/src/runtime/MultiImage.cpp
+++ b/src/runtime/MultiImage.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2018 ARM Limited.
+ * Copyright (c) 2016-2019 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -164,7 +164,7 @@ void MultiImage::allocate()
void MultiImage::create_subimage(MultiImage *image, const Coordinates &coords, unsigned int width, unsigned int height)
{
arm_compute::Format format = image->info()->format();
- const TensorInfo info(width, height, Format::U8);
+ TensorInfo info(width, height, Format::U8);
switch(format)
{
@@ -180,21 +180,21 @@ void MultiImage::create_subimage(MultiImage *image, const Coordinates &coords, u
case Format::YUYV422:
case Format::UYVY422:
{
- const TensorInfo info_full(width, height, format);
+ TensorInfo info_full(width, height, format);
std::get<0>(_plane).allocator()->init(*dynamic_cast<Image *>(image->plane(0))->allocator(), coords, info_full);
break;
}
case Format::NV12:
case Format::NV21:
{
- const TensorInfo info_uv88(width / 2, height / 2, Format::UV88);
+ TensorInfo info_uv88(width / 2, height / 2, Format::UV88);
std::get<0>(_plane).allocator()->init(*dynamic_cast<Image *>(image->plane(0))->allocator(), coords, info);
std::get<1>(_plane).allocator()->init(*dynamic_cast<Image *>(image->plane(1))->allocator(), coords, info_uv88);
break;
}
case Format::IYUV:
{
- const TensorInfo info_sub2(width / 2, height / 2, Format::U8);
+ TensorInfo info_sub2(width / 2, height / 2, Format::U8);
std::get<0>(_plane).allocator()->init(*dynamic_cast<Image *>(image->plane(0))->allocator(), coords, info);
std::get<1>(_plane).allocator()->init(*dynamic_cast<Image *>(image->plane(1))->allocator(), coords, info_sub2);
std::get<2>(_plane).allocator()->init(*dynamic_cast<Image *>(image->plane(2))->allocator(), coords, info_sub2);
diff --git a/src/runtime/TensorAllocator.cpp b/src/runtime/TensorAllocator.cpp
index 0612d751f0..d9616ca09d 100644
--- a/src/runtime/TensorAllocator.cpp
+++ b/src/runtime/TensorAllocator.cpp
@@ -105,7 +105,7 @@ TensorAllocator &TensorAllocator::operator=(TensorAllocator &&o) noexcept
return *this;
}
-void TensorAllocator::init(const TensorAllocator &allocator, const Coordinates &coords, TensorInfo sub_info)
+void TensorAllocator::init(const TensorAllocator &allocator, const Coordinates &coords, TensorInfo &sub_info)
{
// Get parent info
const TensorInfo parent_info = allocator.info();