| 1749 | |
| 1750 | template<typename T> |
| 1751 | ::testing::AssertionResult elemWiseEq(std::string aName, std::string bName, |
| 1752 | const std::vector<T> &a, af::dim4 aDims, |
| 1753 | const std::vector<T> &b, af::dim4 bDims, |
| 1754 | float maxAbsDiff, IntegerTag) { |
| 1755 | UNUSED(maxAbsDiff); |
| 1756 | typedef typename std::vector<T>::const_iterator iter; |
| 1757 | |
| 1758 | std::pair<iter, iter> mismatches = |
| 1759 | std::mismatch(a.begin(), a.end(), b.begin()); |
| 1760 | iter bItr = mismatches.second; |
| 1761 | |
| 1762 | if (bItr == b.end()) { |
| 1763 | return ::testing::AssertionSuccess(); |
| 1764 | } else { |
| 1765 | dim_t idx = std::distance(b.begin(), bItr); |
| 1766 | af::dim4 aStrides = calcStrides(aDims); |
| 1767 | af::dim4 bStrides = calcStrides(bDims); |
| 1768 | af::dim4 coords = unravelIdx(idx, bDims, bStrides); |
| 1769 | |
| 1770 | return ::testing::AssertionFailure() |
| 1771 | << "VALUE DIFFERS at " << minimalDim4(coords, aDims) << ":\n" |
| 1772 | << printContext(a, aName, b, bName, aDims, aStrides, idx); |
| 1773 | } |
| 1774 | } |
| 1775 | |
| 1776 | struct absMatch { |
| 1777 | float diff_; |
nothing calls this directly
no test coverage detected