numpy.distutils.ccompiler_opt.CCompilerOpt#

class numpy.distutils.ccompiler_opt.CCompilerOpt(ccompiler, cpu_baseline='min', cpu_dispatch='max', cache_path=None)[源代码]#

一个辅助类,旨在为 CCompiler 提供额外的构建选项,以有效控制与 CPU 功能直接相关的编译器优化。

属性:
conf_cache_factors
conf_tmp_path

方法

cache_flush()

强制更新缓存。

cc_normalize_flags(flags)

移除因收集隐含特征标志而导致的冲突。

conf_features_partial()

返回一个支持平台 CPU 功能的字典,并将其余未定义选项累积在 conf_features 中。返回的字典具有与类属性 conf_features 相同的规则和注意事项,并且会覆盖“conf_features”中设置的任何选项。

cpu_baseline_flags()

返回最终 CPU 基线编译器标志列表

cpu_baseline_names()

返回最终 CPU 基线功能名称列表

cpu_dispatch_names()

返回最终 CPU 分派功能名称列表

dist_compile(sources, flags[, ccompiler])

包装 CCompiler.compile()

dist_error(*args)

引发编译器错误

dist_fatal(*args)

引发 distutils 错误

dist_info()

返回一个包含 (platform, compiler, extra_args) 的元组,这是由抽象类 '_CCompiler' 所必需的,用于发现平台环境。

dist_load_module(name, path)

从文件加载模块,由抽象类 '_Cache' 所必需。

dist_log(*args[, stderr])

打印控制台消息

dist_test(source, flags[, macros])

返回 'CCompiler.compile()' 是否能够使用特定标志编译源文件。

feature_ahead(names)

返回 'names' 中的功能列表,移除任何隐含的功能并保留原始功能。

feature_c_preprocessor(feature_name[, tabs])

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

feature_detect(names)

返回需要检测的 CPU 功能列表,按兴趣从低到高排序。

feature_get_til(names, keyisfalse)

feature_implies_c() 相同,但在通过参数 'keyisfalse' 提供的功能选项为 False 时停止收集隐含功能,并对返回的功能进行排序。

feature_implies(names[, keep_origins])

返回由 'names' 隐含的 CPU 功能集

feature_implies_c(names)

与 feature_implies() 相同,但结合了 'names'。

feature_is_exist(name)

返回某个功能是否存在以及是否包含在 _Config.conf_features 中。

feature_names([names, force_flags, macros])

返回平台和 **C** 编译器支持的 CPU 功能名称集。

feature_sorted(names[, reverse])

按兴趣从低到高排序 CPU 功能列表。

feature_untied(names)

与 'feature_ahead()' 相同,但如果两个功能相互隐含,则保留兴趣度最高的功能。

generate_dispatch_header(header_path)

生成分派头文件,其中包含用于启用 CPU 基线和可分派功能的特定于平台的指令集的 #define 定义和头文件。

is_cached()

如果类从缓存文件中加载,则返回 True

me(cb)

一个静态方法,可以用作装饰器来动态缓存某些方法。

parse_targets(source)

获取并解析定义目标 CPU 功能所需的配置语句。语句应声明在源文件的顶部,用 **C** 注释括起来,并以特殊标记 **@targets** 开头。

try_dispatch(sources[, src_dir, ccompiler])

编译一个或多个可分派的源文件并生成对象文件,同时生成用于后续运行时分派过程的抽象 C 配置头文件和宏。

cache_hash

cc_test_cexpr

cc_test_flags

feature_can_autovec

feature_extra_checks

feature_flags

feature_is_supported

feature_test

report