transpose_plan_cuda Derived Type

type, public, extends(abstract_transpose_plan) :: transpose_plan_cuda

CUDA Transpose Plan


Inherits

type~~transpose_plan_cuda~~InheritsGraph type~transpose_plan_cuda transpose_plan_cuda c_ptr c_ptr type~transpose_plan_cuda->c_ptr aux type~abstract_transpose_plan abstract_transpose_plan type~transpose_plan_cuda->type~abstract_transpose_plan type~dtfft_stream_t dtfft_stream_t type~transpose_plan_cuda->type~dtfft_stream_t stream type~transpose_handle_cuda transpose_handle_cuda type~transpose_plan_cuda->type~transpose_handle_cuda fplans, bplans type~backend_helper backend_helper type~abstract_transpose_plan->type~backend_helper helper type~dtfft_backend_t dtfft_backend_t type~abstract_transpose_plan->type~dtfft_backend_t backend type~dtfft_stream_t->c_ptr stream type~abstract_backend abstract_backend type~transpose_handle_cuda->type~abstract_backend comm_handle type~dtfft_transpose_t dtfft_transpose_t type~transpose_handle_cuda->type~dtfft_transpose_t transpose_type type~nvrtc_kernel nvrtc_kernel type~transpose_handle_cuda->type~nvrtc_kernel transpose_kernel, unpack_kernel, unpack_kernel2 type~abstract_backend->type~dtfft_stream_t copy_stream type~abstract_backend->type~dtfft_backend_t backend type~abstract_backend->type~nvrtc_kernel unpack_kernel, unpack_kernel2 MPI_Comm MPI_Comm type~abstract_backend->MPI_Comm comm type~cudaevent cudaEvent type~abstract_backend->type~cudaevent execution_event, copy_event type~backend_helper->c_ptr nccl_register type~backend_helper->type~dtfft_transpose_t tranpose_type type~backend_helper->MPI_Comm comms type~ncclcomm ncclComm type~backend_helper->type~ncclcomm nccl_comm type~pencil pencil type~backend_helper->type~pencil pencils type~cufunction CUfunction type~nvrtc_kernel->type~cufunction cuda_kernel type~dim3 dim3 type~nvrtc_kernel->type~dim3 num_blocks, block_size type~kernelargs kernelArgs type~nvrtc_kernel->type~kernelargs args type~cudaevent->c_ptr event type~cufunction->c_ptr ptr type~kernelargs->c_ptr ptrs type~ncclcomm->c_ptr member

Components

Type Visibility Attributes Name Initial
type(dtfft_backend_t), public :: backend = DTFFT_BACKEND_MPI_DATATYPE

GPU backend

type(backend_helper), public :: helper

Backend helper

logical, public :: is_z_slab

Z-slab optimization flag (for 3D transforms)

integer(kind=int64), public :: min_buffer_size

Minimal buffer size for transposition

type(dtfft_stream_t), private :: stream

CUDA stream

type(c_ptr), private :: aux

Auxiliary memory

real(kind=real32), private, pointer :: paux(:)

Pointer to auxiliary memory

logical, private :: is_aux_alloc

Is auxiliary memory allocated

type(transpose_handle_cuda), private, allocatable :: fplans(:)

Forward transposition plans

type(transpose_handle_cuda), private, allocatable :: bplans(:)

Backward transposition plans


Type-Bound Procedures

procedure, public, pass(self) :: create

Create transposition plan

  • private function create(self, dims, base_comm_, effort, base_dtype, base_storage, cart_comm, comms, pencils) result(error_code)

    Creates transposition plans

    Arguments

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

    Transposition class

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

    Global sizes of the transform requested

    type(MPI_Comm), intent(in) :: base_comm_

    Base communicator

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

    dtFFT planner type of effort

    type(MPI_Datatype), intent(in) :: base_dtype

    Base MPI_Datatype

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

    Number of bytes needed to store single element

    type(MPI_Comm), intent(out) :: cart_comm

    Cartesian communicator

    type(MPI_Comm), intent(out) :: comms(:)

    Array of 1d communicators

    type(pencil), intent(out) :: pencils(:)

    Data distributing meta

    Return Value integer(kind=int32)

    Error code

procedure, public, pass(self) :: execute

Executes transposition

  • private subroutine execute(self, in, out, transpose_type)

    Executes single transposition

    Arguments

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

    Transposition class

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

    Incoming pointer

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

    Result pointer

    type(dtfft_transpose_t), intent(in) :: transpose_type

    Type of transpose

procedure, public, non_overridable, pass(self) :: get_backend

Returns backend id

procedure, public, non_overridable, pass(self) :: mem_alloc

Allocates memory based on selected backend

  • private subroutine mem_alloc(self, comm, alloc_bytes, ptr, error_code)

    Allocates memory based on selected backend

    Arguments

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

    Transposition class

    type(MPI_Comm), intent(in) :: comm

    MPI communicator

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

    Number of bytes to allocate

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

    Pointer to the allocated memory

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

    Error code

procedure, public, non_overridable, pass(self) :: mem_free

Frees memory allocated with mem_alloc

  • private subroutine mem_free(self, ptr, error_code)

    Frees memory allocated with mem_alloc

    Arguments

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

    Transposition class

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

    Pointer to the memory to free

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

    Error code

procedure, public :: create_private => create_cuda

Creates CUDA transpose plan

  • private function create_cuda(self, dims, transposed_dims, base_comm, comm_dims, effort, base_dtype, base_storage, is_custom_cart_comm, cart_comm, comms, pencils)

    Creates CUDA transpose plan

    Arguments

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

    GPU transpose plan

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

    Global sizes of the transform requested

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

    Transposed dimensions

    type(MPI_Comm), intent(in) :: base_comm

    Base communicator

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

    Number of processors in each dimension

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

    How thoroughly dtFFT searches for the optimal plan

    type(MPI_Datatype), intent(in) :: base_dtype

    Base MPI_Datatype

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

    Number of bytes needed to store single element

    logical, intent(in) :: is_custom_cart_comm

    is custom Cartesian communicator provided by user

    type(MPI_Comm), intent(out) :: cart_comm

    Cartesian communicator

    type(MPI_Comm), intent(out) :: comms(:)

    Array of 1d communicators

    type(pencil), intent(out) :: pencils(:)

    Data distributing meta

    Return Value integer(kind=int32)

procedure, public :: execute_private => execute_cuda

Executes single transposition

  • private subroutine execute_cuda(self, in, out, transpose_type)

    Executes single transposition

    Arguments

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

    Transposition class

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

    Incoming buffer

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

    Resulting buffer

    type(dtfft_transpose_t), intent(in) :: transpose_type

    Type of transpose to execute

procedure, public :: destroy => destroy_cuda

Destroys CUDA transpose plan

  • private subroutine destroy_cuda(self)

    Destroys transposition plans

    Arguments

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

    Transposition class