aboutsummaryrefslogtreecommitdiff
path: root/utils/GraphUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/GraphUtils.cpp')
-rw-r--r--utils/GraphUtils.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/utils/GraphUtils.cpp b/utils/GraphUtils.cpp
index 84f04161a8..e543cabea9 100644
--- a/utils/GraphUtils.cpp
+++ b/utils/GraphUtils.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2019 Arm Limited.
+ * Copyright (c) 2017-2020 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -272,9 +272,16 @@ bool ImageAccessor::access_tensor(ITensor &tensor)
{
std::tie(permuted_shape, perm) = compute_permutation_parameters(tensor.info()->tensor_shape(), tensor.info()->data_layout());
}
+
+#ifdef __arm__
ARM_COMPUTE_EXIT_ON_MSG_VAR(image_loader->width() != permuted_shape.x() || image_loader->height() != permuted_shape.y(),
"Failed to load image file: dimensions [%d,%d] not correct, expected [%" PRIu32 ",%" PRIu32 "].",
image_loader->width(), image_loader->height(), permuted_shape.x(), permuted_shape.y());
+#else // __arm__
+ ARM_COMPUTE_EXIT_ON_MSG_VAR(image_loader->width() != permuted_shape.x() || image_loader->height() != permuted_shape.y(),
+ "Failed to load image file: dimensions [%d,%d] not correct, expected [%" PRIu64 ",%" PRIu64 "].",
+ image_loader->width(), image_loader->height(), permuted_shape.x(), permuted_shape.y());
+#endif // __arm__
// Fill the tensor with the PPM content (BGR)
image_loader->fill_planar_tensor(tensor, _bgr);
@@ -348,9 +355,16 @@ bool ValidationInputAccessor::access_tensor(arm_compute::ITensor &tensor)
std::tie(permuted_shape, perm) = compute_permutation_parameters(tensor.info()->tensor_shape(),
tensor.info()->data_layout());
}
+
+#ifdef __arm__
ARM_COMPUTE_EXIT_ON_MSG_VAR(jpeg.width() != permuted_shape.x() || jpeg.height() != permuted_shape.y(),
"Failed to load image file: dimensions [%d,%d] not correct, expected [%" PRIu32 ",%" PRIu32 "].",
jpeg.width(), jpeg.height(), permuted_shape.x(), permuted_shape.y());
+#else // __arm__
+ ARM_COMPUTE_EXIT_ON_MSG_VAR(jpeg.width() != permuted_shape.x() || jpeg.height() != permuted_shape.y(),
+ "Failed to load image file: dimensions [%d,%d] not correct, expected [%" PRIu64 ",%" PRIu64 "].",
+ jpeg.width(), jpeg.height(), permuted_shape.x(), permuted_shape.y());
+#endif // __arm__
// Fill the tensor with the JPEG content (BGR)
jpeg.fill_planar_tensor(tensor, _bgr);