aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2023-06-20 18:45:44 +0100
committerGeorgios Pinitas <georgios.pinitas@arm.com>2023-06-20 18:45:44 +0100
commitc8da1d2687cfcff90629c2cf770bb5f406002701 (patch)
treeba46b305a4de06a51a2f837cb2890ce32a60f008
parentabdac23838fbab7c76dae8eac9174a61d390abba (diff)
downloadreference_model-c8da1d2687cfcff90629c2cf770bb5f406002701.tar.gz
Make verifiers to operate on const pointers
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com> Change-Id: I45287af6b33cf07383250dc962a97728e65697a7
-rw-r--r--reference_model/include/verify.h2
-rw-r--r--reference_model/src/verify.cc4
2 files changed, 3 insertions, 3 deletions
diff --git a/reference_model/include/verify.h b/reference_model/include/verify.h
index 0cf6b6c..0ac35fe 100644
--- a/reference_model/include/verify.h
+++ b/reference_model/include/verify.h
@@ -64,7 +64,7 @@ bool tosa_validate_output_error(double err_sum, double err_sum_sq, size_t T, siz
/// \param S Test set used as a input/weight generator
///
/// \return True if the error is within margin else false
-bool tosa_validate_data_fp32(double* ref, double* bnd, float* imp, size_t T, size_t KS, int S);
+bool tosa_validate_data_fp32(const double* ref, const double* bnd, const float* imp, size_t T, size_t KS, int S);
#ifdef __cplusplus
}
diff --git a/reference_model/src/verify.cc b/reference_model/src/verify.cc
index 940275f..584a418 100644
--- a/reference_model/src/verify.cc
+++ b/reference_model/src/verify.cc
@@ -74,7 +74,7 @@ std::optional<double> validate_element(double ref, double bnd, AccType imp, size
// Generic data validation function
template <typename AccType, typename std::enable_if_t<std::is_floating_point_v<AccType>, int> = 0>
-bool validate_data(double* ref, double* bnd, AccType* imp, size_t T, size_t KS, int32_t S)
+bool validate_data(const double* ref, const double* bnd, const AccType* imp, size_t T, size_t KS, int32_t S)
{
double out_err_sum = 0.0;
double out_err_sumsq = 0.0;
@@ -121,7 +121,7 @@ bool tosa_validate_output_error(double err_sum, double err_sum_sq, size_t T, siz
return true;
}
-bool tosa_validate_data_fp32(double* ref, double* bnd, float* imp, size_t T, size_t KS, int S)
+bool tosa_validate_data_fp32(const double* ref, const double* bnd, const float* imp, size_t T, size_t KS, int S)
{
return validate_data<float>(ref, bnd, imp, T, KS, S);
}