numpy.distutils.ccompiler_opt.CCompilerOpt.feature_ahead#

方法

distutils.ccompiler_opt.CCompilerOpt.feature_ahead(names)[源代码]#

在移除任何隐含的特性并保留来源后,返回 ‘names’ 中的特性列表.

参数:
‘names’: sequence

CPU 特性名称的大写序列.

返回:
按原样排序的 CPU 特性列表 ‘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"]