Skip to content

Commit cd764bf

Browse files
authored
Add nogil to hwe njit #222 (#234)
1 parent ff5a0a0 commit cd764bf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sgkit/stats/hwe.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def hardy_weinberg_p_value(obs_hets: int, obs_hom1: int, obs_hom2: int) -> float
9898

9999

100100
# Benchmarks show ~25% improvement w/ fastmath on large (~10M) counts
101-
hardy_weinberg_p_value_jit = njit(hardy_weinberg_p_value, fastmath=True)
101+
hardy_weinberg_p_value_jit = njit(hardy_weinberg_p_value, fastmath=True, nogil=True)
102102

103103

104104
def hardy_weinberg_p_value_vec(
@@ -116,7 +116,9 @@ def hardy_weinberg_p_value_vec(
116116
return p
117117

118118

119-
hardy_weinberg_p_value_vec_jit = njit(hardy_weinberg_p_value_vec, fastmath=True)
119+
hardy_weinberg_p_value_vec_jit = njit(
120+
hardy_weinberg_p_value_vec, fastmath=True, nogil=True
121+
)
120122

121123

122124
def hardy_weinberg_test(

0 commit comments

Comments
 (0)