kernel_host Derived Type

type, public, extends(abstract_kernel) :: kernel_host

Host kernel implementation


Inherits

type~~kernel_host~~InheritsGraph type~kernel_host kernel_host type~abstract_kernel abstract_kernel type~kernel_host->type~abstract_kernel type~kernel_type_t kernel_type_t type~abstract_kernel->type~kernel_type_t kernel_type

Components

Type Visibility Attributes Name Initial
logical, public :: is_created = .false.

Kernel is created flag.

logical, public :: is_dummy = .false.

If kernel should do anything or not.

type(kernel_type_t), public :: kernel_type

Type of the kernel

character(len=:), public, allocatable :: kernel_string
integer(kind=int32), public, allocatable :: neighbor_data(:,:)

Neighbor data for pipelined unpacking

integer(kind=int32), public, allocatable :: dims(:)

Local dimensions to process

integer(kind=int8), public :: access_mode

Access mode for kernel execution

procedure(execute_host_interface), public, pointer :: execute_impl => null()

Pointer to the execute implementation


Type-Bound Procedures

procedure, public, pass(self) :: create

Creates kernel

  • private subroutine create(self, dims, effort, base_storage, kernel_type, neighbor_data, force_effort)

    Creates kernel

    Arguments

    Type IntentOptional Attributes Name
    class(abstract_kernel), intent(inout) :: self

    Abstract kernel

    integer(kind=int32), intent(in) :: dims(:)

    Local dimensions to process

    type(dtfft_effort_t), intent(in) :: effort

    Effort level for generating transpose kernels

    integer(kind=int64), intent(in) :: base_storage

    Number of bytes needed to store single element

    type(kernel_type_t), intent(in) :: kernel_type

    Type of kernel to build

    integer(kind=int32), intent(in), optional :: neighbor_data(:,:)

    Optional pointers for unpack kernels

    logical, intent(in), optional :: force_effort

    Should effort be forced or not

procedure, public, pass(self) :: execute

Executes kernel

  • private subroutine execute(self, in, out, stream, neighbor)

    Executes kernel

    Arguments

    Type IntentOptional Attributes Name
    class(abstract_kernel), intent(inout) :: self

    Abstract kernel

    real(kind=real32), intent(in) :: in(:)

    Source buffer, can be device or host pointer

    real(kind=real32), intent(inout) :: out(:)

    Target buffer, can be device or host pointer

    type(dtfft_stream_t), intent(in) :: stream

    Stream to execute on, used only for device pointers

    integer(kind=int32), intent(in), optional :: neighbor

    Source rank for pipelined unpacking

procedure, public, pass(self) :: destroy

Destroys kernel

  • private subroutine destroy(self)

    Destroys kernel

    Arguments

    Type IntentOptional Attributes Name
    class(abstract_kernel), intent(inout) :: self

    Abstract kernel

procedure, public :: create_private => create_host

Creates kernel

  • private subroutine create_host(self, effort, base_storage, force_effort)

    Creates host kernel

    Arguments

    Type IntentOptional Attributes Name
    class(kernel_host), intent(inout) :: self

    Host kernel class

    type(dtfft_effort_t), intent(in) :: effort

    Effort level for generating transpose kernels

    integer(kind=int64), intent(in) :: base_storage

    Number of bytes needed to store single element

    logical, intent(in), optional :: force_effort

    Should effort be forced or not

procedure, public :: execute_private => execute_host

Executes kernel

  • private subroutine execute_host(self, in, out, stream, neighbor)

    Executes host kernel

    Arguments

    Type IntentOptional Attributes Name
    class(kernel_host), intent(inout) :: self

    Host kernel class

    real(kind=real32), intent(in), target :: in(:)

    Source host-allocated buffer

    real(kind=real32), intent(inout), target :: out(:)

    Target host-allocated buffer

    type(dtfft_stream_t), intent(in) :: stream

    Stream to execute on, unused here

    integer(kind=int32), intent(in), optional :: neighbor

    Source rank for pipelined unpacking

procedure, public :: destroy_private => destroy_host

Destroys kernel

  • private subroutine destroy_host(self)

    Destroys host kernel

    Arguments

    Type IntentOptional Attributes Name
    class(kernel_host), intent(inout) :: self

    Host kernel class

procedure, public :: execute_benchmark

  • private subroutine execute_benchmark(self, in, out, n_warmup_iters, n_iters, execution_time)

    Executes benchmark for the given kernel

    Arguments

    Type IntentOptional Attributes Name
    class(kernel_host), intent(inout) :: self

    Host kernel class

    real(kind=real32), intent(in) :: in(:)

    Source host-allocated buffer

    real(kind=real32), intent(inout) :: out(:)

    Target host-allocated buffer

    integer(kind=int32), intent(in) :: n_warmup_iters

    Number of warmup iterations to perform before testing kernel

    integer(kind=int32), intent(in) :: n_iters

    Number of iterations to perform when testing kernel

    real(kind=real64), intent(out) :: execution_time

    Execution time of the selected access

procedure, public :: select_access_mode_f32

  • private subroutine select_access_mode_f32(self, in, out, n_warmup_iters, n_iters, execution_time)

    Selects the best access mode for host kernels, real(real32) version

    Arguments

    Type IntentOptional Attributes Name
    class(kernel_host), intent(inout) :: self

    Host kernel class

    real(kind=real32), intent(in) :: in(:)

    Source host-allocated buffer

    real(kind=real32), intent(inout) :: out(:)

    Target host-allocated buffer

    integer(kind=int32), intent(in) :: n_warmup_iters

    Number of warmup iterations to perform before testing kernel

    integer(kind=int32), intent(in) :: n_iters

    Number of iterations to perform when testing kernel

    real(kind=real64), intent(out) :: execution_time

    Execution time of the selected access

procedure, public :: select_access_mode_f64

  • private subroutine select_access_mode_f64(self, in, out, n_warmup_iters, n_iters, execution_time)

    Selects the best access mode for host kernels, real(real64) version

    Arguments

    Type IntentOptional Attributes Name
    class(kernel_host), intent(inout) :: self

    Host kernel class

    real(kind=real32), intent(in) :: in(:)

    Source host-allocated buffer

    real(kind=real32), intent(inout) :: out(:)

    Target host-allocated buffer

    integer(kind=int32), intent(in) :: n_warmup_iters

    Number of warmup iterations to perform before testing kernel

    integer(kind=int32), intent(in) :: n_iters

    Number of iterations to perform when testing kernel

    real(kind=real64), intent(out) :: execution_time

    Execution time of the selected access

procedure, public :: select_access_mode_f128

  • private subroutine select_access_mode_f128(self, in, out, n_warmup_iters, n_iters, execution_time)

    Selects the best access mode for host kernels, complex(real64) version

    Arguments

    Type IntentOptional Attributes Name
    class(kernel_host), intent(inout) :: self

    Host kernel class

    real(kind=real32), intent(in) :: in(:)

    Source host-allocated buffer

    real(kind=real32), intent(inout) :: out(:)

    Target host-allocated buffer

    integer(kind=int32), intent(in) :: n_warmup_iters

    Number of warmup iterations to perform before testing kernel

    integer(kind=int32), intent(in) :: n_iters

    Number of iterations to perform when testing kernel

    real(kind=real64), intent(out) :: execution_time

    Execution time of the selected access