MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / elemWiseEq

Function elemWiseEq

test/arrayfire_test.cpp:1751–1774  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1749
1750template<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
1776struct absMatch {
1777 float diff_;

Callers

nothing calls this directly

Calls 11

unravelIdxFunction · 0.85
minimalDim4Function · 0.85
printContextFunction · 0.85
absMatchClass · 0.85
hostMethod · 0.80
calcStridesFunction · 0.70
absFunction · 0.70
distanceFunction · 0.50
diffFunction · 0.50
dimsMethod · 0.45
elementsMethod · 0.45

Tested by

no test coverage detected