(module_name, func_name)
| 64 | |
| 65 | |
| 66 | def _get_fastmath_value(module_name, func_name): # pragma: no cover |
| 67 | fname = module_name + ".py" |
| 68 | fname = pathlib.Path(__file__).parent / fname |
| 69 | with open(fname, "r", encoding="utf-8") as f: |
| 70 | src = f.read() |
| 71 | tree = ast.parse(src) |
| 72 | for node in ast.walk(tree): |
| 73 | if isinstance(node, ast.FunctionDef) and node.name == func_name: |
| 74 | for dec in node.decorator_list: |
| 75 | for kw in dec.keywords: |
| 76 | if kw.arg == "fastmath": |
| 77 | fastmath_flag = ast.get_source_segment(src, kw.value) |
| 78 | return eval(fastmath_flag) |
| 79 | |
| 80 | |
| 81 | njit_funcs = cache.get_njit_funcs() |
no outgoing calls