提交 067214af authored 作者: Pascal Lamblin's avatar Pascal Lamblin

Fix memory leak

上级 28c886fc
......@@ -144,6 +144,9 @@ void %(name)s(
PyObject* opB_transposed = alt_op_%(float_type)s(!to_transpose_B, B, nrowb, ncolb, *LDB);
PyObject* opB_trans_dot_opA_trans = PyArray_New(&PyArray_Type, 2, computation_dims, %(npy_float)s, computation_strides, computation_pointer, 0, computation_flags, NULL);
PyArray_MatrixProduct2(opB_transposed, opA_transposed, (PyArrayObject*)opB_trans_dot_opA_trans);
/* PyArray_MatrixProduct2 adds a reference to the output array,
* which we need to remove to avoid a memory leak. */
Py_XDECREF(opB_trans_dot_opA_trans);
if(*BETA == 0) {
if(*ALPHA != 1.0)
alt_numpy_scale_matrix_inplace_%(float_type)s(ALPHA, (PyArrayObject*)opB_trans_dot_opA_trans);
......
......@@ -1032,7 +1032,7 @@ def openblas_threads_text():
def blas_header_version():
# Version for the base header
version = (1,)
version = (2,)
if detect_macos_sdot_bug():
if detect_macos_sdot_bug.fix_works:
# Version with fix
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论