dtfft_executor_fftw_m Module

This module describes FFTW3 based FFT Executor: fftw_executor

http://www.fftw.org


Uses

  • module~~dtfft_executor_fftw_m~~UsesGraph module~dtfft_executor_fftw_m dtfft_executor_fftw_m iso_c_binding iso_c_binding module~dtfft_executor_fftw_m->iso_c_binding iso_fortran_env iso_fortran_env module~dtfft_executor_fftw_m->iso_fortran_env module~dtfft_abstract_executor dtfft_abstract_executor module~dtfft_executor_fftw_m->module~dtfft_abstract_executor module~dtfft_interface_fftw_m dtfft_interface_fftw_m module~dtfft_executor_fftw_m->module~dtfft_interface_fftw_m module~dtfft_parameters dtfft_parameters module~dtfft_executor_fftw_m->module~dtfft_parameters module~dtfft_pencil dtfft_pencil module~dtfft_executor_fftw_m->module~dtfft_pencil module~dtfft_utils dtfft_utils module~dtfft_executor_fftw_m->module~dtfft_utils module~dtfft_abstract_executor->iso_c_binding module~dtfft_abstract_executor->iso_fortran_env module~dtfft_abstract_executor->module~dtfft_parameters module~dtfft_abstract_executor->module~dtfft_pencil module~dtfft_abstract_executor->module~dtfft_utils module~dtfft_interface_nvtx dtfft_interface_nvtx module~dtfft_abstract_executor->module~dtfft_interface_nvtx module~dtfft_interface_fftw_m->iso_c_binding dtfft_interface_fftw_native_m dtfft_interface_fftw_native_m module~dtfft_interface_fftw_m->dtfft_interface_fftw_native_m 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 module~dtfft_interface_nvtx->iso_c_binding module~dtfft_interface_nvtx->module~dtfft_utils

Used by

  • module~~dtfft_executor_fftw_m~~UsedByGraph module~dtfft_executor_fftw_m dtfft_executor_fftw_m module~dtfft_plan dtfft_plan module~dtfft_plan->module~dtfft_executor_fftw_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=int32), private, parameter :: FFTW3_FLAGS = FFTW_MEASURE+FFTW_DESTROY_INPUT

FFTW3 planner flags


Abstract Interfaces

abstract interface

  • private function create_c2c_plan(rank, n, howmany, in, inembed, istride, idist, out, onembed, ostride, odist, sign, flags) bind(C)

    Creates C2C FFTW3 Plan

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=c_int), value :: rank
    integer(kind=c_int) :: n(*)
    integer(kind=c_int), value :: howmany
    type(c_ptr), value :: in
    integer(kind=c_int) :: inembed(*)
    integer(kind=c_int), value :: istride
    integer(kind=c_int), value :: idist
    type(c_ptr), value :: out
    integer(kind=c_int) :: onembed(*)
    integer(kind=c_int), value :: ostride
    integer(kind=c_int), value :: odist
    integer(kind=C_INT), value :: sign
    integer(kind=c_int), value :: flags

    Return Value type(c_ptr)

abstract interface

  • private function create_r2c_plan(rank, n, howmany, in, inembed, istride, idist, out, onembed, ostride, odist, flags) bind(C)

    Creates R2C FFTW3 Plan

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=c_int), value :: rank
    integer(kind=c_int) :: n(*)
    integer(kind=c_int), value :: howmany
    type(c_ptr), value :: in
    integer(kind=c_int) :: inembed(*)
    integer(kind=c_int), value :: istride
    integer(kind=c_int), value :: idist
    type(c_ptr), value :: out
    integer(kind=c_int) :: onembed(*)
    integer(kind=c_int), value :: ostride
    integer(kind=c_int), value :: odist
    integer(kind=c_int), value :: flags

    Return Value type(c_ptr)

abstract interface

  • private function create_r2r_plan(rank, n, howmany, in, inembed, istride, idist, out, onembed, ostride, odist, kinds, flags) bind(C)

    Creates R2R FFTW3 Plan

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=c_int), value :: rank
    integer(kind=c_int) :: n(*)
    integer(kind=c_int), value :: howmany
    type(c_ptr), value :: in
    integer(kind=c_int) :: inembed(*)
    integer(kind=c_int), value :: istride
    integer(kind=c_int), value :: idist
    type(c_ptr), value :: out
    integer(kind=c_int) :: onembed(*)
    integer(kind=c_int), value :: ostride
    integer(kind=c_int), value :: odist
    integer(kind=C_FFTW_R2R_KIND), intent(in) :: kinds(*)
    integer(kind=c_int), value :: flags

    Return Value type(c_ptr)

abstract interface

  • private subroutine apply_interface(plan, in, out) bind(C)

    Executes FFTW3 Plan

    Arguments

    Type IntentOptional Attributes Name
    type(c_ptr), value :: plan
    type(c_ptr), value :: in
    type(c_ptr), value :: out

abstract interface

  • private subroutine free_interface(plan) bind(C)

    Destroys FFTW3 Plan

    Arguments

    Type IntentOptional Attributes Name
    type(c_ptr), value :: plan

Derived Types

type, public, extends(abstract_executor) ::  fftw_executor

FFTW3 FFT Executor

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?

procedure(apply_interface), private, nopass, pointer :: apply => NULL()

Pointer to FFTW3 function that executes FFT plan

procedure(free_interface), private, nopass, pointer :: free => NULL()

Pointer to FFTW3 function that destroys FFT plan

procedure(apply_interface), private, nopass, pointer :: apply_inverse => NULL()

Pointer to FFTW3 function that executes inverse FFT plan Used in R2C only

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, public :: create_private => create ../../

Creates FFT plan via FFTW3 Interface

procedure, public :: execute_private => execute ../../

Executes FFTW3 plan

procedure, public :: destroy_private => destroy ../../

Destroys FFTW3 plan

procedure, public, nopass :: mem_alloc ../../

Allocates FFTW3 memory

procedure, public, nopass :: mem_free ../../

Frees FFTW3 aligned memory


Subroutines

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

Creates FFT plan via FFTW3 Interface

Arguments

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

FFTW 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

private subroutine execute(self, a, b, sign)

Executes FFTW3 plan

Arguments

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

FFTW 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

private subroutine destroy(self)

Destroys FFTW3 plan

Arguments

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

FFTW FFT Executor

private subroutine mem_alloc(alloc_bytes, ptr)

Allocates FFTW3 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

private subroutine mem_free(ptr)

Frees FFTW3 aligned memory

Arguments

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

Pointer to free