Free_Tensor2D Subroutine

public subroutine Free_Tensor2D(this)

Arguments

TypeIntentOptionalAttributesName
class(Tensor2D), intent(inout) :: this

Calls

proc~~free_tensor2d~~CallsGraph proc~free_tensor2d Free_Tensor2D proc~free_tensor2d_t Free_Tensor2D_t proc~free_tensor2d->proc~free_tensor2d_t proc~gpucheck gpuCheck proc~free_tensor2d->proc~gpucheck interface~hipfree hipFree proc~free_tensor2d->interface~hipfree

Contents

Source Code


Source Code

  subroutine Free_Tensor2D(this)
    implicit none
    class(Tensor2D),intent(inout) :: this

    this%interp => null()
    this%nVar = 0
    this%nElem = 0

    ! Host storage is owned by the pools in the parent type (Stage 6b/6c), so the parent Free
    ! releases it rather than deallocating these pointers.
    call Free_Tensor2D_t(this)

    call gpuCheck(hipFree(this%interior_gpu))
    call gpuCheck(hipFree(this%boundary_gpu))
    call gpuCheck(hipFree(this%extBoundary_gpu))
    this%interior_gpu = c_null_ptr
    this%boundary_gpu = c_null_ptr
    this%extBoundary_gpu = c_null_ptr
    this%alloc_interior = 0
    this%alloc_boundary = 0
    this%alloc_extBoundary = 0

  endsubroutine Free_Tensor2D