Free_Points Subroutine

public subroutine Free_Points(this)

Arguments

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

Calls

proc~~free_points~~CallsGraph proc~free_points Free_Points interface~hipfree hipFree proc~free_points->interface~hipfree proc~gpucheck gpuCheck proc~free_points->proc~gpucheck

Contents

Source Code


Source Code

  subroutine Free_Points(this)
    implicit none
    class(Points),intent(inout) :: this

    if(allocated(this%x)) deallocate(this%x)
    if(associated(this%elements)) deallocate(this%elements)
    if(associated(this%coordinates)) deallocate(this%coordinates)
    if(associated(this%lS_cache)) deallocate(this%lS_cache)
    if(associated(this%lT_cache)) deallocate(this%lT_cache)
    if(associated(this%lU_cache)) deallocate(this%lU_cache)
    this%elements => null()
    this%coordinates => null()
    this%lS_cache => null()
    this%lT_cache => null()
    this%lU_cache => null()

    if(c_associated(this%elements_gpu)) call gpuCheck(hipFree(this%elements_gpu))
    if(c_associated(this%coordinates_gpu)) call gpuCheck(hipFree(this%coordinates_gpu))
    if(c_associated(this%lS_cache_gpu)) call gpuCheck(hipFree(this%lS_cache_gpu))
    if(c_associated(this%lT_cache_gpu)) call gpuCheck(hipFree(this%lT_cache_gpu))
    if(c_associated(this%lU_cache_gpu)) call gpuCheck(hipFree(this%lU_cache_gpu))
    this%elements_gpu = c_null_ptr
    this%coordinates_gpu = c_null_ptr
    this%lS_cache_gpu = c_null_ptr
    this%lT_cache_gpu = c_null_ptr
    this%lU_cache_gpu = c_null_ptr

    this%nPoints = 0
    this%nDim = 0
    this%nCached = 0
    this%nPointsAlloc = 0
    this%nCachedAlloc = 0

  endsubroutine Free_Points