Added GTestSuite helper functions

- Functions to convert to cblas enums from char.
- Functions to print matrix and vector elements.
- Functions to set matrix and vector elements with
  the given value.

AMD-Internal: [CPUPL-2732]
Change-Id: I1046b9578c8456e89eddba4a4e8577016b9361ca
This commit is contained in:
jagar
2023-04-11 16:30:37 +05:30
committed by Eleni Vlachopoulou
parent 6b8f4744a4
commit f164c7fe70
60 changed files with 450 additions and 751 deletions

View File

@@ -62,14 +62,14 @@ bool operator== (const dcomplex x, const dcomplex y);
bool operator!= (const scomplex x, const scomplex 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
// 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>
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;
}