python_vali.PySurfaceUD

class python_vali.PySurfaceUD

CUDA-accelerated Surface Upsampler-Downscaler

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: python_vali._python_vali.PySurfaceUD, gpu_id: int) -> None

    Constructor for PySurfaceUD with GPU ID.

    Creates a new instance of PySurfaceUD that will run on the specified GPU. The CUDA stream will be automatically created and managed.

    param gpu_id:

    The ID of the GPU to use for processing

    type gpu_id:

    int

    raises RuntimeError:

    If the specified GPU is not available

  2. __init__(self: python_vali._python_vali.PySurfaceUD, gpu_id: int, stream: int) -> None

    Constructor for PySurfaceUD with GPU ID and CUDA stream.

    Creates a new instance of PySurfaceUD that will run on the specified GPU using the provided CUDA stream.

    param gpu_id:

    The ID of the GPU to use for processing

    type gpu_id:

    int

    param stream:

    The CUDA stream to use for processing

    type stream:

    int

    raises RuntimeError:

    If the specified GPU is not available

Methods

Run(self, src, dst)

Convert input Surface synchronously.

RunAsync(self, src, dst)

Convert input Surface asynchronously.

SupportedFormats()

Get list of supported pixel format conversions.

__init__(*args, **kwargs)

Overloaded function.

Attributes

Stream

Get the CUDA stream associated with this instance.

Run(self: python_vali._python_vali.PySurfaceUD, src: python_vali._python_vali.Surface, dst: python_vali._python_vali.Surface) tuple[bool, python_vali._python_vali.TaskExecInfo]

Convert input Surface synchronously.

Processes the input surface and stores the result in the output surface. This method blocks until the conversion is complete.

Parameters:
  • src (Surface) – Input surface to be processed

  • dst (Surface) – Output surface to store the result

Returns:

Tuple containing: - success (bool): True if conversion was successful, False otherwise - info (TaskExecInfo): Detailed execution information

Return type:

tuple[bool, TaskExecInfo]

Raises:

RuntimeError – If the conversion fails

RunAsync(self: python_vali._python_vali.PySurfaceUD, src: python_vali._python_vali.Surface, dst: python_vali._python_vali.Surface) tuple[bool, python_vali._python_vali.TaskExecInfo]

Convert input Surface asynchronously.

Processes the input surface and stores the result in the output surface. This method returns immediately without waiting for the conversion to complete.

Parameters:
  • src (Surface) – Input surface to be processed

  • dst (Surface) – Output surface to store the result

Returns:

Tuple containing: - success (bool): True if conversion was successful, False otherwise - info (TaskExecInfo): Detailed execution information

Return type:

tuple[bool, TaskExecInfo]

Raises:

RuntimeError – If the conversion fails

property Stream

Get the CUDA stream associated with this instance.

Returns the handle to the CUDA stream used for processing.

Returns:

CUDA stream handle

Return type:

int

static SupportedFormats() list[tuple[python_vali._python_vali.PixelFormat, python_vali._python_vali.PixelFormat]]

Get list of supported pixel format conversions.

Returns a list of tuples containing supported input and output pixel format pairs that can be processed by the upsampler-downscaler.

Returns:

List of tuples containing supported (input_format, output_format) pairs

Return type:

list[tuple[Pixel_Format, Pixel_Format]]