dtfft_interface_vkfft_m Module

This module creates interface with VkFFT library

VkFFT is loaded at runtime via dynamic loading.


Uses

  • module~~dtfft_interface_vkfft_m~~UsesGraph module~dtfft_interface_vkfft_m dtfft_interface_vkfft_m iso_c_binding iso_c_binding module~dtfft_interface_vkfft_m->iso_c_binding iso_fortran_env iso_fortran_env module~dtfft_interface_vkfft_m->iso_fortran_env module~dtfft_parameters dtfft_parameters module~dtfft_interface_vkfft_m->module~dtfft_parameters module~dtfft_utils dtfft_utils module~dtfft_interface_vkfft_m->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_utils->iso_c_binding module~dtfft_utils->iso_fortran_env module~dtfft_utils->module~dtfft_parameters module~dtfft_utils->mpi_f08

Used by

  • module~~dtfft_interface_vkfft_m~~UsedByGraph module~dtfft_interface_vkfft_m dtfft_interface_vkfft_m module~dtfft_executor_vkfft_m dtfft_executor_vkfft_m module~dtfft_executor_vkfft_m->module~dtfft_interface_vkfft_m module~dtfft_plan dtfft_plan 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
type(vkfft_wrapper), public, save, target :: cuda_wrapper

VkFFT Wrapper for CUDA platform


Abstract Interfaces

abstract interface

  • private subroutine vkfft_create_interface(rank, dims, double_precision, how_many, r2c, c2r, dct, dst, stream, app_handle) bind(C)

    Creates FFT plan via vkFFT Interface

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=c_int8_t), value :: rank

    Rank of fft: 1 or 2

    integer(kind=c_int) :: dims(*)

    Dimensions of transform

    integer(kind=c_int), value :: double_precision

    Precision of fft: DTFFT_SINGLE or DTFFT_DOUBLE

    integer(kind=c_int), value :: how_many

    Number of transforms to create

    integer(kind=c_int8_t), value :: r2c

    Is R2C transform required

    integer(kind=c_int8_t), value :: c2r

    Is C2R transform required

    integer(kind=c_int8_t), value :: dct

    Is DCT transform required

    integer(kind=c_int8_t), value :: dst

    Is DST transform required

    type(dtfft_stream_t), value :: stream

    CUDA stream

    type(c_ptr) :: app_handle

    vkFFT application handle

abstract interface

  • private subroutine vkfft_execute_interface(app_handle, in, out, sign) bind(C)

    Executes vkFFT plan

    Arguments

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

    vkFFT application handle

    type(c_ptr), value :: in

    Input data

    type(c_ptr), value :: out

    Output data

    integer(kind=c_int8_t), value :: sign

    Sign of FFT

abstract interface

  • private subroutine vkfft_destroy_interface(app_handle) bind(C)

    Destroys vkFFT plan

    Arguments

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

    vkFFT application handle


Derived Types

type, public ::  vkfft_wrapper

VkFFT Wrapper

Components

Type Visibility Attributes Name Initial
procedure(vkfft_create_interface), public, pointer, nopass :: create

Fortran Pointer to vkFFT create function

procedure(vkfft_execute_interface), public, pointer, nopass :: execute

Fortran Pointer to vkFFT execute function

procedure(vkfft_destroy_interface), public, pointer, nopass :: destroy

Fortran Pointer to vkFFT destroy function

logical, private :: is_loaded = .false.

Is VkFFT library loaded

type(c_ptr), private :: lib_handle

Handle to the loaded library

type(c_funptr), private :: vkfft_functions(3)

Array of VkFFT functions


Functions

public function load_vkfft(platform)

Loads VkFFT library based on the platform

Arguments

Type IntentOptional Attributes Name
type(dtfft_platform_t), intent(in) :: platform

Platform to load VkFFT library for

Return Value integer(kind=int32)

private function load(wrapper, suffix) result(error_code)

Loads VkFFT library

Arguments

Type IntentOptional Attributes Name
class(vkfft_wrapper), intent(inout) :: wrapper

VkFFT Wrapper

character(len=*), intent(in) :: suffix

Suffix for the library name

Return Value integer(kind=int32)