Skip to content

Commit 72dc0f0

Browse files
committed
Added a break statement after the Navi arch was found in the first occurrence.
1 parent 943d74b commit 72dc0f0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

aten/src/ATen/native/cpu/AmpGradScalerKernels.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ void _amp_foreach_non_finite_check_and_unscale_cpu_kernel(
5555
for (auto index: c10::irange(detail::getCUDAHooks().deviceCount()))
5656
{
5757
if (detail::getCUDAHooks().isGPUArch(index, archs))
58+
{
5859
is_navi_arch = true;
60+
break;
61+
}
5962
}
6063

6164
// Ensures client code (GradScaler) filtered scaled_grads by dtype.

0 commit comments

Comments
 (0)