File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -111,14 +111,20 @@ def set_openblas_openmp_callback():
111
111
cdef openblas_set_threads_callback_function_type f_ptr
112
112
113
113
for ct in openblas_controllers:
114
+ if not hasattr (ct, " dynlib" ):
115
+ # too old version of threadpoolctl
116
+ continue
117
+
114
118
lib = ct.dynlib
115
119
116
- # openblas_set_threads_callback_function is available since v0.3.28
117
- if hasattr (lib, " openblas_set_threads_callback_function" ):
118
- func = lib.openblas_set_threads_callback_function
120
+ if not hasattr (lib, " openblas_set_threads_callback_function" ):
121
+ # openblas_set_threads_callback_function is available since v0.3.28
122
+ continue
123
+
124
+ func = lib.openblas_set_threads_callback_function
119
125
120
- # cast to the correct function pointer type
121
- f_ptr = (< openblas_set_threads_callback_function_type* >< size_t> addressof(func))[0 ]
122
- f_ptr(openblas_openmp_callback)
126
+ # cast to the correct function pointer type
127
+ f_ptr = (< openblas_set_threads_callback_function_type* >< size_t> addressof(func))[0 ]
128
+ f_ptr(openblas_openmp_callback)
123
129
124
- print (" OpenBLAS OpenMP backend callback set" )
130
+ print (" OpenBLAS OpenMP backend callback set" )
You can’t perform that action at this time.
0 commit comments