diff --git a/sycl/test-e2e/Matrix/common.hpp b/sycl/test-e2e/Matrix/common.hpp index fa284542b40a6..675261a17f3cb 100644 --- a/sycl/test-e2e/Matrix/common.hpp +++ b/sycl/test-e2e/Matrix/common.hpp @@ -146,7 +146,9 @@ bool matrix_compare(unsigned int rows, unsigned int cols, T1 *src, T2 *ref) { for (int i = 0; i < rows; i++) { for (int j = 0; j < cols; j++) { if constexpr (!exact && (std::is_same_v || - std::is_same_v)) { + std::is_same_v || + (std::is_same_v && + std::is_same_v))) { float diff = std::fabs(src[i * cols + j] - (T1)ref[i * cols + j]); if (diff > FLOAT_EPSILON || std::isnan(src[i * cols + j])) { std::cout << "Incorrect result in matrix. "