[petsc-dev] MATOP_MAT_MULT
    Jose E. Roman 
    jroman at dsic.upv.es
       
    Sat May  9 11:42:56 CDT 2020
    
    
  
> 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.
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.
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
    
    
More information about the petsc-dev
mailing list