wgtmac commented on code in PR #50030: URL: https://github.com/apache/arrow/pull/50030#discussion_r3315882247
########## cpp/src/parquet/bloom_filter_block_inc.h: ########## @@ -0,0 +1,43 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +#pragma once + +#include <cstdint> + +// Used to make sure ODR rule isn't violated. +#ifndef PARQUET_IMPL_NAMESPACE +# error "PARQUET_IMPL_NAMESPACE must be defined" +#endif + +namespace parquet::internal::PARQUET_IMPL_NAMESPACE { + +// Branchless OR-accumulator reduction: the short-circuit `return false` shape Review Comment: This comment points to original implementation which is outdated so it may confuse future readers. Should we remove them or simplify it to be more straightforward? ########## cpp/src/parquet/bloom_filter_avx2_internal.h: ########## @@ -0,0 +1,32 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include <cstdint> + +#include "parquet/platform.h" + +namespace parquet::internal { + +// PARQUET_EXPORT so the symbol is visible from parquet_shared on Windows MinGW +// (default visibility is hidden) -- the cross-target diff test calls this +// directly. Review Comment: ```suggestion ``` I don't think we need this comment ########## 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: Is this correct? I don't see other similar places have `#if defined(ARROW_HAVE_RUNTIME_AVX2)` protection. cc @AntoinePrv -- 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]
