|
ADS
Algorithms and Data Structures
|
The name of the configuration of the layouts, an inline namespace: the headers whose classes change their layout or their inline code with the flags of the compiler declare them in inline namespace ADS_ABI_NAME, opened by ADS_ABI_BEGIN and closed by ADS_ABI_END, whose name spells the options that change them. More...
#include "ADS/Simd.h"Go to the source code of this file.
Macros | |
| #define | ADS_FLAT_SIMD ADS_SIMD |
| the matching of the 15 control bytes of a group of the hash tables: 1 by the vectors of Highway [see SimdInline.h], 0 by broadword operations; by default ADS_SIMD [see Simd.h], i.e., 1 with ADS_WITH_HIGHWAY and 0 without it or with ADS_SIMD_SCALAR | |
| #define | ADS_FLAT_CAS16 0 |
| #define | ADS_FLATHASH_BOOST 0 |
| #define | ADS_ABI_VECTOR none |
| #define | ADS_ABI_PASTE(S, C, B, V) |
| #define | ADS_ABI_SPELL(S, C, B, V) |
| #define | ADS_ABI_NAME |
| the inline namespace of the configuration, e.g., abi_s1c1b0_N_AVX2 | |
| #define | ADS_ABI_BEGIN |
| opens the inline namespace of the configuration | |
| #define | ADS_ABI_END } |
| closes the inline namespace of the configuration | |
The name of the configuration of the layouts, an inline namespace: the headers whose classes change their layout or their inline code with the flags of the compiler declare them in inline namespace ADS_ABI_NAME, opened by ADS_ABI_BEGIN and closed by ADS_ABI_END, whose name spells the options that change them.
These are the matching of the control bytes of the hash tables (ADS_FLAT_SIMD: 0 broadword, 1 by the vectors of Highway), the compare-and-swap of 16 bytes of ConcurrentFlatTable (ADS_FLAT_CAS16, that of Boost.Atomic, which -mcx16 and -march=x86-64-v2 or later make free of locks on x86-64), the pairs of boost::unordered_flat_map in FlatHashTable (ADS_FLATHASH_BOOST) and the set of vector instructions at which Highway compiles the kernels inlined in the searches [see SimdInline.h], the namespace that Highway gives it (none without Highway), e.g., abi_s1c1b0_N_AVX2 for the vectors of Highway, the CAS of 16 bytes, no Boost and AVX2. The kernels on arrays [see Simd.h] are chosen by Highway when the program runs, and change nothing here. The defaults of the first two are those of the target, that of ADS_FLATHASH_BOOST is 0, and all are defined here, so that every header sees the same.
The names stay those of ADS, since the members of an inline namespace are found as members of the namespace around it, while the names that the compiler gives the linker change with the configuration. Two translation units of a program built with different flags, e.g., a hot file with -march=x86-64-v3 and the rest with the default, then get two distinct classes in place of two definitions of one class, which the linker would merge without a word (a violation of the one-definition rule, whose outcome is the layout of a unit applied to the objects of the other, or the instructions of AVX2 run on a processor without them); a function of one unit that takes such a class from another fails to link instead of running on the wrong layout. The other macros of the configuration (the contracts, the backends) must still be the same in all the units of a program.
| #define ADS_ABI_PASTE | ( | S, | |
| C, | |||
| B, | |||
| V ) |
| #define ADS_ABI_SPELL | ( | S, | |
| C, | |||
| B, | |||
| V ) |
| #define ADS_ABI_VECTOR none |
| #define ADS_FLAT_CAS16 0 |
| #define ADS_FLATHASH_BOOST 0 |