A helper class for CCompilerOpt
that managing CPU features.
_Config.conf_features
and _Config.conf_features_partial()
_Config.conf_min_features
.Method | __init__ |
Undocumented |
Method | feature_ahead |
Return list of features in 'names' after remove any implied features and keep the origins. |
Method | feature_c_preprocessor |
Generate C preprocessor definitions and include headers of a CPU feature. |
Method | feature_can_autovec |
check if the feature can be auto-vectorized by the compiler |
Method | feature_detect |
Return a list of CPU features that required to be detected sorted from the lowest to highest interest. |
Method | feature_extra_checks |
Return a list of supported extra checks after testing them against the compiler. |
Method | feature_flags |
Return a list of CPU features flags sorted from the lowest to highest interest. |
Method | feature_get_til |
No summary |
Method | feature_implies |
Return a set of CPU features that implied by 'names' |
Method | feature_implies_c |
same as feature_implies() but combining 'names' |
Method | feature_is_exist |
Returns True if a certain feature is exist and covered within _Config.conf_features . |
Method | feature_is_supported |
Check if a certain CPU feature is supported by the platform and compiler. |
Method | feature_names |
Returns a set of CPU feature names that supported by platform and the C compiler. |
Method | feature_sorted |
Sort a list of CPU features ordered by the lowest interest. |
Method | feature_test |
Test a certain CPU feature against the compiler through its own check file. |
Method | feature_untied |
same as 'feature_ahead()' but if both features implied each other and keep the highest interest. |
Instance Variable | feature_is_cached |
Undocumented |
Instance Variable | feature_min |
Undocumented |
Instance Variable | feature_supported |
Undocumented |
Return list of features in 'names' after remove any implied features and keep the origins.
list of CPU features sorted as-is 'names'
>>> self.feature_ahead(["SSE2", "SSE3", "SSE41"]) ["SSE41"] # assume AVX2 and FMA3 implies each other and AVX2 # is the highest interest >>> self.feature_ahead(["SSE2", "SSE3", "SSE41", "AVX2", "FMA3"]) ["AVX2"] # assume AVX2 and FMA3 don't implies each other >>> self.feature_ahead(["SSE2", "SSE3", "SSE41", "AVX2", "FMA3"]) ["AVX2", "FMA3"]
Generate C preprocessor definitions and include headers of a CPU feature.
str, generated C preprocessor
>>> self.feature_c_preprocessor("SSE3") /** SSE3 **/ #define NPY_HAVE_SSE3 1 #include <pmmintrin.h>
Return a list of supported extra checks after testing them against the compiler.
feature_implies_c()
but stop collecting implied
features when feature's option that provided through
parameter 'keyisfalse' is False, also sorting the returned
features.Return a set of CPU features that implied by 'names'
>>> self.feature_implies("SSE3") {'SSE', 'SSE2'} >>> self.feature_implies("SSE2") {'SSE'} >>> self.feature_implies("SSE2", keep_origins=True) # 'SSE2' found here since 'SSE' and 'SSE2' imply each other {'SSE', 'SSE2'}
Returns True if a certain feature is exist and covered within
_Config.conf_features
.
Check if a certain CPU feature is supported by the platform and compiler.
Returns a set of CPU feature names that supported by platform and the C compiler.
Sort a list of CPU features ordered by the lowest interest.
list, sorted CPU features
Test a certain CPU feature against the compiler through its own check file.
feature_flags()
will be used.same as 'feature_ahead()' but if both features implied each other and keep the highest interest.
list of CPU features sorted as-is 'names'
>>> self.feature_untied(["SSE2", "SSE3", "SSE41"]) ["SSE2", "SSE3", "SSE41"] # assume AVX2 and FMA3 implies each other >>> self.feature_untied(["SSE2", "SSE3", "SSE41", "FMA3", "AVX2"]) ["SSE2", "SSE3", "SSE41", "AVX2"]