CUDA Driver Interfaces
CUDA Driver is loaded at runtime via dynamic loading.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
procedure(cuModuleLoadDataEx_interface), | public, | pointer | :: | cuModuleLoadDataEx |
Fortran pointer to the cuModuleLoadDataEx function |
||
procedure(cuModuleUnload_interface), | public, | pointer | :: | cuModuleUnload |
Fortran pointer to the cuModuleUnload function |
||
procedure(cuModuleGetFunction_interface), | public, | pointer | :: | cuModuleGetFunction |
Fortran pointer to the cuModuleGetFunction function |
||
logical, | private, | save | :: | is_loaded | = | .false. |
Flag indicating whether the library is loaded |
type(c_ptr), | private, | save | :: | libcuda |
Handle to the loaded library |
||
type(c_funptr), | private, | save | :: | cuFunctions(4) |
Array of pointers to the CUDA functions |
Launches a CUDA function CUfunction or a CUDA kernel CUkernel.
Wrapper around cuLaunchKernel
, since I have to idea how to pass array of pointers to cuLaunchKernel
.
Launches a CUDA function CUfunction or a CUDA kernel CUkernel.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(CUfunction), | value | :: | func |
Function CUfunction or Kernel CUkernel to launch |
||
type(c_ptr), | value | :: | in |
Input pointer |
||
type(c_ptr), | value | :: | out |
Output pointer |
||
type(dim3) | :: | blocks |
Grid in blocks |
|||
type(dim3) | :: | threads |
Thread block |
|||
type(dtfft_stream_t), | value | :: | stream |
Stream identifier |
||
type(kernelArgs) | :: | args |
Kernel parameters |
|||
type(c_funptr), | value | :: | funptr |
Pointer to |
Driver result code
Load a module’s data with options.
Takes a pointer image and loads the corresponding module module into the current context. The image may be a cubin or fatbin as output by nvcc, or a NULL-terminated PTX, either as output by nvcc or hand-written.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(CUmodule) | :: | mod |
Returned module |
|||
character(len=c_char) | :: | image(*) |
Module data to load |
|||
integer(kind=c_int), | value | :: | numOptions |
Number of options |
||
type(c_ptr), | value | :: | options |
Options for JIT |
||
type(c_ptr) | :: | optionValues |
Option values for JIT |
Driver result code
Unloads a module.
Unloads a module hmod
from the current context.
Attempting to unload a module which was obtained from the Library Management API
such as cuLibraryGetModule
will return CUDA_ERROR_NOT_PERMITTED
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(CUmodule), | value | :: | hmod |
Module to unload |
Driver result code
Returns a function handle.
Returns in hfunc
the handle of the function of name name located in module hmod.
If no function of that name exists, cuModuleGetFunction
returns CUDA_ERROR_NOT_FOUND
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(CUfunction) | :: | hfunc |
Returns a function handle. |
|||
type(CUmodule), | value | :: | hmod |
Module to retrieve function from |
||
character(len=c_char) | :: | name(*) |
Name of function to retrieve |
Driver result code
Arguments passed to nvrtc-compiled kernels
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=c_int), | public | :: | n_ints | = | 0 |
Number of integers provided |
|
integer(kind=c_int), | public | :: | ints(5) |
Integer array |
|||
integer(kind=c_int), | public | :: | n_ptrs | = | 0 |
Number of pointers provided |
|
type(c_ptr), | public | :: | ptrs(3) |
Pointer array |
CUDA module
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(c_ptr), | public | :: | ptr |
Actual pointer |
CUDA function
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(c_ptr), | public | :: | ptr |
Actual pointer |
Loads the CUDA Driver library and needed symbols
Error code
Launches a CUDA function CUfunction or a CUDA kernel CUkernel.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(CUfunction) | :: | func |
Function CUfunction or Kernel CUkernel to launch |
|||
type(c_ptr) | :: | in |
Input pointer |
|||
type(c_ptr) | :: | out |
Output pointer |
|||
type(dim3) | :: | blocks |
Grid in blocks |
|||
type(dim3) | :: | threads |
Thread block |
|||
type(dtfft_stream_t) | :: | stream |
Stream identifier |
|||
type(kernelArgs) | :: | args |
Kernel parameters |
Driver result code