Skip to content

Commit d001ff3

Browse files
authored
Avoid divide by 0 when calculating predicted performance with streamk (#1373)
1 parent 12ac86e commit d001ff3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tensilelite/Tensile/Source/lib/source/ContractionSolution.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ namespace TensileLite
5656
__device__ __host__ inline constexpr N safe_ceil_div(N n, D d)
5757
{
5858
// Static cast to undo integral promotion.
59-
return static_cast<N>(n / d + (n % d != 0 ? 1 : 0));
59+
return static_cast<N>(d == 0 ? 0 : (n / d + (n % d != 0 ? 1 : 0)));
6060
}
6161
} // namespace math
6262

0 commit comments

Comments
 (0)