mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-05-14 02:02:46 +00:00
Gemm test return value (#148)
* Add return value
* Replace _Float16 to ck::half_t
* A test should return 0 if success and return non-zero if fail
[ROCm/composable_kernel commit: 3ba149328f]
This commit is contained in:
@@ -113,4 +113,5 @@ int main()
|
||||
}
|
||||
|
||||
std::cout << "TestGemm ..... " << (res ? "SUCCESS" : "FAILURE") << std::endl;
|
||||
return res ? 0 : 1;
|
||||
}
|
||||
|
||||
@@ -151,4 +151,5 @@ int main()
|
||||
}
|
||||
|
||||
std::cout << "TestGemm ..... " << (res ? "SUCCESS" : "FAILURE") << std::endl;
|
||||
return res ? 0 : 1;
|
||||
}
|
||||
|
||||
@@ -151,4 +151,5 @@ int main()
|
||||
}
|
||||
|
||||
std::cout << "TestGemm ..... " << (res ? "SUCCESS" : "FAILURE") << std::endl;
|
||||
return res ? 0 : 1;
|
||||
}
|
||||
|
||||
@@ -129,4 +129,5 @@ int main()
|
||||
}
|
||||
|
||||
std::cout << "TestGemm ..... " << (res ? "SUCCESS" : "FAILURE") << std::endl;
|
||||
return res ? 0 : 1;
|
||||
}
|
||||
|
||||
@@ -105,11 +105,11 @@ check_err(const std::vector<T>& out,
|
||||
return res;
|
||||
}
|
||||
|
||||
bool check_err(const std::vector<_Float16>& out,
|
||||
const std::vector<_Float16>& ref,
|
||||
bool check_err(const std::vector<ck::half_t>& out,
|
||||
const std::vector<ck::half_t>& ref,
|
||||
const std::string& msg,
|
||||
_Float16 rtol = static_cast<_Float16>(1e-3f),
|
||||
_Float16 atol = static_cast<_Float16>(1e-3f))
|
||||
ck::half_t rtol = static_cast<ck::half_t>(1e-3f),
|
||||
ck::half_t atol = static_cast<ck::half_t>(1e-3f))
|
||||
{
|
||||
if(out.size() != ref.size())
|
||||
{
|
||||
@@ -122,7 +122,7 @@ bool check_err(const std::vector<_Float16>& out,
|
||||
bool res{true};
|
||||
int err_count = 0;
|
||||
double err = 0;
|
||||
double max_err = std::numeric_limits<_Float16>::min();
|
||||
double max_err = std::numeric_limits<ck::half_t>::min();
|
||||
for(std::size_t i = 0; i < ref.size(); ++i)
|
||||
{
|
||||
double out_ = double(out[i]);
|
||||
|
||||
Reference in New Issue
Block a user