(self)
| 316 | return [x for x in args if len(x) > 0] |
| 317 | |
| 318 | def cpu_arch(self): |
| 319 | try: |
| 320 | from cpuinfo import get_cpu_info |
| 321 | except ImportError as e: |
| 322 | cpu_info = self._backup_cpuinfo() |
| 323 | if cpu_info is None: |
| 324 | return "-march=native" |
| 325 | |
| 326 | try: |
| 327 | cpu_info = get_cpu_info() |
| 328 | except Exception as e: |
| 329 | self.warning(f"{self.name} attempted to use `py-cpuinfo` but failed (exception type: {type(e)}, {e}), " |
| 330 | "falling back to `lscpu` to get this information.") |
| 331 | cpu_info = self._backup_cpuinfo() |
| 332 | if cpu_info is None: |
| 333 | return "-march=native" |
| 334 | |
| 335 | if cpu_info['arch'].startswith('PPC_'): |
| 336 | # gcc does not provide -march on PowerPC, use -mcpu instead |
| 337 | return '-mcpu=native' |
| 338 | return '-march=native' |
| 339 | |
| 340 | def is_cuda_enable(self): |
| 341 | try: |
no test coverage detected