aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJammy Zhou <jammy.zhou@linaro.org>2019-10-21 16:44:40 +0800
committerMatteo Martincigh <matteo.martincigh@arm.com>2019-10-23 07:26:45 +0000
commitd80cc0c9766b87a4cfe530ad90e11ed1e706d890 (patch)
treea3a91807b7eab2e3c5a247f23d3ba40935cd61df
parent0898b33812a472dfbd77984dbbe4880523a8595c (diff)
downloadarmnn-d80cc0c9766b87a4cfe530ad90e11ed1e706d890.tar.gz
Fix build failures on RPi 4B
Signed-off-by: Jammy Zhou <jammy.zhou@gmail.com> Change-Id: I12562c4a9671cd43884e7c0c023ca463a99c3aa2
-rw-r--r--src/backends/aclCommon/ArmComputeTensorUtils.hpp2
-rw-r--r--tests/profiling/gatordmock/GatordMockService.cpp10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/backends/aclCommon/ArmComputeTensorUtils.hpp b/src/backends/aclCommon/ArmComputeTensorUtils.hpp
index c30de19557..ef837d84d8 100644
--- a/src/backends/aclCommon/ArmComputeTensorUtils.hpp
+++ b/src/backends/aclCommon/ArmComputeTensorUtils.hpp
@@ -123,7 +123,7 @@ inline size_t GetTensorOffset(const arm_compute::ITensorInfo& info,
coords.set(2, static_cast<int>(channelIndex));
coords.set(1, static_cast<int>(y));
coords.set(0, static_cast<int>(x));
- return info.offset_element_in_bytes(coords);
+ return boost::numeric_cast<size_t>(info.offset_element_in_bytes(coords));
}
// Helper function to obtain element offset into data buffer representing tensor data (assuming no strides).
diff --git a/tests/profiling/gatordmock/GatordMockService.cpp b/tests/profiling/gatordmock/GatordMockService.cpp
index bf326a64c3..5e9f8203d1 100644
--- a/tests/profiling/gatordmock/GatordMockService.cpp
+++ b/tests/profiling/gatordmock/GatordMockService.cpp
@@ -113,7 +113,7 @@ bool GatordMockService::WaitForStreamMetaData()
uint32_t metaDataLength = ToUint32(&header[4], m_Endianness) - 4;
// Read the entire packet.
u_char packetData[metaDataLength];
- if (metaDataLength != read(m_ClientConnection, &packetData, metaDataLength))
+ if (metaDataLength != boost::numeric_cast<uint32_t>(read(m_ClientConnection, &packetData, metaDataLength)))
{
std::cerr << ": Protocol read error. Data length mismatch." << std::endl;
return false;
@@ -227,16 +227,16 @@ void GatordMockService::ReceiveLoop(GatordMockService& mockService)
{
armnn::profiling::Packet packet = mockService.WaitForPacket(500);
}
- catch (armnn::TimeoutException)
+ catch (const armnn::TimeoutException&)
{
// In this case we ignore timeouts and and keep trying to receive.
}
- catch (armnn::InvalidArgumentException e)
+ catch (const armnn::InvalidArgumentException &e)
{
// We couldn't find a functor to handle the packet?
std::cerr << "Packet received that could not be processed: " << e.what() << std::endl;
}
- catch (armnn::RuntimeException e)
+ catch (const armnn::RuntimeException &e)
{
// A runtime exception occurred which means we must exit the loop.
std::cerr << "Receive thread closing: " << e.what() << std::endl;
@@ -386,7 +386,7 @@ bool GatordMockService::ReadFromSocket(u_char* packetData, uint32_t expectedLeng
{
// This is a blocking read until either expectedLength has been received or an error is detected.
ssize_t totalBytesRead = 0;
- while (totalBytesRead < expectedLength)
+ while (boost::numeric_cast<uint32_t>(totalBytesRead) < expectedLength)
{
ssize_t bytesRead = recv(m_ClientConnection, packetData, expectedLength, 0);
if (bytesRead < 0)