Skip to content

Commit

Permalink
update dynstack
Browse files Browse the repository at this point in the history
  • Loading branch information
sarah-quinones committed Sep 29, 2024
1 parent 0d5bba0 commit 7e5435d
Show file tree
Hide file tree
Showing 17 changed files with 97 additions and 92 deletions.
2 changes: 1 addition & 1 deletion src/linalg/cholesky/piv_llt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub mod compute {
perm: &'out mut [I],
perm_inv: &'out mut [I],
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
params: PivLltParams,
) -> Result<(PivLltInfo, PermRef<'out, I>), CholeskyError> {
assert!(a.nrows() == a.ncols());
Expand Down
4 changes: 2 additions & 2 deletions src/linop/bicgstab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ pub fn bicgstab<E: ComplexField>(
params: BicgParams<E>,
callback: impl FnMut(MatRef<'_, E>),
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) -> Result<BicgInfo<E>, BicgError<E>> {
#[track_caller]
fn implementation<E: ComplexField>(
Expand All @@ -150,7 +150,7 @@ pub fn bicgstab<E: ComplexField>(
params: BicgParams<E>,
callback: &mut dyn FnMut(MatRef<'_, E>),
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) -> Result<BicgInfo<E>, BicgError<E>> {
let mut x = out;
let A = mat;
Expand Down
4 changes: 2 additions & 2 deletions src/linop/conjugate_gradient.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ pub fn conjugate_gradient<E: ComplexField>(
params: CgParams<E>,
callback: impl FnMut(MatRef<'_, E>),
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) -> Result<CgInfo<E>, CgError<E>> {
#[track_caller]
fn implementation<E: ComplexField>(
Expand All @@ -145,7 +145,7 @@ pub fn conjugate_gradient<E: ComplexField>(
params: CgParams<E>,
callback: &mut dyn FnMut(MatRef<'_, E>),
parallelism: Parallelism,
mut stack: PodStack<'_>,
mut stack: &mut PodStack,
) -> Result<CgInfo<E>, CgError<E>> {
assert!(A.nrows() == A.ncols());

Expand Down
8 changes: 4 additions & 4 deletions src/linop/linop_impl/csc_matmut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl<E: ComplexField, I: Index, ViewE: Conjugate<Canonical = E>> LinOp<E>
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
self.as_ref().apply(out, rhs, parallelism, stack)
}
Expand All @@ -45,7 +45,7 @@ impl<E: ComplexField, I: Index, ViewE: Conjugate<Canonical = E>> LinOp<E>
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
self.as_ref().conj_apply(out, rhs, parallelism, stack)
}
Expand All @@ -70,7 +70,7 @@ impl<E: ComplexField, I: Index, ViewE: Conjugate<Canonical = E>> BiLinOp<E>
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
self.as_ref().transpose_apply(out, rhs, parallelism, stack)
}
Expand All @@ -82,7 +82,7 @@ impl<E: ComplexField, I: Index, ViewE: Conjugate<Canonical = E>> BiLinOp<E>
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
self.as_ref().adjoint_apply(out, rhs, parallelism, stack)
}
Expand Down
8 changes: 4 additions & 4 deletions src/linop/linop_impl/csc_matown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl<E: ComplexField, I: Index, ViewE: Conjugate<Canonical = E>> LinOp<E>
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
self.as_ref().apply(out, rhs, parallelism, stack)
}
Expand All @@ -45,7 +45,7 @@ impl<E: ComplexField, I: Index, ViewE: Conjugate<Canonical = E>> LinOp<E>
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
self.as_ref().conj_apply(out, rhs, parallelism, stack)
}
Expand All @@ -70,7 +70,7 @@ impl<E: ComplexField, I: Index, ViewE: Conjugate<Canonical = E>> BiLinOp<E>
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
self.as_ref().transpose_apply(out, rhs, parallelism, stack)
}
Expand All @@ -82,7 +82,7 @@ impl<E: ComplexField, I: Index, ViewE: Conjugate<Canonical = E>> BiLinOp<E>
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
self.as_ref().adjoint_apply(out, rhs, parallelism, stack)
}
Expand Down
8 changes: 4 additions & 4 deletions src/linop/linop_impl/csc_matref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl<E: ComplexField, I: Index, ViewE: Conjugate<Canonical = E>> LinOp<E>
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
_ = stack;
crate::sparse::linalg::matmul::sparse_dense_matmul(
Expand All @@ -54,7 +54,7 @@ impl<E: ComplexField, I: Index, ViewE: Conjugate<Canonical = E>> LinOp<E>
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
_ = stack;
let this = self.conjugate();
Expand Down Expand Up @@ -89,7 +89,7 @@ impl<E: ComplexField, I: Index, ViewE: Conjugate<Canonical = E>> BiLinOp<E>
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
_ = stack;
let this = self.transpose();
Expand All @@ -110,7 +110,7 @@ impl<E: ComplexField, I: Index, ViewE: Conjugate<Canonical = E>> BiLinOp<E>
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
_ = stack;
let this = self.adjoint();
Expand Down
8 changes: 4 additions & 4 deletions src/linop/linop_impl/csr_matmut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl<E: ComplexField, I: Index, ViewE: Conjugate<Canonical = E>> LinOp<E>
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
self.as_ref().apply(out, rhs, parallelism, stack)
}
Expand All @@ -45,7 +45,7 @@ impl<E: ComplexField, I: Index, ViewE: Conjugate<Canonical = E>> LinOp<E>
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
self.as_ref().conj_apply(out, rhs, parallelism, stack)
}
Expand All @@ -70,7 +70,7 @@ impl<E: ComplexField, I: Index, ViewE: Conjugate<Canonical = E>> BiLinOp<E>
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
self.as_ref().transpose_apply(out, rhs, parallelism, stack)
}
Expand All @@ -82,7 +82,7 @@ impl<E: ComplexField, I: Index, ViewE: Conjugate<Canonical = E>> BiLinOp<E>
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
self.as_ref().adjoint_apply(out, rhs, parallelism, stack)
}
Expand Down
8 changes: 4 additions & 4 deletions src/linop/linop_impl/csr_matown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl<E: ComplexField, I: Index, ViewE: Conjugate<Canonical = E>> LinOp<E>
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
self.as_ref().apply(out, rhs, parallelism, stack)
}
Expand All @@ -45,7 +45,7 @@ impl<E: ComplexField, I: Index, ViewE: Conjugate<Canonical = E>> LinOp<E>
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
self.as_ref().conj_apply(out, rhs, parallelism, stack)
}
Expand All @@ -70,7 +70,7 @@ impl<E: ComplexField, I: Index, ViewE: Conjugate<Canonical = E>> BiLinOp<E>
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
self.as_ref().transpose_apply(out, rhs, parallelism, stack)
}
Expand All @@ -82,7 +82,7 @@ impl<E: ComplexField, I: Index, ViewE: Conjugate<Canonical = E>> BiLinOp<E>
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
self.as_ref().adjoint_apply(out, rhs, parallelism, stack)
}
Expand Down
8 changes: 4 additions & 4 deletions src/linop/linop_impl/csr_matref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl<E: ComplexField, I: Index, ViewE: Conjugate<Canonical = E>> LinOp<E>
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
_ = stack;
crate::sparse::linalg::matmul::dense_sparse_matmul(
Expand All @@ -54,7 +54,7 @@ impl<E: ComplexField, I: Index, ViewE: Conjugate<Canonical = E>> LinOp<E>
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
_ = stack;
let this = self.conjugate();
Expand Down Expand Up @@ -89,7 +89,7 @@ impl<E: ComplexField, I: Index, ViewE: Conjugate<Canonical = E>> BiLinOp<E>
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
_ = stack;
let this = self.transpose();
Expand All @@ -110,7 +110,7 @@ impl<E: ComplexField, I: Index, ViewE: Conjugate<Canonical = E>> BiLinOp<E>
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
_ = stack;
let this = self.adjoint();
Expand Down
16 changes: 8 additions & 8 deletions src/linop/linop_impl/diagmut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl<E: ComplexField, ViewE: Conjugate<Canonical = E>> LinOp<E> for DiagMut<'_,
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
self.as_ref().apply(out, rhs, parallelism, stack)
}
Expand All @@ -40,7 +40,7 @@ impl<E: ComplexField, ViewE: Conjugate<Canonical = E>> LinOp<E> for DiagMut<'_,
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
self.as_ref().conj_apply(out, rhs, parallelism, stack)
}
Expand All @@ -61,7 +61,7 @@ impl<E: ComplexField, ViewE: Conjugate<Canonical = E>> BiLinOp<E> for DiagMut<'_
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
self.as_ref().transpose_apply(out, rhs, parallelism, stack)
}
Expand All @@ -71,7 +71,7 @@ impl<E: ComplexField, ViewE: Conjugate<Canonical = E>> BiLinOp<E> for DiagMut<'_
out: MatMut<'_, E>,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
self.as_ref().adjoint_apply(out, rhs, parallelism, stack)
}
Expand All @@ -86,15 +86,15 @@ impl<E: ComplexField, ViewE: Conjugate<Canonical = E>> Precond<E> for DiagMut<'_
self.as_ref().apply_in_place_req(rhs_ncols, parallelism)
}

fn apply_in_place(&self, rhs: MatMut<'_, E>, parallelism: Parallelism, stack: PodStack<'_>) {
fn apply_in_place(&self, rhs: MatMut<'_, E>, parallelism: Parallelism, stack: &mut PodStack) {
self.as_ref().apply_in_place(rhs, parallelism, stack)
}

fn conj_apply_in_place(
&self,
rhs: MatMut<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
self.as_ref().conj_apply_in_place(rhs, parallelism, stack)
}
Expand All @@ -113,7 +113,7 @@ impl<E: ComplexField, ViewE: Conjugate<Canonical = E>> BiPrecond<E> for DiagMut<
&self,
rhs: MatMut<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
self.as_ref()
.transpose_apply_in_place(rhs, parallelism, stack)
Expand All @@ -123,7 +123,7 @@ impl<E: ComplexField, ViewE: Conjugate<Canonical = E>> BiPrecond<E> for DiagMut<
&self,
rhs: MatMut<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
self.as_ref()
.adjoint_apply_in_place(rhs, parallelism, stack)
Expand Down
Loading

0 comments on commit 7e5435d

Please sign in to comment.