提交 6333a263 编写于 作者: W Wiktor Adamski

Replaced if with select().

上级 4418e030
...@@ -53,16 +53,15 @@ __kernel void pad(OUT_OF_RANGE_PARAMS ...@@ -53,16 +53,15 @@ __kernel void pad(OUT_OF_RANGE_PARAMS
} else { } else {
const int diff_right = width_idx - input_padded_width; const int diff_right = width_idx - input_padded_width;
if (diff_right >= 0) { w = select(
-diff_left,
#if PAD_TYPE == 1 #if PAD_TYPE == 1
w = input_width - diff_right - 2; input_width - diff_right - 2,
#else #else
w = input_width - diff_right - 1; input_width - diff_right - 1,
#endif #endif
diff_right >= 0
} else { );
w = -diff_left;
}
} }
const int diff_up = height_padding - height_idx; const int diff_up = height_padding - height_idx;
...@@ -77,16 +76,15 @@ __kernel void pad(OUT_OF_RANGE_PARAMS ...@@ -77,16 +76,15 @@ __kernel void pad(OUT_OF_RANGE_PARAMS
} else { } else {
const int diff_down = height_idx - input_padded_height; const int diff_down = height_idx - input_padded_height;
if (diff_down >= 0) { h = select(
-diff_up,
#if PAD_TYPE == 1 #if PAD_TYPE == 1
h = input_height - diff_down - 2; input_height - diff_down - 2,
#else #else
h = input_height - diff_down - 1; input_height - diff_down - 1,
#endif #endif
diff_down >= 0
} else { );
h = -diff_up;
}
} }
const int in_hb_idx = mad24(batch_idx, input_height, h); const int in_hb_idx = mad24(batch_idx, input_height, h);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册