X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Farrow%2Fcpp%2Fsrc%2Fgandiva%2Fconfiguration.cc;fp=ceph%2Fsrc%2Farrow%2Fcpp%2Fsrc%2Fgandiva%2Fconfiguration.cc;h=1e26c5c70d4ec53c896b476f27dae917476b210e;hb=1d09f67e50a235260a0812cca2fb044674d88150;hp=0000000000000000000000000000000000000000;hpb=a653f20b2fb9a1c0c3e465a23074d91f26031b5d;p=ceph.git diff --git a/ceph/src/arrow/cpp/src/gandiva/configuration.cc b/ceph/src/arrow/cpp/src/gandiva/configuration.cc new file mode 100644 index 000000000..1e26c5c70 --- /dev/null +++ b/ceph/src/arrow/cpp/src/gandiva/configuration.cc @@ -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. + +#include "gandiva/configuration.h" + +#include "arrow/util/hash_util.h" + +namespace gandiva { + +const std::shared_ptr ConfigurationBuilder::default_configuration_ = + InitDefaultConfig(); + +std::size_t Configuration::Hash() const { + static constexpr size_t kHashSeed = 0; + size_t result = kHashSeed; + arrow::internal::hash_combine(result, static_cast(optimize_)); + arrow::internal::hash_combine(result, static_cast(target_host_cpu_)); + return result; +} + +bool Configuration::operator==(const Configuration& other) const { + return optimize_ == other.optimize_ && target_host_cpu_ == other.target_host_cpu_; +} + +bool Configuration::operator!=(const Configuration& other) const { + return !(*this == other); +} + +} // namespace gandiva