[petsc-dev] MATOP_MAT_MULT
Stefano Zampini
stefano.zampini at gmail.com
Sat May 9 13:00:14 CDT 2020
Il giorno sab 9 mag 2020 alle ore 19:43 Jose E. Roman <jroman at dsic.upv.es>
ha scritto:
>
>
> > El 9 may 2020, a las 12:45, Stefano Zampini <stefano.zampini at gmail.com>
> escribió:
> >
> > Jose
> >
> > I have just pushed a test
> https://gitlab.com/petsc/petsc/-/blob/d64c2bc63c8d5d1a8c689f1abc762ae2722bba26/src/mat/tests/ex69.c
> > See if it fits your framework, and feel free to modify the test to add
> more checks
>
> Almost good. The following modification of the example fails with -test 1:
>
>
> diff --git a/src/mat/tests/ex69.c b/src/mat/tests/ex69.c
> index e562f1e2e3..2df2c89be1 100644
> --- a/src/mat/tests/ex69.c
> +++ b/src/mat/tests/ex69.c
> @@ -84,6 +84,10 @@ int main(int argc,char **argv)
> }
> ierr = VecCUDARestoreArray(v,&vv);CHKERRQ(ierr);
>
> + if (test==1) {
> + ierr = MatDenseCUDAGetArray(B,&aa);CHKERRQ(ierr);
> + if (aa) SETERRQ(PETSC_COMM_WORLD,PETSC_ERR_USER,"Expected a null
> pointer");
> + }
>
> /* free work space */
> ierr = MatDestroy(&B);CHKERRQ(ierr);
>
>
>
> I would expect that after MatDenseCUDAResetArray() the pointer is NULL
> because it was set so in line 60. In the CPU counterpart it works as
> expected.
>
> Pushed a fix for this, thanks.
> Another comment is: in line 60 you have changed MatDenseCUDAPlaceArray()
> to MatDenseCUDAReplaceArray(). This is ok, but it is strange because
> MatDenseReplaceArray() does not exist. So the interface is different in GPU
> vs CPU, but I guess it is necessary here.
>
> I think we do not support calling PlaceArray twice anywhere PETSc. This is
why I have added MatDenseCUDAReplaceArray(). If you need support for the
CPU case too, I can add it.
> Thanks.
> Jose
>
>
> >
> >
> > Il giorno ven 8 mag 2020 alle ore 18:48 Jose E. Roman <
> jroman at dsic.upv.es> ha scritto:
> > Attached. Run with -test 1 or -test 2
> >
> > > El 8 may 2020, a las 17:14, Stefano Zampini <stefano.zampini at gmail.com>
> escribió:
> > >
> > > Jose
> > >
> > > Just send me a MWE and I’ll fix the case for you
> > >
> > > Thanks
> > > Stefano
> >
> >
> > --
> > Stefano
>
>
--
Stefano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20200509/20c45c01/attachment.html>
More information about the petsc-dev
mailing list