Skip to content

Commit 798c351

Browse files
authored
Skip vectorize pragma under AddressSanitizer (pytorch#22853) (pytorch#22853)
Summary: Guard the pragma so it is only emitted when AddressSanitizer is not active; the scalar loop still runs correctly fb: Reviewed By: psiddh Differential Revision: D120193204
1 parent 63d5e55 commit 798c351

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎kernels/portable/cpu/vec_ops.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ vec_minmaxf_impl(const float* x, size_t size, float* min_out, float* max_out) {
4646
for (i = 0; i < vector_end; i += 4) {
4747
// Keep the independent lanes together even under size optimization.
4848
#if defined(__clang__) && (defined(__ARM_NEON) || defined(__SSE2__))
49+
#if !defined(__SANITIZE_ADDRESS__) && !__has_feature(address_sanitizer)
4950
#pragma clang loop vectorize_width(4) interleave_count(1) unroll(disable)
51+
#endif
5052
#endif
5153
for (size_t j = 0; j < 4; ++j) {
5254
if constexpr (ComputeMin) {

0 commit comments

Comments
 (0)