This module defines abstract_kernel type and its type bound procedures.
The abstract kernel is used in reshape_handle_generic type and
is resposible for packing/unpacking/permute operations.
The actual implementation of the kernel is deferred to the
create_private, execute_private and destroy_private procedures.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(kernel_type_t), | public, | parameter | :: | KERNEL_COMPRESSION | = | kernel_type_t(-2) |
Only compression/decompression kernel |
| type(kernel_type_t), | public, | parameter | :: | KERNEL_DUMMY | = | kernel_type_t(-1) |
Dummy kernel, does nothing |
| type(kernel_type_t), | public, | parameter | :: | KERNEL_PACK | = | kernel_type_t(1) |
Packs local buffer into contiguous memory |
| type(kernel_type_t), | public, | parameter | :: | KERNEL_COPY_PIPELINED | = | kernel_type_t(2) |
Performs partial buffer copy |
| type(kernel_type_t), | public, | parameter | :: | KERNEL_UNPACK | = | kernel_type_t(3) |
Unpacks contiguous buffer into strided layout |
| type(kernel_type_t), | public, | parameter | :: | KERNEL_COPY | = | kernel_type_t(4) |
Performs buffer copy |
| type(kernel_type_t), | public, | parameter | :: | KERNEL_UNPACK_PIPELINED | = | kernel_type_t(5) |
Unpacks only single part of contiguous buffer into strided layout |
| type(kernel_type_t), | public, | parameter | :: | KERNEL_PACK_PIPELINED | = | kernel_type_t(6) |
Packs only single part of local buffer into contiguous memory |
| type(kernel_type_t), | public, | parameter | :: | KERNEL_PERMUTE_FORWARD | = | kernel_type_t(7) |
Local permutation forward: XYZ -> YZX |
| type(kernel_type_t), | public, | parameter | :: | KERNEL_PERMUTE_BACKWARD | = | kernel_type_t(8) |
Local permutation backward: ZXY -> YZX |
| type(kernel_type_t), | public, | parameter | :: | KERNEL_PERMUTE_BACKWARD_START | = | kernel_type_t(9) |
Starts Local permutation backward: ZXY -> YXZ |
| type(kernel_type_t), | public, | parameter | :: | KERNEL_PERMUTE_BACKWARD_END | = | kernel_type_t(10) |
Ends Local permutation backward: YXZ -> YZX |
| type(kernel_type_t), | public, | parameter | :: | KERNEL_PERMUTE_BACKWARD_END_PIPELINED | = | kernel_type_t(11) |
Ends Local permutation backward: YXZ -> YZX. only partial permutation is performed |
| type(kernel_type_t), | public, | parameter | :: | KERNEL_PACK_FORWARD | = | kernel_type_t(12) |
Partial forward permutation |
| type(kernel_type_t), | public, | parameter | :: | KERNEL_PACK_BACKWARD | = | kernel_type_t(13) |
Partial backward permutation |
| type(kernel_type_t), | public, | parameter | :: | KERNEL_UNPACK_FORWARD | = | kernel_type_t(15) |
Unpacks contiguous buffer into strided layout and perform forward permutation |
| type(kernel_type_t), | public, | parameter | :: | KERNEL_UNPACK_FORWARD_PIPELINED | = | kernel_type_t(16) |
Unpacks only single part of contiguous buffer into strided layout and perform forward permutation |
| type(kernel_type_t), | public, | parameter | :: | KERNEL_UNPACK_BACKWARD | = | kernel_type_t(17) |
Unpacks contiguous buffer into strided layout and perform backward permutation |
| type(kernel_type_t), | public, | parameter | :: | KERNEL_UNPACK_BACKWARD_PIPELINED | = | kernel_type_t(18) |
Unpacks only single part of contiguous buffer into strided layout and perform backward permutation |
| type(kernel_type_t), | private, | parameter | :: | TRANSPOSE_KERNELS(*) | = | [KERNEL_PERMUTE_FORWARD, KERNEL_PERMUTE_BACKWARD, KERNEL_PERMUTE_BACKWARD_START, KERNEL_PACK_FORWARD, KERNEL_PACK_BACKWARD, KERNEL_UNPACK_FORWARD_PIPELINED, KERNEL_UNPACK_BACKWARD_PIPELINED] | |
| type(kernel_type_t), | private, | parameter | :: | UNPACK_KERNELS(*) | = | [KERNEL_PERMUTE_BACKWARD_END, KERNEL_PERMUTE_BACKWARD_END_PIPELINED, KERNEL_UNPACK, KERNEL_UNPACK_PIPELINED, KERNEL_UNPACK_FORWARD, KERNEL_UNPACK_FORWARD_PIPELINED, KERNEL_UNPACK_BACKWARD, KERNEL_UNPACK_BACKWARD_PIPELINED] |
List of all unpack kernel types |
| type(kernel_type_t), | private, | parameter | :: | PACK_KERNELS(*) | = | [KERNEL_PACK, KERNEL_COPY_PIPELINED, KERNEL_PACK_PIPELINED, KERNEL_PACK_FORWARD, KERNEL_PACK_BACKWARD] |
List of all pack kernel types |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(kernel_type_t), | intent(in) | :: | left | |||
| type(kernel_type_t), | intent(in) | :: | right |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(kernel_type_t), | intent(in) | :: | left | |||
| type(kernel_type_t), | intent(in) | :: | right |
Creates underlying kernel
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(abstract_kernel), | intent(inout) | :: | self |
Abstract kernel |
||
| 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 |
Executes underlying kernel
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(abstract_kernel), | intent(inout) | :: | self |
Abstract kernel |
||
| type(c_ptr), | intent(in) | :: | in |
Source buffer, can be device or host pointer |
||
| type(c_ptr), | intent(in) | :: | 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 |
||
| logical, | intent(in) | :: | sync |
Sync stream after kernel execution |
||
| integer(kind=int32), | intent(in), | optional | :: | neighbor |
Source rank for pipelined unpacking |
Destroys underlying kernel
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(abstract_kernel), | intent(inout) | :: | self |
Abstract kernel |
Type of kernel
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer(kind=int32), | public | :: | val |
Abstract kernel type
| 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. |
|
| logical, | public | :: | is_dummy_kernel | = | .false. |
If kernel is of type KERNEL_DUMMY |
|
| logical, | public | :: | is_dummy_compressed | = | .false. | ||
| type(kernel_type_t), | public | :: | kernel_type |
Type of the kernel |
|||
| type(string), | public | :: | kernel_string | ||||
| integer(kind=int32), | public, | allocatable | :: | neighbor_data(:,:) |
Neighbor data for pipelined unpacking |
||
| integer(kind=int32), | public, | allocatable | :: | dims(:) |
Local dimensions to process |
||
| class(abstract_compressor), | public, | pointer | :: | compressor |
Compressor pointer. Compressor itself is created by generic handle and passed here |
||
| logical, | public | :: | is_compress |
Enable compression |
|||
| logical, | public | :: | is_decompress |
Enable decompression |
|||
| integer(kind=int64), | public | :: | base_storage |
| procedure, public, pass(self) :: create | ../../ Creates kernel |
| procedure, public, pass(self) :: execute | ../../ Executes kernel |
| procedure, public, pass(self) :: destroy | ../../ Destroys kernel |
| procedure, public, pass(self) :: set_compressor | |
| procedure(create_interface), public, deferred :: create_private | ../../ Creates underlying kernel |
| procedure(execute_interface), public, deferred :: execute_private | ../../ Executes underlying kernel |
| procedure(destroy_interface), public, deferred :: destroy_private | ../../ Destroys underlying kernel |
Gets the string description of a kernel
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(kernel_type_t), | intent(in) | :: | kernel |
kernel type |
kernel string
Converts kernel to its fused version if applicable
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(kernel_type_t), | intent(in) | :: | kernel |
kernel type |
fused kernel type
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(kernel_type_t), | intent(in) | :: | param |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(kernel_type_t), | intent(in) | :: | param |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(kernel_type_t), | intent(in) | :: | param |
Converts number of bytes to number of floats needed to store them
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int64), | intent(in) | :: | bytes |
Number of bytes |
Number of floats
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(kernel_type_t), | intent(in) | :: | left | |||
| type(kernel_type_t), | intent(in) | :: | right |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(kernel_type_t), | intent(in) | :: | left | |||
| type(kernel_type_t), | intent(in) | :: | right |
Creates kernel
| Type | Intent | Optional | 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 |
|
| logical, | intent(in), | optional | :: | with_compression |
Enable compression after executing kernel |
|
| logical, | intent(in), | optional | :: | with_decompression |
Enable decompression before executing kernel |
Executes kernel
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(abstract_kernel), | intent(inout) | :: | self |
Abstract kernel |
||
| type(c_ptr), | intent(in) | :: | in |
Source buffer, can be device or host pointer |
||
| type(c_ptr), | intent(in) | :: | 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 |
|
| type(c_ptr), | intent(in), | optional | :: | aux |
Target buffer, can be device or host pointer |
|
| integer(kind=int32), | intent(inout), | optional | :: | csize |
Compressed buffer size |
|
| integer(kind=int32), | intent(inout), | optional | :: | csizes(:) |
Multiple compression sizes. This should only be used with CUDA backends |
|
| logical, | intent(in), | optional | :: | skip_compression |
Skip compression/decompression stage. Should be used when packing/unpacking from itself. |
|
| integer(kind=int32), | intent(in), | optional | :: | skip_rank |
Skip compression/decompression for specific rank when neighbor is not specified. |
|
| logical, | intent(in), | optional | :: | sync |
Sync stream after packing/compression. Should be used only for fused backends |
Sets created compressor for the kernel
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(abstract_kernel), | intent(inout) | :: | self |
Abstract kernel |
||
| class(abstract_compressor), | intent(in), | target | :: | compressor |
Compressor to set |
Destroys kernel
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(abstract_kernel), | intent(inout) | :: | self |
Abstract kernel |