Copilot commented on code in PR #50030:
URL: https://github.com/apache/arrow/pull/50030#discussion_r3295305919


##########
cpp/src/parquet/bloom_filter.cc:
##########
@@ -34,6 +35,35 @@
 #include "parquet/thrift_internal.h"
 #include "parquet/xxhasher.h"
 
+#if defined(ARROW_HAVE_RUNTIME_AVX2)
+#  include "parquet/bloom_filter_avx2_internal.h"
+#endif
+
+#define PARQUET_IMPL_NAMESPACE standard
+#include "parquet/bloom_filter_block_inc.h"
+#undef PARQUET_IMPL_NAMESPACE
+
+#include "arrow/util/dispatch_internal.h"
+
+namespace parquet::internal {
+namespace {
+
+using ::arrow::internal::DynamicDispatch;
+
+struct FindHashBlockDynamicFunction {
+  using FunctionType = decltype(&standard::FindHashBlockImpl);
+
+  static constexpr auto targets() {
+    return std::array{
+        ARROW_DISPATCH_TARGET_NONE(&standard::FindHashBlockImpl)  //
+        ARROW_DISPATCH_TARGET_AVX2(&FindHashBlockAvx2)            //

Review Comment:
   `ARROW_DISPATCH_TARGET_AVX2` expands when either `ARROW_HAVE_RUNTIME_AVX2` 
*or* `ARROW_HAVE_AVX2` is defined (see `arrow/util/dispatch_internal.h`). In a 
build with an AVX2 baseline (`-DARROW_HAVE_AVX2`) but with runtime dispatch 
disabled (`ARROW_HAVE_RUNTIME_AVX2` unset), this targets list will still try to 
reference `FindHashBlockAvx2` even though `bloom_filter_avx2_internal.h` isn’t 
included and `bloom_filter_avx2.cc` isn’t built, leading to a compile/link 
failure. Consider wrapping both the `#include` and the AVX2 target entry in 
`#if defined(ARROW_HAVE_RUNTIME_AVX2)` (or otherwise ensuring the AVX2 symbol 
is available whenever `ARROW_HAVE_AVX2` is set).
   



-- 
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