|
||||
File indexing completed on 2025-01-18 09:27:15
0001 // Copyright 2022 The Abseil Authors 0002 // 0003 // Licensed under the Apache License, Version 2.0 (the "License"); 0004 // you may not use this file except in compliance with the License. 0005 // You may obtain a copy of the License at 0006 // 0007 // https://www.apache.org/licenses/LICENSE-2.0 0008 // 0009 // Unless required by applicable law or agreed to in writing, software 0010 // distributed under the License is distributed on an "AS IS" BASIS, 0011 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 0012 // See the License for the specific language governing permissions and 0013 // limitations under the License. 0014 0015 #ifndef ABSL_CRC_INTERNAL_CPU_DETECT_H_ 0016 #define ABSL_CRC_INTERNAL_CPU_DETECT_H_ 0017 0018 #include "absl/base/config.h" 0019 0020 namespace absl { 0021 ABSL_NAMESPACE_BEGIN 0022 namespace crc_internal { 0023 0024 // Enumeration of architectures that we have special-case tuning parameters for. 0025 // This set may change over time. 0026 enum class CpuType { 0027 kUnknown, 0028 kIntelHaswell, 0029 kAmdRome, 0030 kAmdNaples, 0031 kAmdMilan, 0032 kAmdGenoa, 0033 kAmdRyzenV3000, 0034 kIntelCascadelakeXeon, 0035 kIntelSkylakeXeon, 0036 kIntelBroadwell, 0037 kIntelSkylake, 0038 kIntelIvybridge, 0039 kIntelSandybridge, 0040 kIntelWestmere, 0041 kArmNeoverseN1, 0042 kArmNeoverseV1, 0043 kAmpereSiryn, 0044 kArmNeoverseN2, 0045 kArmNeoverseV2 0046 }; 0047 0048 // Returns the type of host CPU this code is running on. Returns kUnknown if 0049 // the host CPU is of unknown type, or if detection otherwise fails. 0050 CpuType GetCpuType(); 0051 0052 // Returns whether the host CPU supports the CPU features needed for our 0053 // accelerated implementations. The CpuTypes enumerated above apart from 0054 // kUnknown support the required features. On unknown CPUs, we can use 0055 // this to see if it's safe to use hardware acceleration, though without any 0056 // tuning. 0057 bool SupportsArmCRC32PMULL(); 0058 0059 } // namespace crc_internal 0060 ABSL_NAMESPACE_END 0061 } // namespace absl 0062 0063 #endif // ABSL_CRC_INTERNAL_CPU_DETECT_H_
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |