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
This commit is contained in:
rocking5566
2022-03-25 05:26:14 +08:00
committed by GitHub
parent 12f4cfce96
commit 3ba149328f
5 changed files with 9 additions and 5 deletions

View File

@@ -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]);