diff options
Diffstat (limited to 'arm_compute/core/Validate.h')
-rw-r--r-- | arm_compute/core/Validate.h | 242 |
1 files changed, 121 insertions, 121 deletions
diff --git a/arm_compute/core/Validate.h b/arm_compute/core/Validate.h index 227c3e7d69..4ef0e11433 100644 --- a/arm_compute/core/Validate.h +++ b/arm_compute/core/Validate.h @@ -81,11 +81,11 @@ public: * * @param[in] dim To be compared object. */ - arm_compute::Error operator()(const Dimensions<T> &dim) + arm_compute::Status operator()(const Dimensions<T> &dim) { ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG(have_different_dimensions(_dim, dim, 0), _function, _file, _line, "Objects have different dimensions"); - return arm_compute::Error{}; + return arm_compute::Status{}; } private: @@ -96,17 +96,17 @@ private: }; template <typename F> -inline arm_compute::Error for_each_error(F &&) +inline arm_compute::Status for_each_error(F &&) { - return arm_compute::Error{}; + return arm_compute::Status{}; } template <typename F, typename T, typename... Ts> -inline arm_compute::Error for_each_error(F &&func, T &&arg, Ts &&... args) +inline arm_compute::Status for_each_error(F &&func, T &&arg, Ts &&... args) { ARM_COMPUTE_RETURN_ON_ERROR(func(arg)); ARM_COMPUTE_RETURN_ON_ERROR(for_each_error(func, args...)); - return arm_compute::Error{}; + return arm_compute::Status{}; } template <typename T> @@ -128,10 +128,10 @@ struct get_tensor_info_t<ITensorInfo *> * @param[in] line Line on which the error occurred. * @param[in] pointers Pointers to check against nullptr. * - * @return Error + * @return Status */ template <typename... Ts> -inline arm_compute::Error error_on_nullptr(const char *function, const char *file, const int line, Ts &&... pointers) +inline arm_compute::Status error_on_nullptr(const char *function, const char *file, const int line, Ts &&... pointers) { const std::array<const void *, sizeof...(Ts)> pointers_array{ { std::forward<Ts>(pointers)... } }; bool has_nullptr = std::any_of(pointers_array.begin(), pointers_array.end(), [&](const void *ptr) @@ -139,7 +139,7 @@ inline arm_compute::Error error_on_nullptr(const char *function, const char *fil return (ptr == nullptr); }); ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG(has_nullptr, function, file, line, "Nullptr object!"); - return arm_compute::Error{}; + return arm_compute::Status{}; } #define ARM_COMPUTE_ERROR_ON_NULLPTR(...) \ ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_nullptr(__func__, __FILE__, __LINE__, __VA_ARGS__)) @@ -159,10 +159,10 @@ inline arm_compute::Error error_on_nullptr(const char *function, const char *fil * @param[in] full Full size window * @param[in] win Window to validate. * - * @return Error + * @return Status */ -arm_compute::Error error_on_mismatching_windows(const char *function, const char *file, const int line, - const Window &full, const Window &win); +arm_compute::Status error_on_mismatching_windows(const char *function, const char *file, const int line, + const Window &full, const Window &win); #define ARM_COMPUTE_ERROR_ON_MISMATCHING_WINDOWS(f, w) \ ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_mismatching_windows(__func__, __FILE__, __LINE__, f, w)) #define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_WINDOWS(f, w) \ @@ -181,10 +181,10 @@ arm_compute::Error error_on_mismatching_windows(const char *function, const char * @param[in] full Full size window * @param[in] sub Sub-window to validate. * - * @return Error + * @return Status */ -arm_compute::Error error_on_invalid_subwindow(const char *function, const char *file, const int line, - const Window &full, const Window &sub); +arm_compute::Status error_on_invalid_subwindow(const char *function, const char *file, const int line, + const Window &full, const Window &sub); #define ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(f, s) \ ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_invalid_subwindow(__func__, __FILE__, __LINE__, f, s)) #define ARM_COMPUTE_RETURN_ERROR_ON_INVALID_SUBWINDOW(f, s) \ @@ -201,10 +201,10 @@ arm_compute::Error error_on_invalid_subwindow(const char *function, const char * * @param[in] window Window to be collapsed. * @param[in] dim Dimension need to be checked. * - * @return Error + * @return Status */ -arm_compute::Error error_on_window_not_collapsable_at_dimension(const char *function, const char *file, const int line, - const Window &full, const Window &window, const int dim); +arm_compute::Status error_on_window_not_collapsable_at_dimension(const char *function, const char *file, const int line, + const Window &full, const Window &window, const int dim); #define ARM_COMPUTE_ERROR_ON_WINDOW_NOT_COLLAPSABLE_AT_DIMENSION(f, w, d) \ ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_window_not_collapsable_at_dimension(__func__, __FILE__, __LINE__, f, w, d)) #define ARM_COMPUTE_RETURN_ERROR_ON_WINDOW_NOT_COLLAPSABLE_AT_DIMENSION(f, w, d) \ @@ -220,10 +220,10 @@ arm_compute::Error error_on_window_not_collapsable_at_dimension(const char *func * @param[in] pos Coordinates to validate * @param[in] max_dim Maximum number of dimensions allowed. * - * @return Error + * @return Status */ -arm_compute::Error error_on_coordinates_dimensions_gte(const char *function, const char *file, const int line, - const Coordinates &pos, unsigned int max_dim); +arm_compute::Status error_on_coordinates_dimensions_gte(const char *function, const char *file, const int line, + const Coordinates &pos, unsigned int max_dim); #define ARM_COMPUTE_ERROR_ON_COORDINATES_DIMENSIONS_GTE(p, md) \ ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_coordinates_dimensions_gte(__func__, __FILE__, __LINE__, p, md)) #define ARM_COMPUTE_RETURN_ERROR_ON_COORDINATES_DIMENSIONS_GTE(p, md) \ @@ -239,10 +239,10 @@ arm_compute::Error error_on_coordinates_dimensions_gte(const char *function, con * @param[in] win Window to validate * @param[in] max_dim Maximum number of dimensions allowed. * - * @return Error + * @return Status */ -arm_compute::Error error_on_window_dimensions_gte(const char *function, const char *file, const int line, - const Window &win, unsigned int max_dim); +arm_compute::Status error_on_window_dimensions_gte(const char *function, const char *file, const int line, + const Window &win, unsigned int max_dim); #define ARM_COMPUTE_ERROR_ON_WINDOW_DIMENSIONS_GTE(w, md) \ ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_window_dimensions_gte(__func__, __FILE__, __LINE__, w, md)) #define ARM_COMPUTE_RETURN_ERROR_ON_WINDOW_DIMENSIONS_GTE(w, md) \ @@ -257,14 +257,14 @@ arm_compute::Error error_on_window_dimensions_gte(const char *function, const ch * @param[in] dim2 The second object to be compared. * @param[in] dims (Optional) Further allowed objects. * - * @return Error + * @return Status */ template <typename T, typename... Ts> -arm_compute::Error error_on_mismatching_dimensions(const char *function, const char *file, int line, - const Dimensions<T> &dim1, const Dimensions<T> &dim2, Ts &&... dims) +arm_compute::Status error_on_mismatching_dimensions(const char *function, const char *file, int line, + const Dimensions<T> &dim1, const Dimensions<T> &dim2, Ts &&... dims) { ARM_COMPUTE_RETURN_ON_ERROR(detail::for_each_error(detail::compare_dimension<T>(dim1, function, file, line), dim2, std::forward<Ts>(dims)...)); - return arm_compute::Error{}; + return arm_compute::Status{}; } #define ARM_COMPUTE_ERROR_ON_MISMATCHING_DIMENSIONS(...) \ ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_mismatching_dimensions(__func__, __FILE__, __LINE__, __VA_ARGS__)) @@ -280,11 +280,11 @@ arm_compute::Error error_on_mismatching_dimensions(const char *function, const c * @param[in] tensor_info_2 The second tensor info to be compared. * @param[in] tensor_infos (Optional) Further allowed tensor infos. * - * @return Error + * @return Status */ template <typename... Ts> -inline arm_compute::Error error_on_mismatching_shapes(const char *function, const char *file, const int line, - const ITensorInfo *tensor_info_1, const ITensorInfo *tensor_info_2, Ts... tensor_infos) +inline arm_compute::Status error_on_mismatching_shapes(const char *function, const char *file, const int line, + const ITensorInfo *tensor_info_1, const ITensorInfo *tensor_info_2, Ts... tensor_infos) { return error_on_mismatching_shapes(function, file, line, 0U, tensor_info_1, tensor_info_2, std::forward<Ts>(tensor_infos)...); } @@ -297,11 +297,11 @@ inline arm_compute::Error error_on_mismatching_shapes(const char *function, cons * @param[in] tensor_2 The second tensor to be compared. * @param[in] tensors (Optional) Further allowed tensors. * - * @return Error + * @return Status */ template <typename... Ts> -inline arm_compute::Error error_on_mismatching_shapes(const char *function, const char *file, const int line, - const ITensor *tensor_1, const ITensor *tensor_2, Ts... tensors) +inline arm_compute::Status error_on_mismatching_shapes(const char *function, const char *file, const int line, + const ITensor *tensor_1, const ITensor *tensor_2, Ts... tensors) { return error_on_mismatching_shapes(function, file, line, 0U, tensor_1, tensor_2, std::forward<Ts>(tensors)...); } @@ -315,11 +315,11 @@ inline arm_compute::Error error_on_mismatching_shapes(const char *function, cons * @param[in] tensor_info_2 The second tensor info to be compared. * @param[in] tensor_infos (Optional) Further allowed tensor infos. * - * @return Error + * @return Status */ template <typename... Ts> -inline arm_compute::Error error_on_mismatching_shapes(const char *function, const char *file, const int line, - unsigned int upper_dim, const ITensorInfo *tensor_info_1, const ITensorInfo *tensor_info_2, Ts... tensor_infos) +inline arm_compute::Status error_on_mismatching_shapes(const char *function, const char *file, const int line, + unsigned int upper_dim, const ITensorInfo *tensor_info_1, const ITensorInfo *tensor_info_2, Ts... tensor_infos) { ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor_info_1 == nullptr, function, file, line); ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor_info_2 == nullptr, function, file, line); @@ -331,7 +331,7 @@ inline arm_compute::Error error_on_mismatching_shapes(const char *function, cons return detail::have_different_dimensions((*tensors_info_array.cbegin())->tensor_shape(), tensor_info->tensor_shape(), upper_dim); }), function, file, line, "Tensors have different shapes"); - return arm_compute::Error{}; + return arm_compute::Status{}; } /** Return an error if the passed two tensors have different shapes from the given dimension * @@ -343,18 +343,18 @@ inline arm_compute::Error error_on_mismatching_shapes(const char *function, cons * @param[in] tensor_2 The second tensor to be compared. * @param[in] tensors (Optional) Further allowed tensors. * - * @return Error + * @return Status */ template <typename... Ts> -inline arm_compute::Error error_on_mismatching_shapes(const char *function, const char *file, const int line, - unsigned int upper_dim, const ITensor *tensor_1, const ITensor *tensor_2, Ts... tensors) +inline arm_compute::Status error_on_mismatching_shapes(const char *function, const char *file, const int line, + unsigned int upper_dim, const ITensor *tensor_1, const ITensor *tensor_2, Ts... tensors) { ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor_1 == nullptr, function, file, line); ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor_2 == nullptr, function, file, line); ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_nullptr(function, file, line, std::forward<Ts>(tensors)...)); ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_mismatching_shapes(function, file, line, upper_dim, tensor_1->info(), tensor_2->info(), detail::get_tensor_info_t<ITensorInfo *>()(tensors)...)); - return arm_compute::Error{}; + return arm_compute::Status{}; } #define ARM_COMPUTE_ERROR_ON_MISMATCHING_SHAPES(...) \ ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_mismatching_shapes(__func__, __FILE__, __LINE__, __VA_ARGS__)) @@ -369,11 +369,11 @@ inline arm_compute::Error error_on_mismatching_shapes(const char *function, cons * @param[in] tensor_info The first tensor info to be compared. * @param[in] tensor_infos (Optional) Further allowed tensor infos. * - * @return Error + * @return Status */ template <typename... Ts> -inline arm_compute::Error error_on_mismatching_data_types(const char *function, const char *file, const int line, - const ITensorInfo *tensor_info, Ts... tensor_infos) +inline arm_compute::Status error_on_mismatching_data_types(const char *function, const char *file, const int line, + const ITensorInfo *tensor_info, Ts... tensor_infos) { ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor_info == nullptr, function, file, line); ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_nullptr(function, file, line, std::forward<Ts>(tensor_infos)...)); @@ -385,7 +385,7 @@ inline arm_compute::Error error_on_mismatching_data_types(const char *function, return tensor_info_obj->data_type() != tensor_data_type; }), function, file, line, "Tensors have different data types"); - return arm_compute::Error{}; + return arm_compute::Status{}; } /** Return an error if the passed two tensors have different data types * @@ -395,17 +395,17 @@ inline arm_compute::Error error_on_mismatching_data_types(const char *function, * @param[in] tensor The first tensor to be compared. * @param[in] tensors (Optional) Further allowed tensors. * - * @return Error + * @return Status */ template <typename... Ts> -inline arm_compute::Error error_on_mismatching_data_types(const char *function, const char *file, const int line, - const ITensor *tensor, Ts... tensors) +inline arm_compute::Status error_on_mismatching_data_types(const char *function, const char *file, const int line, + const ITensor *tensor, Ts... tensors) { ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor == nullptr, function, file, line); ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_nullptr(function, file, line, std::forward<Ts>(tensors)...)); ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_mismatching_data_types(function, file, line, tensor->info(), detail::get_tensor_info_t<ITensorInfo *>()(tensors)...)); - return arm_compute::Error{}; + return arm_compute::Status{}; } #define ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES(...) \ ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_mismatching_data_types(__func__, __FILE__, __LINE__, __VA_ARGS__)) @@ -423,18 +423,18 @@ inline arm_compute::Error error_on_mismatching_data_types(const char *function, * @param[in] tensor_info_2 The second tensor info to be compared. * @param[in] tensor_infos (Optional) Further allowed tensor infos. * - * @return Error + * @return Status */ template <typename... Ts> -inline arm_compute::Error error_on_mismatching_fixed_point(const char *function, const char *file, const int line, - const ITensorInfo *tensor_info_1, const ITensorInfo *tensor_info_2, Ts... tensor_infos) +inline arm_compute::Status error_on_mismatching_fixed_point(const char *function, const char *file, const int line, + const ITensorInfo *tensor_info_1, const ITensorInfo *tensor_info_2, Ts... tensor_infos) { DataType &&first_data_type = tensor_info_1->data_type(); const int first_fixed_point_position = tensor_info_1->fixed_point_position(); if(!is_data_type_fixed_point(first_data_type)) { - return arm_compute::Error{}; + return arm_compute::Status{}; } const std::array < const ITensorInfo *, 1 + sizeof...(Ts) > tensor_infos_array{ { tensor_info_2, std::forward<Ts>(tensor_infos)... } }; @@ -449,7 +449,7 @@ inline arm_compute::Error error_on_mismatching_fixed_point(const char *function, }), function, file, line, "Tensors have different fixed point positions"); - return arm_compute::Error{}; + return arm_compute::Status{}; } /** Return an error if the passed tensor have different fixed point data types or different fixed point positions * @@ -462,15 +462,15 @@ inline arm_compute::Error error_on_mismatching_fixed_point(const char *function, * @param[in] tensor_2 The second tensor to be compared. * @param[in] tensors (Optional) Further allowed tensors. * - * @return Error + * @return Status */ template <typename... Ts> -inline arm_compute::Error error_on_mismatching_fixed_point(const char *function, const char *file, const int line, - const ITensor *tensor_1, const ITensor *tensor_2, Ts... tensors) +inline arm_compute::Status error_on_mismatching_fixed_point(const char *function, const char *file, const int line, + const ITensor *tensor_1, const ITensor *tensor_2, Ts... tensors) { ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_mismatching_fixed_point(function, file, line, tensor_1->info(), tensor_2->info(), detail::get_tensor_info_t<ITensorInfo *>()(tensors)...)); - return arm_compute::Error{}; + return arm_compute::Status{}; } #define ARM_COMPUTE_ERROR_ON_MISMATCHING_FIXED_POINT(...) \ ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_mismatching_fixed_point(__func__, __FILE__, __LINE__, __VA_ARGS__)) @@ -488,18 +488,18 @@ inline arm_compute::Error error_on_mismatching_fixed_point(const char *function, * @param[in] tensor_info_2 The second tensor info to be compared. * @param[in] tensor_infos (Optional) Further allowed tensor infos. * - * @return Error + * @return Status */ template <typename... Ts> -inline arm_compute::Error error_on_mismatching_quantization_info(const char *function, const char *file, const int line, - const ITensorInfo *tensor_info_1, const ITensorInfo *tensor_info_2, Ts... tensor_infos) +inline arm_compute::Status error_on_mismatching_quantization_info(const char *function, const char *file, const int line, + const ITensorInfo *tensor_info_1, const ITensorInfo *tensor_info_2, Ts... tensor_infos) { DataType &&first_data_type = tensor_info_1->data_type(); const QuantizationInfo first_quantization_info = tensor_info_1->quantization_info(); if(!is_data_type_quantized_asymmetric(first_data_type)) { - return arm_compute::Error{}; + return arm_compute::Status{}; } const std::array < const ITensorInfo *, 1 + sizeof...(Ts) > tensor_infos_array{ { tensor_info_2, std::forward<Ts>(tensor_infos)... } }; @@ -514,7 +514,7 @@ inline arm_compute::Error error_on_mismatching_quantization_info(const char *fun }), function, file, line, "Tensors have different quantization information"); - return arm_compute::Error{}; + return arm_compute::Status{}; } /** Return an error if the passed tensor have different asymmetric quantized data types or different quantization info * @@ -527,15 +527,15 @@ inline arm_compute::Error error_on_mismatching_quantization_info(const char *fun * @param[in] tensor_2 The second tensor to be compared. * @param[in] tensors (Optional) Further allowed tensors. * - * @return Error + * @return Status */ template <typename... Ts> -inline arm_compute::Error error_on_mismatching_quantization_info(const char *function, const char *file, const int line, - const ITensor *tensor_1, const ITensor *tensor_2, Ts... tensors) +inline arm_compute::Status error_on_mismatching_quantization_info(const char *function, const char *file, const int line, + const ITensor *tensor_1, const ITensor *tensor_2, Ts... tensors) { ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_mismatching_quantization_info(function, file, line, tensor_1->info(), tensor_2->info(), detail::get_tensor_info_t<ITensorInfo *>()(tensors)...)); - return arm_compute::Error{}; + return arm_compute::Status{}; } #define ARM_COMPUTE_ERROR_ON_MISMATCHING_QUANTIZATION_INFO(...) \ ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_mismatching_quantization_info(__func__, __FILE__, __LINE__, __VA_ARGS__)) @@ -582,11 +582,11 @@ void error_on_format_not_in(const char *function, const char *file, const int li * @param[in] dt First data type allowed. * @param[in] dts (Optional) Further allowed data types. * - * @return Error + * @return Status */ template <typename T, typename... Ts> -inline arm_compute::Error error_on_data_type_not_in(const char *function, const char *file, const int line, - const ITensorInfo *tensor_info, T &&dt, Ts &&... dts) +inline arm_compute::Status error_on_data_type_not_in(const char *function, const char *file, const int line, + const ITensorInfo *tensor_info, T &&dt, Ts &&... dts) { ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor_info == nullptr, function, file, line); @@ -599,7 +599,7 @@ inline arm_compute::Error error_on_data_type_not_in(const char *function, const return d == tensor_dt; }), function, file, line, "ITensor data type %s not supported by this kernel", string_from_data_type(tensor_dt).c_str()); - return arm_compute::Error{}; + return arm_compute::Status{}; } /** Return an error if the data type of the passed tensor does not match any of the data types provided. * @@ -610,15 +610,15 @@ inline arm_compute::Error error_on_data_type_not_in(const char *function, const * @param[in] dt First data type allowed. * @param[in] dts (Optional) Further allowed data types. * - * @return Error + * @return Status */ template <typename T, typename... Ts> -inline arm_compute::Error error_on_data_type_not_in(const char *function, const char *file, const int line, - const ITensor *tensor, T &&dt, Ts &&... dts) +inline arm_compute::Status error_on_data_type_not_in(const char *function, const char *file, const int line, + const ITensor *tensor, T &&dt, Ts &&... dts) { ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor == nullptr, function, file, line); ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_data_type_not_in(function, file, line, tensor->info(), std::forward<T>(dt), std::forward<Ts>(dts)...)); - return arm_compute::Error{}; + return arm_compute::Status{}; } #define ARM_COMPUTE_ERROR_ON_DATA_TYPE_NOT_IN(t, ...) \ ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_data_type_not_in(__func__, __FILE__, __LINE__, t, __VA_ARGS__)) @@ -635,16 +635,16 @@ inline arm_compute::Error error_on_data_type_not_in(const char *function, const * @param[in] dt First data type allowed. * @param[in] dts (Optional) Further allowed data types. * - * @return Error + * @return Status */ template <typename T, typename... Ts> -inline arm_compute::Error error_on_data_type_channel_not_in(const char *function, const char *file, const int line, - const ITensorInfo *tensor_info, size_t num_channels, T &&dt, Ts &&... dts) +inline arm_compute::Status error_on_data_type_channel_not_in(const char *function, const char *file, const int line, + const ITensorInfo *tensor_info, size_t num_channels, T &&dt, Ts &&... dts) { ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_data_type_not_in(function, file, line, tensor_info, std::forward<T>(dt), std::forward<Ts>(dts)...)); const size_t tensor_nc = tensor_info->num_channels(); ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG(tensor_nc != num_channels, function, file, line, "Number of channels %d. Required number of channels %d", tensor_nc, num_channels); - return arm_compute::Error{}; + return arm_compute::Status{}; } /** Return an error if the data type or the number of channels of the passed tensor does not match any of the data types and number of channels provided. * @@ -656,15 +656,15 @@ inline arm_compute::Error error_on_data_type_channel_not_in(const char *function * @param[in] dt First data type allowed. * @param[in] dts (Optional) Further allowed data types. * - * @return Error + * @return Status */ template <typename T, typename... Ts> -inline arm_compute::Error error_on_data_type_channel_not_in(const char *function, const char *file, const int line, - const ITensor *tensor, size_t num_channels, T &&dt, Ts &&... dts) +inline arm_compute::Status error_on_data_type_channel_not_in(const char *function, const char *file, const int line, + const ITensor *tensor, size_t num_channels, T &&dt, Ts &&... dts) { ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor == nullptr, function, file, line); ARM_COMPUTE_RETURN_ON_ERROR(error_on_data_type_channel_not_in(function, file, line, tensor->info(), num_channels, std::forward<T>(dt), std::forward<Ts>(dts)...)); - return arm_compute::Error{}; + return arm_compute::Status{}; } #define ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(t, c, ...) \ ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_data_type_channel_not_in(__func__, __FILE__, __LINE__, t, c, __VA_ARGS__)) @@ -678,10 +678,10 @@ inline arm_compute::Error error_on_data_type_channel_not_in(const char *function * @param[in] line Line on which the error occurred. * @param[in] tensor Tensor to validate. * - * @return Error + * @return Status */ -arm_compute::Error error_on_tensor_not_2d(const char *function, const char *file, const int line, - const ITensor *tensor); +arm_compute::Status error_on_tensor_not_2d(const char *function, const char *file, const int line, + const ITensor *tensor); #define ARM_COMPUTE_ERROR_ON_TENSOR_NOT_2D(t) \ ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_tensor_not_2d(__func__, __FILE__, __LINE__, t)) #define ARM_COMPUTE_RETURN_ERROR_ON_TENSOR_NOT_2D(t) \ @@ -696,11 +696,11 @@ arm_compute::Error error_on_tensor_not_2d(const char *function, const char *file * @param[in] channel First channel allowed. * @param[in] channels (Optional) Further allowed channels. * - * @return Error + * @return Status */ template <typename T, typename... Ts> -inline arm_compute::Error error_on_channel_not_in(const char *function, const char *file, const int line, - T cn, T &&channel, Ts &&... channels) +inline arm_compute::Status error_on_channel_not_in(const char *function, const char *file, const int line, + T cn, T &&channel, Ts &&... channels) { ARM_COMPUTE_RETURN_ERROR_ON_LOC(cn == Channel::UNKNOWN, function, file, line); @@ -710,7 +710,7 @@ inline arm_compute::Error error_on_channel_not_in(const char *function, const ch return f == cn; }), function, file, line); - return arm_compute::Error{}; + return arm_compute::Status{}; } #define ARM_COMPUTE_ERROR_ON_CHANNEL_NOT_IN(c, ...) \ ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_channel_not_in(__func__, __FILE__, __LINE__, c, __VA_ARGS__)) @@ -725,10 +725,10 @@ inline arm_compute::Error error_on_channel_not_in(const char *function, const ch * @param[in] fmt Input channel * @param[in] cn First channel allowed. * - * @return Error + * @return Status */ -arm_compute::Error error_on_channel_not_in_known_format(const char *function, const char *file, const int line, - Format fmt, Channel cn); +arm_compute::Status error_on_channel_not_in_known_format(const char *function, const char *file, const int line, + Format fmt, Channel cn); #define ARM_COMPUTE_ERROR_ON_CHANNEL_NOT_IN_KNOWN_FORMAT(f, c) \ ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_channel_not_in_known_format(__func__, __FILE__, __LINE__, f, c)) #define ARM_COMPUTE_RETURN_ERROR_ON_CHANNEL_NOT_IN_KNOWN_FORMAT(f, c) \ @@ -747,10 +747,10 @@ arm_compute::Error error_on_channel_not_in_known_format(const char *function, co * @param[in] line Line on which the error occurred. * @param[in] multi_hog IMultiHOG container to validate * - * @return Error + * @return Status */ -arm_compute::Error error_on_invalid_multi_hog(const char *function, const char *file, const int line, - const IMultiHOG *multi_hog); +arm_compute::Status error_on_invalid_multi_hog(const char *function, const char *file, const int line, + const IMultiHOG *multi_hog); #define ARM_COMPUTE_ERROR_ON_INVALID_MULTI_HOG(m) \ ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_invalid_multi_hog(__func__, __FILE__, __LINE__, m)) #define ARM_COMPUTE_RETURN_ERROR_ON_INVALID_MULTI_HOG(m) \ @@ -763,8 +763,8 @@ arm_compute::Error error_on_invalid_multi_hog(const char *function, const char * * @param[in] line Line on which the error occurred. * @param[in] kernel Kernel to validate. */ -arm_compute::Error error_on_unconfigured_kernel(const char *function, const char *file, const int line, - const IKernel *kernel); +arm_compute::Status error_on_unconfigured_kernel(const char *function, const char *file, const int line, + const IKernel *kernel); #define ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(k) \ ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_unconfigured_kernel(__func__, __FILE__, __LINE__, k)) #define ARM_COMPUTE_RETURN_ERROR_ON_UNCONFIGURED_KERNEL(k) \ @@ -779,10 +779,10 @@ arm_compute::Error error_on_unconfigured_kernel(const char *function, const char * @param[in] coords Coordinates inside the parent tensor where the first element of the subtensor is * @param[in] shape Shape of the subtensor * - * @return Error + * @return Status */ -arm_compute::Error error_on_invalid_subtensor(const char *function, const char *file, const int line, - const TensorShape &parent_shape, const Coordinates &coords, const TensorShape &shape); +arm_compute::Status error_on_invalid_subtensor(const char *function, const char *file, const int line, + const TensorShape &parent_shape, const Coordinates &coords, const TensorShape &shape); #define ARM_COMPUTE_ERROR_ON_INVALID_SUBTENSOR(p, c, s) \ ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_invalid_subtensor(__func__, __FILE__, __LINE__, p, c, s)) #define ARM_COMPUTE_RETURN_ERROR_ON_INVALID_SUBTENSOR(p, c, s) \ @@ -796,10 +796,10 @@ arm_compute::Error error_on_invalid_subtensor(const char *function, const char * * @param[in] parent_valid_region Parent valid region. * @param[in] valid_region Valid region of subtensor. * - * @return Error + * @return Status */ -arm_compute::Error error_on_invalid_subtensor_valid_region(const char *function, const char *file, const int line, - const ValidRegion &parent_valid_region, const ValidRegion &valid_region); +arm_compute::Status error_on_invalid_subtensor_valid_region(const char *function, const char *file, const int line, + const ValidRegion &parent_valid_region, const ValidRegion &valid_region); #define ARM_COMPUTE_ERROR_ON_INVALID_SUBTENSOR_VALID_REGION(pv, sv) \ ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_invalid_subtensor_valid_region(__func__, __FILE__, __LINE__, pv, sv)) #define ARM_COMPUTE_RETURN_ERROR_ON_INVALID_SUBTENSOR_VALID_REGION(pv, sv) \ @@ -814,11 +814,11 @@ arm_compute::Error error_on_invalid_subtensor_valid_region(const char *function, * @param[in] tensor_info_2 The second tensor info to be compared. * @param[in] tensor_infos (Optional) Further allowed tensor infos. * - * @return Error + * @return Status */ template <typename... Ts> -inline arm_compute::Error error_on_mismatching_fixed_point_position(const char *function, const char *file, const int line, - const ITensorInfo *tensor_info_1, const ITensorInfo *tensor_info_2, Ts... tensor_infos) +inline arm_compute::Status error_on_mismatching_fixed_point_position(const char *function, const char *file, const int line, + const ITensorInfo *tensor_info_1, const ITensorInfo *tensor_info_2, Ts... tensor_infos) { const std::array < const ITensorInfo *, 1 + sizeof...(Ts) > tensor_info_array{ { tensor_info_2, std::forward<Ts>(tensor_infos)... } }; ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG(std::any_of(tensor_info_array.begin(), tensor_info_array.end(), [&](const ITensorInfo * tensor_info) @@ -826,7 +826,7 @@ inline arm_compute::Error error_on_mismatching_fixed_point_position(const char * return tensor_info->fixed_point_position() != tensor_info_1->fixed_point_position(); }), function, file, line, "Tensors have different fixed-point positions"); - return arm_compute::Error{}; + return arm_compute::Status{}; } /** Return an error if the input fixed-point positions are different. * @@ -837,15 +837,15 @@ inline arm_compute::Error error_on_mismatching_fixed_point_position(const char * * @param[in] tensor_2 The second tensor to be compared. * @param[in] tensors (Optional) Further allowed tensors. * - * @return Error + * @return Status */ template <typename... Ts> -inline arm_compute::Error error_on_mismatching_fixed_point_position(const char *function, const char *file, const int line, - const ITensor *tensor_1, const ITensor *tensor_2, Ts... tensors) +inline arm_compute::Status error_on_mismatching_fixed_point_position(const char *function, const char *file, const int line, + const ITensor *tensor_1, const ITensor *tensor_2, Ts... tensors) { ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_mismatching_fixed_point_position(function, file, line, tensor_1->info(), tensor_2->info(), detail::get_tensor_info_t<ITensorInfo *>()(tensors)...)); - return arm_compute::Error{}; + return arm_compute::Status{}; } #define ARM_COMPUTE_ERROR_ON_MISMATCHING_FIXED_POINT_POSITION(...) \ ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_mismatching_fixed_point_position(__func__, __FILE__, __LINE__, __VA_ARGS__)) @@ -860,10 +860,10 @@ inline arm_compute::Error error_on_mismatching_fixed_point_position(const char * * @param[in] value The floating point value to be checked. * @param[in] tensor_info Input tensor info that has information on data type and fixed-point position. * - * @return Error + * @return Status */ -inline arm_compute::Error error_on_value_not_representable_in_fixed_point(const char *function, const char *file, int line, - float value, const ITensorInfo *tensor_info) +inline arm_compute::Status error_on_value_not_representable_in_fixed_point(const char *function, const char *file, int line, + float value, const ITensorInfo *tensor_info) { const int fixed_point_position = tensor_info->fixed_point_position(); const DataType dt = tensor_info->data_type(); @@ -872,7 +872,7 @@ inline arm_compute::Error error_on_value_not_representable_in_fixed_point(const ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG(value > max_range, function, file, line, "Value %f is not representable in %s with fixed-point position %d", value, string_from_data_type(dt).c_str(), fixed_point_position); - return arm_compute::Error{}; + return arm_compute::Status{}; } /** Return an error an error if the fixed-point value is not representable in the specified Q format. * @@ -882,14 +882,14 @@ inline arm_compute::Error error_on_value_not_representable_in_fixed_point(const * @param[in] value The floating point value to be checked. * @param[in] tensor Input tensor that has information on data type and fixed-point position. * - * @return Error + * @return Status */ -inline arm_compute::Error error_on_value_not_representable_in_fixed_point(const char *function, const char *file, int line, - float value, const ITensor *tensor) +inline arm_compute::Status error_on_value_not_representable_in_fixed_point(const char *function, const char *file, int line, + float value, const ITensor *tensor) { ARM_COMPUTE_RETURN_ERROR_ON_LOC(tensor == nullptr, function, file, line); ARM_COMPUTE_RETURN_ON_ERROR(::arm_compute::error_on_value_not_representable_in_fixed_point(function, file, line, value, tensor->info())); - return arm_compute::Error{}; + return arm_compute::Status{}; } #define ARM_COMPUTE_ERROR_ON_VALUE_NOT_REPRESENTABLE_IN_FIXED_POINT(...) \ ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_value_not_representable_in_fixed_point(__func__, __FILE__, __LINE__, __VA_ARGS__)) |