File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -137,21 +137,19 @@ def _loaded_relevant_parallel_runtime_probe_modules() -> tuple[str, ...]:
137137
138138def _parallel_runtime_probe_code (modules : tuple [str , ...]) -> str :
139139 lines = [* (f"import { module } " for module in modules ), "import numba" , "import numpy as np" , "" ]
140- lines .extend (
141- [
142- "@numba.njit(parallel=True, cache=False)" ,
143- "def _probe(values):" ,
144- " total = 0.0" ,
145- " for i in numba.prange(values.shape[0]):" ,
146- " total += values[i]" ,
147- " return total" ,
148- "" ,
149- "values = np.arange(32, dtype=np.float64)" ,
150- "assert _probe(values) == np.sum(values)" ,
151- f"print({ _PARALLEL_RUNTIME_PROBE_SENTINEL !r} )" ,
152- "" ,
153- ]
154- )
140+ lines .extend ([
141+ "@numba.njit(parallel=True, cache=False)" ,
142+ "def _probe(values):" ,
143+ " total = 0.0" ,
144+ " for i in numba.prange(values.shape[0]):" ,
145+ " total += values[i]" ,
146+ " return total" ,
147+ "" ,
148+ "values = np.arange(32, dtype=np.float64)" ,
149+ "assert _probe(values) == np.sum(values)" ,
150+ f"print({ _PARALLEL_RUNTIME_PROBE_SENTINEL !r} )" ,
151+ "" ,
152+ ])
155153 return "\n " .join (lines )
156154
157155
You can’t perform that action at this time.
0 commit comments