26 #ifndef LBANN_UNIT_TEST_UTILITIES_MATRIX_HELPERS_HPP_INCLUDED 27 #define LBANN_UNIT_TEST_UTILITIES_MATRIX_HELPERS_HPP_INCLUDED 35 Matrix<T, Device::CPU>
const& B)
36 #ifdef HYDROGEN_RELEASE_BUILD 40 using IdxT = decltype(A.Height());
47 auto const A_height = A.Height(), A_width = A.Width();
48 if ((A_height != B.Height()) || (A_width != B.Width()))
51 for (IdxT col = To<IdxT>(0); col < A_width; ++col)
52 for (IdxT row = To<IdxT>(0); row < A_height; ++row)
53 if (A.CRef(row, col) != B.CRef(row, col))
70 template <
typename S,
typename T>
71 bool operator==(AbstractMatrix<S>
const& A, AbstractMatrix<T>
const& B) noexcept
77 bool operator==(AbstractMatrix<T>
const& A, AbstractMatrix<T>
const& B)
78 #ifdef HYDROGEN_RELEASE_BUILD 82 using Proxy = AbstractMatrixReadDeviceProxy<T, Device::CPU>;
86 if ((A.GetDevice() != B.GetDevice()) || (A.Height() != B.Height()) ||
87 (A.Width() != B.Width()))
97 template <
typename S,
typename T>
99 AbstractDistMatrix<T>
const& B) noexcept
104 template <
typename T>
106 AbstractDistMatrix<T>
const& B) noexcept
108 return ((A.DistData() == B.DistData()) &&
109 (A.LockedMatrix() == B.LockedMatrix()));
113 #endif // LBANN_UNIT_TEST_UTILITIES_MATRIX_HELPERS_HPP_INCLUDED
bool operator==(AbstractMatrix< S > const &A, AbstractMatrix< T > const &B) noexcept
bool compare_values(Matrix< T, Device::CPU > const &A, Matrix< T, Device::CPU > const &B)