Grow each device buffer to hold the current logical array, reusing the existing allocation when the bytes already fit (AMR Stage 6b). A device pointer carries no shape, so unlike the host side no remapping is needed - only a byte-capacity check.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Scalar2D), | intent(inout) | :: | this |
subroutine EnsureDeviceBuffers_Scalar2D(this)
!! Grow each device buffer to hold the current logical array, reusing the existing allocation
!! when the bytes already fit (AMR Stage 6b). A device pointer carries no shape, so unlike the
!! host side no remapping is needed - only a byte-capacity check.
implicit none
class(Scalar2D),intent(inout) :: this
call EnsureDeviceBuffer(this%interior_gpu,this%alloc_interior,sizeof(this%interior))
call EnsureDeviceBuffer(this%boundary_gpu,this%alloc_boundary,sizeof(this%boundary))
call EnsureDeviceBuffer(this%extBoundary_gpu,this%alloc_extBoundary, &
sizeof(this%extBoundary))
call EnsureDeviceBuffer(this%avgBoundary_gpu,this%alloc_avgBoundary, &
sizeof(this%avgBoundary))
call EnsureDeviceBuffer(this%boundarynormal_gpu,this%alloc_boundarynormal, &
sizeof(this%boundarynormal))
endsubroutine EnsureDeviceBuffers_Scalar2D