Open wavefunction91 opened 1 year ago
I understand the desire for this.
Because of dealing with remote memory and CPU and GPU memory spaces, we almost never have const Matrix objects. E.g.,
gemm( scalar_t alpha, Matrix& A, Matrix& B, scalar_t beta, Matrix& C )
with no const
on A
or B
, even though they are logically const. This is because we need to move or copy tiles from CPU to GPU memory, and also to insert temporary remote tiles from other MPI processes. So while the numerical data of A and B isn't changing, their Matrix objects change quite a lot during gemm.
Describe the problem you are solving
Currently, the
Tile
accessor inBaseMatrix
is not const-accessible. https://github.com/icl-utk-edu/slate/blob/6dbdcd2bf5702d366e6955ffab0586e2aa4eaed1/include/slate/BaseMatrix.hh#L153It would be highly desirable to expose a read-only,
const
compatible overload of this function for appropriateconst
-correct contexts.Describe your proposed solution
I am unfamiliar with the shallow
Tile
interface, but one would generally want to return aTile
which wraps immutable data, e.g.The latter precludes mutation downstream