cuda.pathfinder.optional_cuda_import#
- cuda.pathfinder.optional_cuda_import(
- fully_qualified_modname: str,
- *,
- probe_function: Callable[[ModuleType], object] | None = None,
Import an optional CUDA module without masking unrelated import bugs.
- Returns:
The imported module if available and the optional probe succeeds, otherwise
Nonewhen the requested module is unavailable.- Raises:
ModuleNotFoundError – If the import fails because a dependency of the target module is missing (instead of the target module itself).
Exception – Any exception raised by
probe_functionexceptDynamicLibNotFoundError, which is treated as “unavailable”.