HappenLee commented on code in PR #65738: URL: https://github.com/apache/doris/pull/65738#discussion_r3600219637
########## be/src/util/pdep_unpack.h: ########## @@ -0,0 +1,166 @@ +// 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 + +#if defined(__x86_64__) && (defined(__GNUC__) || defined(__clang__)) + +#include <immintrin.h> + +#include <cstddef> +#include <cstdint> +#include <cstring> +#include <limits> +#include <type_traits> +#include <utility> + +namespace doris { + +class PdepUnpack { +public: + static bool is_supported() { + return __builtin_cpu_supports("bmi2") && __builtin_cpu_supports("avx2"); Review Comment: Addressed in cb53beb058b. Production dispatch now also checks the new BE config `enable_bmi2_optimizations` (default `true`). Deployments on CPUs with slow microcoded PDEP, including AMD Zen+ and Zen 2, can set `enable_bmi2_optimizations=false` to retain the scalar path. The config is intentionally named for BMI2 so future BMI2 optimized paths can share the same deployment-level switch. I also added `BitPackingTest.DisableBmi2Optimizations` to verify that disabling the config prevents PDEP dispatch. Representative AMD benchmarking is still required before enabling this optimization on those hosts. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
