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