diff --git a/adapters/opencv/kleidicv_hal.cpp b/adapters/opencv/kleidicv_hal.cpp index b62f736bcb7ae0ab92679ea82cd329aa8741de8b..2fa3c244db08ee6c5bf99dc53ca5e431c6e95130 100644 --- a/adapters/opencv/kleidicv_hal.cpp +++ b/adapters/opencv/kleidicv_hal.cpp @@ -1023,6 +1023,12 @@ int sum(const uchar *src_data, size_t src_step, int src_type, size_t width, int rotate(int src_type, const uchar *src_data, size_t src_step, int src_width, int src_height, uchar *dst_data, size_t dst_step, int angle) { int element_size = CV_ELEM_SIZE(src_type); +#if !KLEIDICV_ENABLE_ALL_OPENCV_HAL + // KleidiCV has regression on some devices for 4-byte and 8-byte element size + if ((element_size != 1) && (element_size != 2)) { + return CV_HAL_ERROR_NOT_IMPLEMENTED; + } +#endif // KLEIDICV_ENABLE_ALL_OPENCV_HAL int multithread_min_elements = 0; switch (element_size) { diff --git a/test/api/test_rotate_thread.cpp b/test/api/test_rotate_thread.cpp index 4268bb8576c2baeca6e8f205a9a1352ea317072f..9f3d38edef52a7f303ab43479af0a8b616350958 100644 --- a/test/api/test_rotate_thread.cpp +++ b/test/api/test_rotate_thread.cpp @@ -75,9 +75,9 @@ class RotateThread : public testing::TestWithParam { size_t height, size_t stride, size_t element_size) const { for (size_t i = 0; i < height; i++) { - for (size_t j = 0; j < width * element_size; j++) { - ASSERT_EQ(lhs[i * stride + j], rhs[i * stride + j]); - } + ASSERT_EQ( + std::memcmp(lhs + i * stride, rhs + i * stride, width * element_size), + 0); } } };