omptgt_field_t Derived Type

type, public, extends(field_t) :: omptgt_field_t

A device-resident field.


Inherits

type~~omptgt_field_t~~InheritsGraph type~omptgt_field_t omptgt_field_t c_ptr c_ptr type~omptgt_field_t->c_ptr dev_ptr type~field_t field_t type~omptgt_field_t->type~field_t type~field_t->type~field_t next

Components

Type Visibility Attributes Name Initial
class(field_t), public, pointer :: next
real(kind=dp), public, pointer, contiguous :: data(:,:,:)
integer, public :: dir
integer, public :: data_loc
integer, public :: refcount = 0
integer, public :: id

An integer identifying the memory block.


Finalization Procedures

final :: omptgt_field_destroy

  • private subroutine omptgt_field_destroy(self)

    Frees the device allocation when the field is finalised.

    Arguments

    Type IntentOptional Attributes Name
    type(omptgt_field_t) :: self

Type-Bound Procedures

procedure, public :: set_data_loc

  • public subroutine set_data_loc(self, data_loc)

    Arguments

    Type IntentOptional Attributes Name
    class(field_t) :: self
    integer, intent(in) :: data_loc

procedure, public :: fill => fill_omptgt

  • private subroutine fill_omptgt(self, c)

    Sets every point of the field, padding included, to the constant c.

    Arguments

    Type IntentOptional Attributes Name
    class(omptgt_field_t) :: self
    real(kind=dp), intent(in) :: c

procedure, public :: get_shape => get_shape_omptgt

  • private function get_shape_omptgt(self) result(dims)

    Returns the shape the field is currently viewed with, or -1s if set_shape has not been called yet.

    Arguments

    Type IntentOptional Attributes Name
    class(omptgt_field_t) :: self

    Return Value integer, (3)

procedure, public :: set_shape => set_shape_omptgt

  • private subroutine set_shape_omptgt(self, dims)

    Sets the shape the field is viewed with. Unlike the host and CUDA fields there is no array pointer to reshape here, so this only records the extents later used to cast the device pointer into an array.

    Arguments

    Type IntentOptional Attributes Name
    class(omptgt_field_t) :: self
    integer, intent(in) :: dims(3)

procedure, public :: get_dev_ptr

  • private function get_dev_ptr(self) result(ptr)

    Returns the device pointer to the field's storage, for use in the is_device_ptr clause of an offloaded region.

    Arguments

    Type IntentOptional Attributes Name
    class(omptgt_field_t) :: self

    Return Value type(c_ptr)