Class to build CUDA kernel code
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=:), | public, | allocatable | :: | raw |
String that holds CUDA code |
procedure, public, pass(self) :: to_cstr | ../../ Converts Fortran CUDA code to C pointer |
procedure, public, pass(self) :: add_line | ../../ Adds new line to CUDA code |
procedure, public, pass(self) :: destroy => destroy_code | ../../ Frees all memory |
Generates code that will be used to locally tranpose data and prepares to send it to other processes ndims == 2
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | kernel_name |
Name of CUDA kernel |
||
integer(kind=int8), | intent(in) | :: | ndims |
Number of dimensions |
||
integer(kind=int64), | intent(in) | :: | base_storage |
Number of bytes needed to store single element |
||
type(dtfft_transpose_t), | intent(in) | :: | transpose_type |
Transpose id |
||
logical, | intent(in) | :: | enable_packing |
If data should be manually packed or not |
||
integer(kind=int32), | intent(in) | :: | padding |
Resulting code
Generates code that will be used to unpack data when it is recieved
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | kernel_name |
Name of CUDA kernel |
||
integer(kind=int64), | intent(in) | :: | base_storage |
Number of bytes needed to store single element |
||
logical, | intent(in) | :: | is_partial |
Resulting code
Generates code that will be used to partially unpack data when it is recieved from other process
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | kernel_name |
Name of CUDA kernel |
||
integer(kind=int64), | intent(in) | :: | base_storage |
Number of bytes needed to store single element |
Resulting code
Converts Fortran CUDA code to C pointer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(kernel_codegen), | intent(in) | :: | self |
Kernel code |
||
character(len=c_char), | intent(out), | allocatable | :: | c_code(:) |
C pointer to code |
Adds new line to CUDA code
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(kernel_codegen), | intent(inout) | :: | self |
Kernel code |
||
character(len=*), | intent(in) | :: | line |
Line to add |
Frees all memory
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(kernel_codegen), | intent(inout) | :: | self |
Kernel code |
Generated device function that is used to determite id of process that to which data is being sent or from which data has been recieved based on local element coordinate
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(kernel_codegen), | intent(inout) | :: | code |
Resulting code |
Generates basic code that is used in all other kernels
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | kernel_name |
Name of CUDA kernel |
||
integer(kind=int64), | intent(in) | :: | base_storage |
Number of bytes needed to store single element |
||
type(kernel_codegen), | intent(inout) | :: | code |
Resulting code |
||
character(len=:), | intent(out), | optional, | allocatable | :: | buffer_type |
Type of buffer that should be used |