1. petsc
  2. PETSc
  3. petsc

Commits

Satish Balay  committed 4a73821

cusp: fix VecGetArray() as its switching codepath to cusp [when it shouldn't]
This fixes memory leak in src/ksp/ksp/examples/tutorials, runex43_3 etc.
[with cusp/txpetscgpu enabled]

  • Participants
  • Parent commits 5c0c244
  • Branches master

Comments (0)

Files changed (1)

File src/vec/vec/interface/rvector.c

View file
   PetscValidHeaderSpecific(x,VEC_CLASSID,1);
   if (x->petscnative) {
 #if defined(PETSC_HAVE_CUSP)
-    if (x->valid_GPU_array == PETSC_CUSP_GPU || !*((PetscScalar**)x->data)) {
+    if (x->valid_GPU_array == PETSC_CUSP_GPU) {
       ierr = VecCUSPCopyFromGPU(x);CHKERRQ(ierr);
     }
 #endif
   PetscValidHeaderSpecific(x,VEC_CLASSID,1);
   if (x->petscnative) {
 #if defined(PETSC_HAVE_CUSP)
-    if (x->valid_GPU_array == PETSC_CUSP_GPU || !*((PetscScalar**)x->data)) {
+    if (x->valid_GPU_array == PETSC_CUSP_GPU) {
       ierr = VecCUSPCopyFromGPU(x);CHKERRQ(ierr);
     }
 #endif