BLIS GTestSuite Updates:

- Fix in README.md.
- Updating abs overload for scomplex and dcomplex to avoid overflow by using std::abs.
- Updating comparators to take into account NaNs and Infs when measuring error.

AMD-Internal: [CPUPL-2732]
Change-Id: I8c12bacd9d63b2e914d0a79f337f7525dc16b733
This commit is contained in:
Eleni Vlachopoulou
2023-03-28 21:56:39 +05:30
committed by Eleni Vlachopoulou
parent f9adfa8ee4
commit bf3f5cafa8
6 changed files with 515 additions and 54 deletions

View File

@@ -60,4 +60,23 @@ bool operator== (const scomplex x, const scomplex y);
bool operator== (const dcomplex x, const dcomplex y);
bool operator!= (const scomplex x, const scomplex y);
bool operator!= (const dcomplex x, const dcomplex y);
bool operator!= (const dcomplex x, const dcomplex y);
// Since we may only specialise template functions and classes
// in the std namespace for custom types, and std::to_string is not
// a template function, we put to_string into our namespace.
namespace testinghelpers {
template<typename T>
std::string to_string(const T& x) {
if constexpr (testinghelpers::type_info<T>::is_complex)
{
std::string ss = "(" + std::to_string(x.real) + ", " + std::to_string(x.imag) + ")";
return ss;
}
else
{
return std::to_string(x);
}
}
}