numpy.distutils.ccompiler_opt.CCompilerOpt.feature_ahead#

方法

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

返回 'names' 中的特征列表,在移除所有隐含特征后保留原始特征。

参数:
'names': 序列

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"]