pub unsafe extern "C" fn cudaGetDriverEntryPoint(
symbol: *const c_char,
funcPtr: *mut *mut c_void,
flags: c_ulonglong,
driverStatus: *mut cudaDriverEntryPointQueryResult,
) -> cudaError_tExpand description
Returns the requested driver API function pointer.
Returns in **funcPtr the address of the CUDA driver function for the requested flags.
For a requested driver symbol, if the CUDA version in which the driver symbol was introduced is less than or equal to the CUDA runtime version, the API will return the function pointer to the corresponding versioned driver function.
The pointer returned by the API should be cast to a function pointer matching the requested driver function’s definition in the API header file. The function pointer typedef can be picked up from the corresponding typedefs header file. For example, cudaTypedefs.h consists of function pointer typedefs for driver APIs defined in cuda.h.
The API will return cudaError_t::CUDA_SUCCESS and set the returned funcPtr if the requested driver function is valid and supported on the platform.
The API will return cudaError_t::CUDA_SUCCESS and set the returned funcPtr to NULL if the requested driver function is not supported on the platform, no ABI compatible driver function exists for the CUDA runtime version or if the driver symbol is invalid.
It will also set the optional driverStatus to one of the values in cudaDriverEntryPointQueryResult with the following meanings:
cudaDriverEntryPointQueryResult::CU_GET_PROC_ADDRESS_SUCCESS- The requested symbol was succesfully found based on input arguments andpfnis validcudaDriverEntryPointQueryResult::CU_GET_PROC_ADDRESS_SYMBOL_NOT_FOUND- The requested symbol was not foundcudaDriverEntryPointQueryResult::CU_GET_PROC_ADDRESS_VERSION_NOT_SUFFICIENT- The requested symbol was found but is not supported by the current runtime version (CUDART_VERSION)
The requested flags can be:
- cudaEnableDefault: This is the default mode. This is equivalent to cudaEnablePerThreadDefaultStream if the code is compiled with —default-stream per-thread compilation flag or the macro CUDA_API_PER_THREAD_DEFAULT_STREAM is defined; cudaEnableLegacyStream otherwise.
- cudaEnableLegacyStream: This will enable the search for all driver symbols that match the requested driver symbol name except the corresponding per-thread versions.
- cudaEnablePerThreadDefaultStream: This will enable the search for all driver symbols that match the requested driver symbol name including the per-thread versions. If a per-thread version is not found, the API will return the legacy version of the driver function.
Deprecated: This function is deprecated as of CUDA 13.0.
Note: This API is deprecated and cudaGetDriverEntryPointByVersion (with a hardcoded cudaVersion) should be used instead.
Note: Version mixing among CUDA-defined types and driver API versions is strongly discouraged and doing so can result in an undefined behavior. See Rules for version mixing.
Note that this function may also return cudaError_t::CUDA_ERROR_NOT_INITIALIZED, cudaErrorInsufficientDriver or cudaError_t::CUDA_ERROR_NO_DEVICE if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback. cudaError_t::CUDA_ERROR_NOT_PERMITTED may, but is not guaranteed to, be returned as a diagnostic in such case.
§Parameters
symbol: The base name of the driver API function to look for. As an example, for the driver APIcuMemAlloc_v2,symbolwould be cuMemAlloc. Note that the API will use the CUDA runtime version to return the address to the most recent ABI compatible driver symbol,cuMemAllocorcuMemAlloc_v2.funcPtr: Location to return the function pointer to the requested driver function.flags: Flags to specify search options.driverStatus: Optional location to store the status of finding the symbol from the driver. SeecudaDriverEntryPointQueryResultfor possible values.
§Return value
cudaError_t::CUDA_SUCCESScudaError_t::CUDA_ERROR_INVALID_VALUEcudaError_t::CUDA_ERROR_NOT_SUPPORTED
See also: cuGetProcAddress.