Cache for compiled kernels
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
logical, | private | :: | is_created | = | .false. |
Flag indicating if cache is created |
|
type(nvrtc_cache_entry), | private, | allocatable | :: | cache(:) |
Cache entries |
||
integer(kind=int32), | private | :: | size |
Number of entries in cache |
Creates cache
Creates cache
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(nvrtc_cache), | intent(inout) | :: | self |
Cache instance |
Adds new entry to cache
Adds new entry to cache
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(nvrtc_cache), | intent(inout) | :: | self |
Cache instance |
||
type(CUmodule), | intent(in) | :: | cuda_module |
Compiled CUDA module |
||
type(CUfunction), | intent(in) | :: | cuda_kernel |
Extracted CUDA kernel |
||
type(kernel_type_t), | intent(in) | :: | kernel_type |
Kernel type |
||
type(dtfft_transpose_t), | intent(in) | :: | transpose_type |
Transpose type |
||
integer(kind=int32), | intent(in) | :: | tile_size |
Tile size |
||
integer(kind=int32), | intent(in) | :: | padding |
Padding |
||
integer(kind=int64), | intent(in) | :: | base_storage |
Base storage |
Gets entry from cache
Returns cached kernel if it exists. If not returns null pointer.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(nvrtc_cache), | intent(inout) | :: | self |
Cache instance |
||
type(dtfft_transpose_t), | intent(in) | :: | transpose_type |
Type of transposition to perform |
||
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 |
||
integer(kind=int32), | intent(in) | :: | padding |
Padding |
Cached kernel
Removes entry from cache
Takes CUDA kernel as an argument and searches for it in cache
If kernel is found than reduces ref_count
of such entry and kernel becomes a null pointer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(nvrtc_cache), | intent(inout) | :: | self |
Cache instance |
||
type(CUfunction), | intent(inout) | :: | kernel |
CUDA kernel to search for |
Cleans up cache
Removes unused modules from cuda context
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(nvrtc_cache), | intent(inout) | :: | self |
Cache instance |