Commit 7f9e01d0 authored by Shucai Xiao's avatar Shucai Xiao
Browse files

fix cpu and gpu execution mismatch.

parent 11a0f1a9
......@@ -23,7 +23,7 @@ void convert(hipStream_t stream,
float res = input_ptr[i] * scale + shift;
int factor = (res > 0) ? 1 : -1;
output_ptr[i] =
std::min<int8_t>(std::max<float>(-128, res + factor * 0.5), 127);
static_cast<int8_t>(std::min<float>(std::max<float>(-128.0f, res + factor * 0.5), 127.0f));
});
}
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment