Skip to content

Commit 57be99a

Browse files
committed
simplify
1 parent 7e69138 commit 57be99a

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

src/fast_array_utils/numba/_parallel_runtime.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ def _is_apple_silicon() -> bool:
4848
return sys.platform == "darwin" and platform.machine() == "arm64"
4949

5050

51-
def _could_select_omp_from_threading_config_without_probing() -> bool:
51+
def _needs_parallel_runtime_probe() -> bool:
52+
if not _is_apple_silicon() or "torch" not in sys.modules:
53+
return False
54+
5255
match numba.config.THREADING_LAYER:
5356
case "omp":
5457
return True
@@ -58,14 +61,6 @@ def _could_select_omp_from_threading_config_without_probing() -> bool:
5861
return "omp" in LAYERS[category]
5962

6063

61-
def _needs_parallel_runtime_probe() -> bool:
62-
if not _is_apple_silicon() or "torch" not in sys.modules:
63-
return False
64-
if numba.config.THREADING_LAYER in {"workqueue", "tbb"}:
65-
return False
66-
return _could_select_omp_from_threading_config_without_probing()
67-
68-
6964
def _loaded_relevant_parallel_runtime_probe_modules() -> tuple[str, ...]:
7065
return tuple(module for module in _PARALLEL_RUNTIME_PROBE_MODULE_WHITELIST if module in sys.modules)
7166

0 commit comments

Comments
 (0)