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>