mem_dealloc_d Subroutine

private subroutine mem_dealloc_d(mem, mem_type)

Deallocates memory

Arguments

Type IntentOptional Attributes Name
real(kind=real_8), DIMENSION(:), POINTER, CONTIGUOUS :: mem

memory to allocate

type(dbcsr_memtype_type), intent(in) :: mem_type

memory type


Source Code

      SUBROUTINE mem_dealloc_d (mem, mem_type)
     !! Deallocates memory

         REAL(kind=real_8), DIMENSION(:), POINTER, CONTIGUOUS :: mem
        !! memory to allocate
         TYPE(dbcsr_memtype_type), INTENT(IN)  :: mem_type
        !! memory type
         CHARACTER(len=*), PARAMETER :: routineN = 'mem_dealloc_d'
         INTEGER                               :: error_handle
!   ---------------------------------------------------------------------------

         IF (careful_mod) &
            CALL timeset(routineN, error_handle)

         IF (mem_type%acc_hostalloc .AND. SIZE(mem) > 1) THEN
            CALL acc_hostmem_deallocate(mem, mem_type%acc_stream)
         ELSE IF (mem_type%mpi .AND. dbcsr_cfg%use_mpi_allocator%val) THEN
            CALL mp_deallocate(mem)
         ELSE
            DEALLOCATE (mem)
         END IF

         IF (careful_mod) &
            CALL timestop(error_handle)
      END SUBROUTINE mem_dealloc_d