numpy.distutils.ccompiler_opt.CCompilerOpt#

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

A helper class for CCompiler aims to provide extra build options to effectively control of compiler optimizations that are directly related to CPU features.

Attributes
conf_cache_factors
conf_tmp_path

Methods

cache_flush()

Force update the cache.

cc_normalize_flags(flags)

Remove the conflicts that caused due gathering implied features flags.

conf_features_partial()

Return a dictionary of supported CPU features by the platform, and accumulate the rest of undefined options in conf_features, the returned dict has same rules and notes in class attribute conf_features, also its override any options that been set in 'conf_features'.

cpu_baseline_flags()

Returns a list of final CPU baseline compiler flags

cpu_baseline_names()

return a list of final CPU baseline feature names

cpu_dispatch_names()

return a list of final CPU dispatch feature names

dist_compile(sources, flags[, ccompiler])

Wrap CCompiler.compile()

dist_error(*args)

Raise a compiler error

dist_fatal(*args)

Raise a distutils error

dist_info()

Return a tuple containing info about (platform, compiler, extra_args), required by the abstract class '_CCompiler' for discovering the platform environment.

dist_load_module(name, path)

Load a module from file, required by the abstract class '_Cache'.

dist_log(*args[, stderr])

Print a console message

dist_test(source, flags[, macros])

Return True if 'CCompiler.compile()' able to compile a source file with certain flags.

feature_ahead(names)

Return list of features in 'names' after remove any implied features and keep the origins.

feature_c_preprocessor(feature_name[, tabs])

Generate C preprocessor definitions and include headers of a CPU feature.

feature_detect(names)

Return a list of CPU features that required to be detected sorted from the lowest to highest interest.

feature_get_til(names, keyisfalse)

same as feature_implies_c() but stop collecting implied features when feature's option that provided through parameter 'keyisfalse' is False, also sorting the returned features.

feature_implies(names[, keep_origins])

Return a set of CPU features that implied by 'names'

feature_implies_c(names)

same as feature_implies() but combining 'names'

feature_is_exist(name)

Returns True if a certain feature is exist and covered within _Config.conf_features.

feature_names([names, force_flags, macros])

Returns a set of CPU feature names that supported by platform and the C compiler.

feature_sorted(names[, reverse])

Sort a list of CPU features ordered by the lowest interest.

feature_untied(names)

same as 'feature_ahead()' but if both features implied each other and keep the highest interest.

generate_dispatch_header(header_path)

Generate the dispatch header which contains the #definitions and headers for platform-specific instruction-sets for the enabled CPU baseline and dispatch-able features.

is_cached()

Returns True if the class loaded from the cache file

me(cb)

A static method that can be treated as a decorator to dynamically cache certain methods.

parse_targets(source)

Fetch and parse configuration statements that required for defining the targeted CPU features, statements should be declared in the top of source in between C comment and start with a special mark @targets.

try_dispatch(sources[, src_dir, ccompiler])

Compile one or more dispatch-able sources and generates object files, also generates abstract C config headers and macros that used later for the final runtime dispatching process.

cache_hash

cc_test_cexpr

cc_test_flags

feature_can_autovec

feature_extra_checks

feature_flags

feature_is_supported

feature_test

report