| 2217 | related to CPU features. |
| 2218 | """ |
| 2219 | def __init__(self, ccompiler, cpu_baseline="min", cpu_dispatch="max", cache_path=None): |
| 2220 | _Config.__init__(self) |
| 2221 | _Distutils.__init__(self, ccompiler) |
| 2222 | _Cache.__init__(self, cache_path, self.dist_info(), cpu_baseline, cpu_dispatch) |
| 2223 | _CCompiler.__init__(self) |
| 2224 | _Feature.__init__(self) |
| 2225 | if not self.cc_noopt and self.cc_has_native: |
| 2226 | self.dist_log( |
| 2227 | "native flag is specified through environment variables. " |
| 2228 | "force cpu-baseline='native'" |
| 2229 | ) |
| 2230 | cpu_baseline = "native" |
| 2231 | _Parse.__init__(self, cpu_baseline, cpu_dispatch) |
| 2232 | # keep the requested features untouched, need it later for report |
| 2233 | # and trace purposes |
| 2234 | self._requested_baseline = cpu_baseline |
| 2235 | self._requested_dispatch = cpu_dispatch |
| 2236 | # key is the dispatch-able source and value is a tuple |
| 2237 | # contains two items (has_baseline[boolean], dispatched-features[list]) |
| 2238 | self.sources_status = getattr(self, "sources_status", {}) |
| 2239 | # every instance should has a separate one |
| 2240 | self.cache_private.add("sources_status") |
| 2241 | # set it at the end to make sure the cache writing was done after init |
| 2242 | # this class |
| 2243 | self.hit_cache = hasattr(self, "hit_cache") |
| 2244 | |
| 2245 | def is_cached(self): |
| 2246 | """ |