UpdateDevice_Mesh2D Subroutine

public subroutine UpdateDevice_Mesh2D(this)

Arguments

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

Calls

proc~~updatedevice_mesh2d~~CallsGraph proc~updatedevice_mesh2d UpdateDevice_Mesh2D interface~hipmemcpy hipMemcpy proc~updatedevice_mesh2d->interface~hipmemcpy interface~hipmalloc hipMalloc proc~updatedevice_mesh2d->interface~hipmalloc proc~gpucheck gpuCheck proc~updatedevice_mesh2d->proc~gpucheck

Contents

Source Code


Source Code

  subroutine UpdateDevice_Mesh2D(this)
    implicit none
    class(Mesh2D),intent(inout) :: this

    call gpuCheck(hipMemcpy(this%sideInfo_gpu,c_loc(this%sideInfo),sizeof(this%sideInfo),hipMemcpyHostToDevice))

    ! The mortar table is created by the mesh constructors after Init; allocate its
    ! device copy on first upload.
    if(this%nMortars > 0) then
      if(.not. c_associated(this%mortarInfo_gpu)) then
        call gpuCheck(hipMalloc(this%mortarInfo_gpu,sizeof(this%mortarInfo)))
      endif
      call gpuCheck(hipMemcpy(this%mortarInfo_gpu,c_loc(this%mortarInfo), &
                              sizeof(this%mortarInfo),hipMemcpyHostToDevice))
    endif

  endsubroutine UpdateDevice_Mesh2D