8000 PERF: improve multithreaded ufunc scaling by ngoldbaum · Pull Request #27896 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

PERF: improve multithreaded ufunc scaling #27896

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Dec 5, 2024
Prev Previous commit
Next Next commit
MAINT: try to give new function a name indicating it uses a mutex
  • Loading branch information
ngoldbaum committed Dec 3, 2024
commit f2b7cc1ff73daaa343c47c5aa6f482fbdfd2a344
5 changes: 3 additions & 2 deletions numpy/_core/src/umath/dispatching.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,8 @@ promote_and_get_info_and_ufuncimpl(PyUFuncObject *ufunc,
* only acquires a write lock on a cache miss to fill the cache
*/
static inline PyObject *
try_promote_and_get_info_and_ufuncimpl(PyUFuncObject *ufunc,
promote_and_get_info_and_ufuncimpl_with_locking(
PyUFuncObject *ufunc,
PyArrayObject *const ops[],
PyArray_DTypeMeta *signature[],
PyArray_DTypeMeta *op_dtypes[],
Expand Down Expand Up @@ -1022,7 +1023,7 @@ promote_and_get_ufuncimpl(PyUFuncObject *ufunc,
}

#ifdef Py_GIL_DISABLED
PyObject *info = try_promote_and_get_info_and_ufuncimpl(ufunc,
PyObject *info = promote_and_get_info_and_ufuncimpl_with_locking(ufunc,
ops, signature, op_dtypes, legacy_promotion_is_possible);
#else
PyObject *info = promote_and_get_info_and_ufuncimpl(ufunc,
Expand Down
0