AntoinePrv commented on code in PR #49756:
URL: https://github.com/apache/arrow/pull/49756#discussion_r3129437510


##########
cpp/src/arrow/util/bpacking.cc:
##########
@@ -52,12 +65,14 @@ struct UnpackDynamicFunction {
 
 template <typename Uint>
 void unpack(const uint8_t* in, Uint* out, const UnpackOptions& opts) {
-#if defined(ARROW_HAVE_NEON)
-  return bpacking::unpack_neon(in, out, opts);
-#else
-  static DynamicDispatch<UnpackDynamicFunction<Uint> > dispatch;
-  return dispatch.func(in, out, opts);
-#endif
+  auto constexpr kImplementations = 
UnpackDynamicFunction<Uint>::implementations();
+  if constexpr (kImplementations.size() == 1) {

Review Comment:
   It is worth it to avoid additional `#ifdef`, for instance on Macos there is 
only neon and no SVE (no need to dyn dispatch).
   Previously we'd exclude the Neon version from the dynamic dispatch and go 
`#ifdef ARROW_HAVE_NEON` then go straight to Neon implementation.
   
   > At worse, this could be added generically to `DynamicDispatch` instead. 
But I doubt it's worth it.
   
   Actually done in GH-49840 so either way here (we'd need to adapt the PR that 
is not merged first).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to