Commit 6880afdf authored by letaoqin's avatar letaoqin
Browse files

fix int8 overflow

parent ad77ce8e
...@@ -11,7 +11,7 @@ bool run_convnd_fwd_dl_example(int argc, char* argv[]) ...@@ -11,7 +11,7 @@ bool run_convnd_fwd_dl_example(int argc, char* argv[])
bool time_kernel = false; bool time_kernel = false;
ck::utils::conv::ConvParam conv_param{ ck::utils::conv::ConvParam conv_param{
2, 1, 128, 128, 192, {3, 3}, {14, 14}, {1, 1}, {1, 1}, {0, 0}, {0, 0}}; 2, 1, 128, 256, 192, {3, 3}, {71, 71}, {2, 2}, {1, 1}, {1, 1}, {1, 1}};
if(argc == 1) if(argc == 1)
{ {
......
...@@ -192,8 +192,8 @@ struct AddRelu ...@@ -192,8 +192,8 @@ struct AddRelu
__host__ __device__ constexpr void __host__ __device__ constexpr void
operator()<int, int, int8_t>(int& y, const int& x0, const int8_t& x1) const operator()<int, int, int8_t>(int& y, const int& x0, const int8_t& x1) const
{ {
const int a = x0 + x1; const int8_t a = x0 + x1;
y = a > 0 ? a : 0; y = a > 0 ? a : 0;
}; };
template <> template <>
......
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