Skip to content

Commit

Permalink
NEON arch: dead ref cycle fix: when neon_available_ is ON, the DotPro…
Browse files Browse the repository at this point in the history
…duct was set to point to DotProduct, which should have been DotProductNative, as dotProduct is the *target* global itself: see simddetect.h --> effectively making that part of the SetDotProduct() call identical to this (no-op) statement: `DotProduct = DotProduct;`

Also added the Neon check in the Update() API, where it exists together with the other checks (for AVX/SSE/etc.)
  • Loading branch information
GerHobbelt authored and stweil committed Jul 20, 2021
1 parent 5310111 commit 6089f9a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/arch/simddetect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ SIMDDetect::SIMDDetect() {
#if defined(HAVE_NEON) || defined(__aarch64__)
} else if (neon_available_) {
// NEON detected.
SetDotProduct(DotProduct, IntSimdMatrix::intSimdMatrixNEON);
SetDotProduct(DotProductNative, IntSimdMatrix::intSimdMatrixNEON);
#endif
}
}
Expand Down Expand Up @@ -308,6 +308,12 @@ void SIMDDetect::Update() {
// SSE selected by config variable.
SetDotProduct(DotProductSSE, IntSimdMatrix::intSimdMatrixSSE);
dotproduct_method = "sse";
#endif
#if defined(HAVE_NEON) || defined(__aarch64__)
} else if (!strcmp(dotproduct.c_str(), "neon") && neon_available_) {
// NEON selected by config variable.
SetDotProduct(DotProductNative, IntSimdMatrix::intSimdMatrixNEON);
dotproduct_method = "neon";
#endif
} else if (!strcmp(dotproduct.c_str(), "std::inner_product")) {
// std::inner_product selected by config variable.
Expand Down

0 comments on commit 6089f9a

Please sign in to comment.