Module that implements a cache for nvrtc modules Cache is used to avoid recompilation of kernels with the same parameters
| 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 |
Cache for nvrtc modules
| 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 |
| procedure, private, pass(self) :: create | ../../ Creates cache |
| procedure, private, pass(self) :: add | ../../ Adds new entry to cache |
Retrieves a kernel instance from the cache If the instance is not found, an error is raised
| Type | Intent | Optional | 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 |
Retrieved kernel instance
Creates and adds a new nvrtc module to the cache if it does not already exist
| Type | Intent | Optional | 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 |
Creates cache
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(nvrtc_module_cache), | intent(inout) | :: | self |
Cache instance |
Adds new entry to cache
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(nvrtc_module_cache), | intent(inout) | :: | self |
Cache instance |
||
| type(nvrtc_module), | intent(in) | :: | m |
Module to add |