dtfft_interface_nvrtc Module

nvRTC Interfaces.

nvRTC is loaded at runtime via dynamic loading due to explicit cuda_driver linking by cmake.


Uses

  • module~~dtfft_interface_nvrtc~~UsesGraph module~dtfft_interface_nvrtc dtfft_interface_nvrtc iso_c_binding iso_c_binding module~dtfft_interface_nvrtc->iso_c_binding iso_fortran_env iso_fortran_env module~dtfft_interface_nvrtc->iso_fortran_env module~dtfft_interface_cuda_runtime dtfft_interface_cuda_runtime module~dtfft_interface_nvrtc->module~dtfft_interface_cuda_runtime module~dtfft_parameters dtfft_parameters module~dtfft_interface_nvrtc->module~dtfft_parameters module~dtfft_utils dtfft_utils module~dtfft_interface_nvrtc->module~dtfft_utils module~dtfft_interface_cuda_runtime->iso_c_binding module~dtfft_interface_cuda_runtime->module~dtfft_parameters module~dtfft_interface_cuda_runtime->module~dtfft_utils module~dtfft_parameters->iso_c_binding module~dtfft_parameters->iso_fortran_env mpi_f08 mpi_f08 module~dtfft_parameters->mpi_f08 module~dtfft_utils->iso_c_binding module~dtfft_utils->iso_fortran_env module~dtfft_utils->module~dtfft_parameters module~dtfft_utils->mpi_f08

Used by

  • module~~dtfft_interface_nvrtc~~UsedByGraph module~dtfft_interface_nvrtc dtfft_interface_nvrtc module~dtfft_nvrtc_kernel dtfft_nvrtc_kernel module~dtfft_nvrtc_kernel->module~dtfft_interface_nvrtc module~dtfft_transpose_plan_cuda dtfft_transpose_plan_cuda module~dtfft_transpose_plan_cuda->module~dtfft_interface_nvrtc module~dtfft_transpose_plan_cuda->module~dtfft_nvrtc_kernel module~dtfft_abstract_backend dtfft_abstract_backend module~dtfft_transpose_plan_cuda->module~dtfft_abstract_backend module~dtfft_abstract_transpose_plan dtfft_abstract_transpose_plan module~dtfft_transpose_plan_cuda->module~dtfft_abstract_transpose_plan module~dtfft_transpose_handle_cuda dtfft_transpose_handle_cuda module~dtfft_transpose_plan_cuda->module~dtfft_transpose_handle_cuda module~dtfft_abstract_backend->module~dtfft_nvrtc_kernel module~dtfft_abstract_transpose_plan->module~dtfft_nvrtc_kernel module~dtfft_abstract_transpose_plan->module~dtfft_abstract_backend module~dtfft_plan dtfft_plan module~dtfft_plan->module~dtfft_nvrtc_kernel module~dtfft_plan->module~dtfft_transpose_plan_cuda module~dtfft_plan->module~dtfft_abstract_transpose_plan module~dtfft_transpose_plan_host dtfft_transpose_plan_host module~dtfft_plan->module~dtfft_transpose_plan_host module~dtfft_transpose_handle_cuda->module~dtfft_nvrtc_kernel module~dtfft_transpose_handle_cuda->module~dtfft_abstract_backend module~dtfft_backend_cufftmp_m dtfft_backend_cufftmp_m module~dtfft_transpose_handle_cuda->module~dtfft_backend_cufftmp_m module~dtfft_backend_mpi dtfft_backend_mpi module~dtfft_transpose_handle_cuda->module~dtfft_backend_mpi module~dtfft_backend_nccl_m dtfft_backend_nccl_m module~dtfft_transpose_handle_cuda->module~dtfft_backend_nccl_m module~dtfft dtfft module~dtfft->module~dtfft_plan module~dtfft_api dtfft_api module~dtfft_api->module~dtfft_plan module~dtfft_backend_cufftmp_m->module~dtfft_abstract_backend module~dtfft_backend_mpi->module~dtfft_abstract_backend module~dtfft_backend_nccl_m->module~dtfft_abstract_backend module~dtfft_transpose_plan_host->module~dtfft_abstract_transpose_plan

Variables

Type Visibility Attributes Name Initial
procedure(nvrtcGetErrorString_interface), public, pointer :: nvrtcGetErrorString_c

Fortran pointer to the nvrtcGetErrorString function

procedure(nvrtcCreateProgram_interface), public, pointer :: nvrtcCreateProgram

Fortran pointer to the nvrtcCreateProgram function

procedure(nvrtcDestroyProgram_interface), public, pointer :: nvrtcDestroyProgram

Fortran pointer to the nvrtcDestroyProgram function

procedure(nvrtcCompileProgram_interface), public, pointer :: nvrtcCompileProgram

Fortran pointer to the nvrtcCompileProgram function

procedure(nvrtcGetProgramLog_interface), public, pointer :: nvrtcGetProgramLog

Fortran pointer to the nvrtcGetProgramLog function

procedure(nvrtcGetCUBINSize_interface), public, pointer :: nvrtcGetCUBINSize

Fortran pointer to the nvrtcGetCUBINSize function

procedure(nvrtcGetCUBIN_interface), public, pointer :: nvrtcGetCUBIN

Fortran pointer to the nvrtcGetCUBIN function

logical, private, save :: is_loaded = .false.

Flag indicating whether the library is loaded

type(c_ptr), private, save :: libnvrtc

Handle to the loaded library

type(c_funptr), private, save :: nvrtcFunctions(7)

Array of pointers to the nvRTC functions


Abstract Interfaces

abstract interface

  • private function nvrtcGetErrorString_interface(error_code) result(string)

    Helper function that returns a string describing the given nvrtcResult code For unrecognized enumeration values, it returns “NVRTC_ERROR unknown”

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=c_int), value :: error_code

    CUDA Runtime Compilation API result code.

    Return Value type(c_ptr)

    Pointer to C string

abstract interface

  • private function nvrtcCreateProgram_interface(prog, src, name, numHeaders, headers, includeNames) result(nvrtcResult)

    Creates an instance of nvrtcProgram with the given input parameters, and sets the output parameter prog with it.

    Arguments

    Type IntentOptional Attributes Name
    type(nvrtcProgram) :: prog

    CUDA Runtime Compilation program.

    character(len=c_char) :: src(*)

    CUDA program source.

    character(len=c_char) :: name(*)

    CUDA program name.

    integer(kind=c_int), value :: numHeaders

    Number of headers used. Must be greater than or equal to 0.

    type(c_ptr), value :: headers

    Sources of the headers

    type(c_ptr), value :: includeNames

    Name of each header by which they can be included in the CUDA program source

    Return Value integer(kind=c_int)

    The enumerated type nvrtcResult defines API call result codes.

abstract interface

  • private function nvrtcDestroyProgram_interface(prog) result(nvrtcResult)

    Destroys the given program.

    Arguments

    Type IntentOptional Attributes Name
    type(nvrtcProgram) :: prog

    CUDA Runtime Compilation program.

    Return Value integer(kind=c_int)

    The enumerated type nvrtcResult defines API call result codes.

abstract interface

  • private function nvrtcCompileProgram_interface(prog, numOptions, options) result(nvrtcResult)

    Compiles the given program.

    Arguments

    Type IntentOptional Attributes Name
    type(nvrtcProgram), value :: prog

    CUDA Runtime Compilation program.

    integer(kind=c_int), value :: numOptions

    Number of compiler options passed.

    type(c_ptr) :: options(*)

    Compiler options in the form of C string array

    Return Value integer(kind=c_int)

    The enumerated type nvrtcResult defines API call result codes.

abstract interface

  • private function nvrtcGetProgramLog_interface(prog, log) result(nvrtcResult)

    Stores the log generated by the previous compilation of prog in the memory pointed by log

    Arguments

    Type IntentOptional Attributes Name
    type(nvrtcProgram), value :: prog

    CUDA Runtime Compilation program.

    type(c_ptr), value :: log

    Compilation log.

    Return Value integer(kind=c_int)

    The enumerated type nvrtcResult defines API call result codes.

abstract interface

  • private function nvrtcGetCUBINSize_interface(prog, cubinSizeRet) result(nvrtcResult)

    Sets the value of cubinSizeRet with the size of the cubin generated by the previous compilation of prog.

    Arguments

    Type IntentOptional Attributes Name
    type(nvrtcProgram), value :: prog

    CUDA Runtime Compilation program.

    integer(kind=c_size_t) :: cubinSizeRet

    Size of the generated cubin.

    Return Value integer(kind=c_int)

    The enumerated type nvrtcResult defines API call result codes.

abstract interface

  • private function nvrtcGetCUBIN_interface(prog, cubin) result(nvrtcResult)

    Stores the cubin generated by the previous compilation of prog in the memory pointed by cubin.

    Arguments

    Type IntentOptional Attributes Name
    type(nvrtcProgram), value :: prog

    CUDA Runtime Compilation program.

    character(len=c_char) :: cubin(*)

    Compiled and assembled result.

    Return Value integer(kind=c_int)

    The enumerated type nvrtcResult defines API call result codes.


Derived Types

type, public, bind(C) ::  nvrtcProgram

nvrtcProgram is the unit of compilation, and an opaque handle for a program.

Components

Type Visibility Attributes Name Initial
type(c_ptr), public :: cptr

Actual pointer


Functions

public function nvrtcGetErrorString(error_code) result(string)

Helper function that returns a string describing the given nvrtcResult code For unrecognized enumeration values, it returns “NVRTC_ERROR unknown”

Arguments

Type IntentOptional Attributes Name
integer(kind=c_int), intent(in) :: error_code

CUDA Runtime Compilation API result code.

Return Value character(len=:), allocatable

Result string

public function load_nvrtc() result(error_code)

Dynamically loads nvRTC library and its functions

Arguments

None

Return Value integer(kind=int32)

Error code