Skip to content

Commit f72b7f4

Browse files
committed
Turn result to atomic
1 parent 09b12b2 commit f72b7f4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

aten/src/ATen/native/ReduceOps.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,7 @@ bool cpu_equal(const Tensor& self, const Tensor& other) {
968968
if (!self.is_same_size(other)) {
969969
return false;
970970
}
971-
bool result = true;
971+
std::atomic<bool> result{true};
972972
auto iter = TensorIteratorConfig()
973973
.add_input(self)
974974
.add_input(other)
@@ -993,7 +993,7 @@ bool cpu_equal(const Tensor& self, const Tensor& other) {
993993
}
994994
});
995995
});
996-
return result;
996+
return result.load();
997997
}
998998

999999
}} // namespace at::native

0 commit comments

Comments
 (0)