dtfft_abstract_executor Module

This module describes Abstraction for all FFT Executors: abstract_executor


Uses

  • module~~dtfft_abstract_executor~~UsesGraph module~dtfft_abstract_executor dtfft_abstract_executor iso_c_binding iso_c_binding module~dtfft_abstract_executor->iso_c_binding iso_fortran_env iso_fortran_env module~dtfft_abstract_executor->iso_fortran_env module~dtfft_interface_nvtx dtfft_interface_nvtx module~dtfft_abstract_executor->module~dtfft_interface_nvtx module~dtfft_parameters dtfft_parameters module~dtfft_abstract_executor->module~dtfft_parameters module~dtfft_pencil dtfft_pencil module~dtfft_abstract_executor->module~dtfft_pencil module~dtfft_utils dtfft_utils module~dtfft_abstract_executor->module~dtfft_utils module~dtfft_interface_nvtx->iso_c_binding module~dtfft_interface_nvtx->module~dtfft_utils module~dtfft_parameters->iso_c_binding module~dtfft_parameters->iso_fortran_env mpi_f08 mpi_f08 module~dtfft_parameters->mpi_f08 module~dtfft_pencil->iso_c_binding module~dtfft_pencil->iso_fortran_env module~dtfft_pencil->module~dtfft_parameters module~dtfft_pencil->module~dtfft_utils module~dtfft_interface_cuda_runtime dtfft_interface_cuda_runtime module~dtfft_pencil->module~dtfft_interface_cuda_runtime module~dtfft_pencil->mpi_f08 module~dtfft_utils->iso_c_binding module~dtfft_utils->iso_fortran_env module~dtfft_utils->module~dtfft_parameters module~dtfft_utils->mpi_f08 module~dtfft_interface_cuda_runtime->iso_c_binding module~dtfft_interface_cuda_runtime->module~dtfft_parameters module~dtfft_interface_cuda_runtime->module~dtfft_utils

Used by

  • module~~dtfft_abstract_executor~~UsedByGraph module~dtfft_abstract_executor dtfft_abstract_executor module~dtfft_executor_cufft_m dtfft_executor_cufft_m module~dtfft_executor_cufft_m->module~dtfft_abstract_executor module~dtfft_executor_fftw_m dtfft_executor_fftw_m module~dtfft_executor_fftw_m->module~dtfft_abstract_executor module~dtfft_executor_mkl_m dtfft_executor_mkl_m module~dtfft_executor_mkl_m->module~dtfft_abstract_executor module~dtfft_executor_vkfft_m dtfft_executor_vkfft_m module~dtfft_executor_vkfft_m->module~dtfft_abstract_executor module~dtfft_plan dtfft_plan module~dtfft_plan->module~dtfft_abstract_executor module~dtfft_plan->module~dtfft_executor_cufft_m module~dtfft_plan->module~dtfft_executor_fftw_m module~dtfft_plan->module~dtfft_executor_mkl_m module~dtfft_plan->module~dtfft_executor_vkfft_m module~dtfft dtfft module~dtfft->module~dtfft_plan module~dtfft_api dtfft_api module~dtfft_api->module~dtfft_plan

Variables

Type Visibility Attributes Name Initial
integer(kind=int8), public, parameter :: FFT_C2C = 0

Complex to complex FFT

integer(kind=int8), public, parameter :: FFT_R2C = 1

Real to complex FFT

integer(kind=int8), public, parameter :: FFT_R2R = 2

Real to real FFT

integer(kind=int8), public, parameter :: FFT_1D = 1

1D FFT

integer(kind=int8), public, parameter :: FFT_2D = 2

2D FFT


Abstract Interfaces

abstract interface

  • private subroutine create_interface(self, fft_rank, fft_type, precision, idist, odist, how_many, fft_sizes, inembed, onembed, error_code, r2r_kinds)

    Creates FFT plan

    Arguments

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

    FFT Executor

    integer(kind=int8), intent(in) :: fft_rank

    Rank of fft: 1 or 2

    integer(kind=int8), intent(in) :: fft_type

    Type of fft: r2r, r2c, c2c

    type(dtfft_precision_t), intent(in) :: precision

    Precision of fft: DTFFT_SINGLE or DTFFT_DOUBLE

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

    Distance between the first element of two consecutive signals in a batch of the input data.

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

    Distance between the first element of two consecutive signals in a batch of the output data.

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

    Number of transforms to create

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

    Dimensions of transform

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

    Storage dimensions of the input data in memory.

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

    Storage dimensions of the output data in memory.

    integer(kind=int32), intent(inout) :: error_code

    Error code to be returned to user

    type(dtfft_r2r_kind_t), intent(in), optional :: r2r_kinds(:)

    Kinds of r2r transform

abstract interface

  • private subroutine execute_interface(self, a, b, sign)

    Executes plan

    Arguments

    Type IntentOptional Attributes Name
    class(abstract_executor), intent(in) :: self

    FFT Executor

    type(c_ptr), intent(in) :: a

    Source pointer

    type(c_ptr), intent(in) :: b

    Target pointer

    integer(kind=int8), intent(in) :: sign

    Sign of transform

abstract interface

  • private subroutine destroy_interface(self)

    Destroys plan

    Arguments

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

    FFT Executor

abstract interface

  • private subroutine mem_alloc_interface(alloc_bytes, ptr)

    Allocates aligned memory

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int64), intent(in) :: alloc_bytes

    Number of bytes to allocate

    type(c_ptr), intent(out) :: ptr

    Allocated pointer

abstract interface

  • private subroutine mem_free_interface(ptr)

    Frees aligned memory

    Arguments

    Type IntentOptional Attributes Name
    type(c_ptr), intent(in) :: ptr

    Pointer to free


Derived Types

type, public, abstract ::  abstract_executor

The “most” abstract executor. All FFT executors are extending this class.

Components

Type Visibility Attributes Name Initial
type(c_ptr), public :: plan_forward

Pointer to forward plan

type(c_ptr), public :: plan_backward

Pointer to backward plan

logical, public :: is_inverse_copied = .false.

Is inverse plan copied?

logical, private :: is_created = .false.

Is plan created?

Type-Bound Procedures

procedure, public, non_overridable, pass(self) :: create ../../

Creates FFT plan

procedure, public, non_overridable, pass(self) :: execute ../../

Executes plan

procedure, public, non_overridable, pass(self) :: destroy ../../

Destroys plan

procedure(mem_alloc_interface), public, deferred, nopass :: mem_alloc ../../

Allocates aligned memory

procedure(mem_free_interface), public, deferred, nopass :: mem_free ../../

Frees aligned memory

procedure(create_interface), public, deferred, pass(self) :: create_private ../../

Creates FFT plan

procedure(execute_interface), public, deferred, pass(self) :: execute_private ../../

Executes plan

procedure(destroy_interface), public, deferred, pass(self) :: destroy_private ../../

Destroys plan


Functions

private function create(self, fft_rank, fft_type, precision, real_pencil, complex_pencil, r2r_kinds)

Creates FFT plan

Arguments

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

FFT Executor

integer(kind=int8), intent(in) :: fft_rank

Rank of fft: 1 or 2

integer(kind=int8), intent(in) :: fft_type

Type of fft: r2r, r2c, c2c

type(dtfft_precision_t), intent(in) :: precision

Precision of fft: DTFFT_SINGLE or DTFFT_DOUBLE

type(pencil), intent(in), optional :: real_pencil

Real data layout

type(pencil), intent(in), optional :: complex_pencil

Complex data layout

type(dtfft_r2r_kind_t), intent(in), optional :: r2r_kinds(:)

Kinds of r2r transform

Return Value integer(kind=int32)


Subroutines

private subroutine execute(self, in, out, sign)

Executes plan

Arguments

Type IntentOptional Attributes Name
class(abstract_executor), intent(in) :: self

FFT Executor

type(c_ptr), intent(in) :: in

Source buffer

type(c_ptr), intent(in) :: out

Target buffer

integer(kind=int8), intent(in) :: sign

Sign of transform

private subroutine destroy(self)

Destroys plan

Arguments

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

FFT Executor