Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(nvrtc_cache), | public, | save | :: | cache |
Cache of compiled kernels |
||
integer(kind=int32), | private, | parameter | :: | CACHE_PREALLOC_SIZE | = | 10 |
Number of preallocated cache entries |
Cache entry for a compiled kernel
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=int32), | private | :: | ref_count | = | 0 |
Number of references to this kernel |
|
type(CUmodule), | private | :: | cuda_module | = | CUmodule(c_null_ptr) |
Pointer to CUDA Module. |
|
type(CUfunction), | private | :: | cuda_kernel | = | CUfunction(c_null_ptr) |
Pointer to CUDA kernel. |
|
type(kernel_type_t), | private | :: | kernel_type |
Type of kernel to execute. |
|||
type(dtfft_transpose_t), | private | :: | transpose_type |
Type of transpose |
|||
integer(kind=int32), | private | :: | tile_size |
Tile size of transpose kernel |
|||
integer(kind=int32), | private | :: | padding |
Padding size of transpose kernel |
|||
integer(kind=int64), | private | :: | base_storage |
Number of bytes needed to store single element |
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 |
procedure, public, pass(self) :: create | ../../ Creates cache |
procedure, public, pass(self) :: add | ../../ Adds new entry to cache |
procedure, public, pass(self) :: get | ../../ Gets entry from cache |
procedure, public, pass(self) :: remove | ../../ Removes entry from cache |
procedure, public, pass(self) :: cleanup | ../../ Cleans up 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
Returns generic transpose id. Since X-Y and Y-Z transpositions are symmectric, it returns only one of them. X-Z and Z-X are not symmetric
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dtfft_transpose_t), | intent(in) | :: | transpose_type |
Type of transposition to perform |
Fixed id of transposition
Creates cache
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(nvrtc_cache), | intent(inout) | :: | self |
Cache instance |
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 |
Removes unused modules from cuda context
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(nvrtc_cache), | intent(inout) | :: | self |
Cache instance |
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 |