dtfft_nvrtc_module_cache Module

Module that implements a cache for nvrtc modules Cache is used to avoid recompilation of kernels with the same parameters


Uses

  • module~~dtfft_nvrtc_module_cache~~UsesGraph module~dtfft_nvrtc_module_cache dtfft_nvrtc_module_cache iso_c_binding iso_c_binding module~dtfft_nvrtc_module_cache->iso_c_binding iso_fortran_env iso_fortran_env module~dtfft_nvrtc_module_cache->iso_fortran_env module~dtfft_abstract_kernel dtfft_abstract_kernel module~dtfft_nvrtc_module_cache->module~dtfft_abstract_kernel module~dtfft_config dtfft_config module~dtfft_nvrtc_module_cache->module~dtfft_config module~dtfft_interface_cuda dtfft_interface_cuda module~dtfft_nvrtc_module_cache->module~dtfft_interface_cuda module~dtfft_interface_cuda_runtime dtfft_interface_cuda_runtime module~dtfft_nvrtc_module_cache->module~dtfft_interface_cuda_runtime module~dtfft_nvrtc_block_optimizer dtfft_nvrtc_block_optimizer module~dtfft_nvrtc_module_cache->module~dtfft_nvrtc_block_optimizer module~dtfft_nvrtc_module dtfft_nvrtc_module module~dtfft_nvrtc_module_cache->module~dtfft_nvrtc_module module~dtfft_utils dtfft_utils module~dtfft_nvrtc_module_cache->module~dtfft_utils module~dtfft_abstract_kernel->iso_fortran_env module~dtfft_abstract_kernel->module~dtfft_utils module~dtfft_interface_nvtx dtfft_interface_nvtx module~dtfft_abstract_kernel->module~dtfft_interface_nvtx module~dtfft_parameters dtfft_parameters module~dtfft_abstract_kernel->module~dtfft_parameters mpi_f08 mpi_f08 module~dtfft_abstract_kernel->mpi_f08 module~dtfft_config->iso_c_binding module~dtfft_config->iso_fortran_env module~dtfft_config->module~dtfft_interface_cuda_runtime module~dtfft_config->module~dtfft_utils module~dtfft_errors dtfft_errors module~dtfft_config->module~dtfft_errors module~dtfft_config->module~dtfft_parameters module~dtfft_config->mpi_f08 module~dtfft_interface_cuda->iso_c_binding module~dtfft_interface_cuda->iso_fortran_env module~dtfft_interface_cuda->module~dtfft_utils module~dtfft_interface_cuda->module~dtfft_errors module~dtfft_interface_cuda->module~dtfft_parameters module~dtfft_interface_cuda_runtime->iso_c_binding module~dtfft_interface_cuda_runtime->module~dtfft_utils module~dtfft_interface_cuda_runtime->module~dtfft_parameters module~dtfft_nvrtc_block_optimizer->iso_fortran_env module~dtfft_nvrtc_block_optimizer->module~dtfft_abstract_kernel module~dtfft_nvrtc_block_optimizer->module~dtfft_config module~dtfft_nvrtc_block_optimizer->module~dtfft_interface_cuda module~dtfft_nvrtc_block_optimizer->module~dtfft_interface_cuda_runtime module~dtfft_nvrtc_block_optimizer->module~dtfft_utils module~dtfft_nvrtc_block_optimizer->module~dtfft_parameters module~dtfft_nvrtc_module->iso_c_binding module~dtfft_nvrtc_module->iso_fortran_env module~dtfft_nvrtc_module->module~dtfft_abstract_kernel module~dtfft_nvrtc_module->module~dtfft_config module~dtfft_nvrtc_module->module~dtfft_interface_cuda module~dtfft_nvrtc_module->module~dtfft_interface_cuda_runtime module~dtfft_nvrtc_module->module~dtfft_nvrtc_block_optimizer module~dtfft_nvrtc_module->module~dtfft_utils module~dtfft_interface_nvrtc dtfft_interface_nvrtc module~dtfft_nvrtc_module->module~dtfft_interface_nvrtc module~dtfft_nvrtc_module->module~dtfft_interface_nvtx module~dtfft_nvrtc_module->module~dtfft_parameters module~dtfft_nvrtc_module->mpi_f08 module~dtfft_utils->iso_c_binding module~dtfft_utils->iso_fortran_env module~dtfft_utils->module~dtfft_errors module~dtfft_utils->module~dtfft_parameters module~dtfft_utils->mpi_f08 module~dtfft_errors->iso_fortran_env module~dtfft_interface_nvrtc->iso_c_binding module~dtfft_interface_nvrtc->iso_fortran_env module~dtfft_interface_nvrtc->module~dtfft_utils module~dtfft_interface_nvrtc->module~dtfft_errors 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 module~dtfft_parameters->mpi_f08

Used by

  • module~~dtfft_nvrtc_module_cache~~UsedByGraph module~dtfft_nvrtc_module_cache dtfft_nvrtc_module_cache module~dtfft_kernel_device dtfft_kernel_device module~dtfft_kernel_device->module~dtfft_nvrtc_module_cache module~dtfft_transpose_handle_generic dtfft_transpose_handle_generic module~dtfft_transpose_handle_generic->module~dtfft_kernel_device module~dtfft_transpose_plan dtfft_transpose_plan module~dtfft_transpose_plan->module~dtfft_kernel_device module~dtfft_transpose_plan->module~dtfft_transpose_handle_generic module~dtfft_plan dtfft_plan module~dtfft_plan->module~dtfft_transpose_plan 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 :: CACHE_PREALLOC_SIZE = 10

Number of preallocated cache entries

type(nvrtc_module_cache), private, save :: cache

Cache instance


Derived Types

type, private ::  nvrtc_module_cache

Cache for nvrtc modules

Read more…

Components

Type Visibility Attributes Name Initial
logical, private :: is_created = .false.

Flag that indicates if cache is created

type(nvrtc_module), private, allocatable :: cache(:)

Array of cached modules

integer(kind=int32), private :: size

Number of entries in cache

Type-Bound Procedures

procedure, private, pass(self) :: create ../../

Creates cache

procedure, private, pass(self) :: add ../../

Adds new entry to cache


Functions

public function get_kernel_instance(ndims, kernel_type, base_storage, tile_size, block_rows) result(fun)

Retrieves a kernel instance from the cache If the instance is not found, an error is raised

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: ndims

Number of dimensions (2 or 3)

type(kernel_type_t), intent(in) :: kernel_type

Type of kernel to build

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

Number of bytes needed to store single element

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

Tile size (number of columns)

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

Block rows

Return Value type(CUfunction)

Retrieved kernel instance


Subroutines

public subroutine create_nvrtc_module(ndims, kernel_type, base_storage, configs, props)

Creates and adds a new nvrtc module to the cache if it does not already exist

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: ndims

Number of dimensions (2 or 3)

type(kernel_type_t), intent(in) :: kernel_type

Type of kernel to build

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

Number of bytes needed to store single element

type(kernel_config), intent(in) :: configs(:)

Array of kernel configurations to build

type(device_props), intent(in) :: props

GPU architecture properties

private subroutine create(self)

Creates cache

Arguments

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

Cache instance

private subroutine add(self, m)

Adds new entry to cache

Arguments

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

Cache instance

type(nvrtc_module), intent(in) :: m

Module to add