numpy.distutils.ccompiler_opt.CCompilerOpt.feature_c_preprocessor#

方法

distutils.ccompiler_opt.CCompilerOpt.feature_c_preprocessor(feature_name, tabs=0)[源代码]#

生成 CPU 特征的 C 预处理器定义和包含头文件。

参数:
‘feature_name’: str

CPU 特征名称(大写)。

‘tabs’: int

如果大于 0,则根据制表符的数量将生成的字符串右对齐。

返回:
str, 生成的 C 预处理器

示例

>>> self.feature_c_preprocessor("SSE3")
/** SSE3 **/
#define NPY_HAVE_SSE3 1
#include <pmmintrin.h>