Skip to content

Commit

Permalink
Added PyUnstable_Module_SetGIL to PyInit_cpu_feature_guard
Browse files Browse the repository at this point in the history
  • Loading branch information
vfdev-5 committed Aug 19, 2024
1 parent b1b3ea2 commit c591bba
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion jaxlib/cpu_feature_guard.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,5 +172,12 @@ static struct PyModuleDef cpu_feature_guard_module = {
#endif

EXPORT_SYMBOL PyMODINIT_FUNC PyInit_cpu_feature_guard(void) {
return PyModule_Create(&cpu_feature_guard_module);
PyObject *module = PyModule_Create(&cpu_feature_guard_module);
if (module == NULL) {
return NULL;
}
#ifdef Py_GIL_DISABLED
PyUnstable_Module_SetGIL(module, Py_MOD_GIL_NOT_USED);
#endif
return module;
}

0 comments on commit c591bba

Please sign in to comment.