mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-05-01 16:24:28 +08:00
bug #887: use ei_declare_aligned_stack_constructed_variable instead of manual new[]/delete[] pairs in AMD and Paralellizer
This commit is contained in:
parent
fb53ff1eda
commit
893bfcf95f
@ -129,7 +129,7 @@ void parallelize_gemm(const Functor& func, Index rows, Index cols, bool transpos
|
|||||||
Index blockRows = (rows / threads);
|
Index blockRows = (rows / threads);
|
||||||
blockRows = (blockRows/Functor::Traits::mr)*Functor::Traits::mr;
|
blockRows = (blockRows/Functor::Traits::mr)*Functor::Traits::mr;
|
||||||
|
|
||||||
GemmParallelInfo<Index>* info = new GemmParallelInfo<Index>[threads];
|
ei_declare_aligned_stack_constructed_variable(GemmParallelInfo<Index>,info,threads,0);
|
||||||
|
|
||||||
#pragma omp parallel num_threads(threads)
|
#pragma omp parallel num_threads(threads)
|
||||||
{
|
{
|
||||||
@ -146,8 +146,6 @@ void parallelize_gemm(const Functor& func, Index rows, Index cols, bool transpos
|
|||||||
if(transpose) func(c0, actualBlockCols, 0, rows, info);
|
if(transpose) func(c0, actualBlockCols, 0, rows, info);
|
||||||
else func(0, rows, c0, actualBlockCols, info);
|
else func(0, rows, c0, actualBlockCols, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete[] info;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,7 +106,8 @@ void minimum_degree_ordering(SparseMatrix<Scalar,ColMajor,Index>& C, Permutation
|
|||||||
t = cnz + cnz/5 + 2*n; /* add elbow room to C */
|
t = cnz + cnz/5 + 2*n; /* add elbow room to C */
|
||||||
C.resizeNonZeros(t);
|
C.resizeNonZeros(t);
|
||||||
|
|
||||||
Index* W = new Index[8*(n+1)]; /* get workspace */
|
// get workspace
|
||||||
|
ei_declare_aligned_stack_constructed_variable(Index,W,8*(n+1),0);
|
||||||
Index* len = W;
|
Index* len = W;
|
||||||
Index* nv = W + (n+1);
|
Index* nv = W + (n+1);
|
||||||
Index* next = W + 2*(n+1);
|
Index* next = W + 2*(n+1);
|
||||||
@ -424,8 +425,6 @@ void minimum_degree_ordering(SparseMatrix<Scalar,ColMajor,Index>& C, Permutation
|
|||||||
}
|
}
|
||||||
|
|
||||||
perm.indices().conservativeResize(n);
|
perm.indices().conservativeResize(n);
|
||||||
|
|
||||||
delete[] W;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
|
Loading…
x
Reference in New Issue
Block a user