View Source Evision.CUDA (Evision v0.1.21)

Link to this section Summary

Types

t()

Type that represents an Evision.CUDA struct.

Functions

Creates a continuous matrix.

Creates a continuous matrix.

Ensures that the size of a matrix is big enough and the matrix has a proper type.

Ensures that the size of a matrix is big enough and the matrix has a proper type.

Returns the number of installed CUDA-enabled devices.

Returns the current device index set by cuda::setDevice or initialized by default.

printCudaDeviceInfo

printShortCudaDeviceInfo

Page-locks the memory of matrix and maps it for the device(s).

Explicitly destroys and cleans up all resources associated with the current device in the current process.

setBufferPoolUsage

Sets a device and initializes it for the current thread.

Unmaps the memory of matrix and makes it pageable again.

Link to this section Types

@type t() :: %Evision.CUDA{ref: reference()}

Type that represents an Evision.CUDA struct.

  • ref. reference()

    The underlying erlang resource variable.

Link to this section Functions

Link to this function

createContinuous(rows, cols, type)

View Source
@spec createContinuous(integer(), integer(), integer()) ::
  Evision.Mat.t() | {:error, String.t()}

Creates a continuous matrix.

Positional Arguments
  • rows: int.

    Row count.

  • cols: int.

    Column count.

  • type: int.

    Type of the matrix.

Return
  • arr: Evision.Mat.

    Destination matrix. This parameter changes only if it has a proper type and area ( \f$\texttt{rows} \times \texttt{cols}\f$ ).

Matrix is called continuous if its elements are stored continuously, that is, without gaps at the end of each row.

Python prototype (for reference only):

createContinuous(rows, cols, type[, arr]) -> arr
Link to this function

createContinuous(rows, cols, type, opts)

View Source
@spec createContinuous(integer(), integer(), integer(), [{atom(), term()}, ...] | nil) ::
  Evision.Mat.t() | {:error, String.t()}

Creates a continuous matrix.

Positional Arguments
  • rows: int.

    Row count.

  • cols: int.

    Column count.

  • type: int.

    Type of the matrix.

Return
  • arr: Evision.Mat.

    Destination matrix. This parameter changes only if it has a proper type and area ( \f$\texttt{rows} \times \texttt{cols}\f$ ).

Matrix is called continuous if its elements are stored continuously, that is, without gaps at the end of each row.

Python prototype (for reference only):

createContinuous(rows, cols, type[, arr]) -> arr
Link to this function

ensureSizeIsEnough(rows, cols, type)

View Source
@spec ensureSizeIsEnough(integer(), integer(), integer()) ::
  Evision.Mat.t() | {:error, String.t()}

Ensures that the size of a matrix is big enough and the matrix has a proper type.

Positional Arguments
  • rows: int.

    Minimum desired number of rows.

  • cols: int.

    Minimum desired number of columns.

  • type: int.

    Desired matrix type.

Return

The function does not reallocate memory if the matrix has proper attributes already.

Python prototype (for reference only):

ensureSizeIsEnough(rows, cols, type[, arr]) -> arr
Link to this function

ensureSizeIsEnough(rows, cols, type, opts)

View Source
@spec ensureSizeIsEnough(
  integer(),
  integer(),
  integer(),
  [{atom(), term()}, ...] | nil
) ::
  Evision.Mat.t() | {:error, String.t()}

Ensures that the size of a matrix is big enough and the matrix has a proper type.

Positional Arguments
  • rows: int.

    Minimum desired number of rows.

  • cols: int.

    Minimum desired number of columns.

  • type: int.

    Desired matrix type.

Return

The function does not reallocate memory if the matrix has proper attributes already.

Python prototype (for reference only):

ensureSizeIsEnough(rows, cols, type[, arr]) -> arr
Link to this function

getCudaEnabledDeviceCount()

View Source
@spec getCudaEnabledDeviceCount() :: integer() | {:error, String.t()}

Returns the number of installed CUDA-enabled devices.

Return
  • retval: int

Use this function before any other CUDA functions calls. If OpenCV is compiled without CUDA support, this function returns 0. If the CUDA driver is not installed, or is incompatible, this function returns -1.

Python prototype (for reference only):

getCudaEnabledDeviceCount() -> retval
@spec getDevice() :: integer() | {:error, String.t()}

Returns the current device index set by cuda::setDevice or initialized by default.

Return
  • retval: int

Python prototype (for reference only):

getDevice() -> retval
Link to this function

printCudaDeviceInfo(device)

View Source
@spec printCudaDeviceInfo(integer()) :: :ok | {:error, String.t()}

printCudaDeviceInfo

Positional Arguments
  • device: int

Python prototype (for reference only):

printCudaDeviceInfo(device) -> None
Link to this function

printShortCudaDeviceInfo(device)

View Source
@spec printShortCudaDeviceInfo(integer()) :: :ok | {:error, String.t()}

printShortCudaDeviceInfo

Positional Arguments
  • device: int

Python prototype (for reference only):

printShortCudaDeviceInfo(device) -> None
@spec registerPageLocked(Evision.Mat.maybe_mat_in()) :: :ok | {:error, String.t()}

Page-locks the memory of matrix and maps it for the device(s).

Positional Arguments

Python prototype (for reference only):

registerPageLocked(m) -> None
@spec resetDevice() :: :ok | {:error, String.t()}

Explicitly destroys and cleans up all resources associated with the current device in the current process.

Any subsequent API call to this device will reinitialize the device.

Python prototype (for reference only):

resetDevice() -> None
Link to this function

setBufferPoolConfig(deviceId, stackSize, stackCount)

View Source
@spec setBufferPoolConfig(integer(), integer(), integer()) ::
  :ok | {:error, String.t()}

setBufferPoolConfig

Positional Arguments
  • deviceId: int
  • stackSize: size_t
  • stackCount: int

Python prototype (for reference only):

setBufferPoolConfig(deviceId, stackSize, stackCount) -> None
@spec setBufferPoolUsage(boolean()) :: :ok | {:error, String.t()}

setBufferPoolUsage

Positional Arguments
  • on: bool

Python prototype (for reference only):

setBufferPoolUsage(on) -> None
@spec setDevice(integer()) :: :ok | {:error, String.t()}

Sets a device and initializes it for the current thread.

Positional Arguments
  • device: int.

    System index of a CUDA device starting with 0.

If the call of this function is omitted, a default device is initialized at the fist CUDA usage.

Python prototype (for reference only):

setDevice(device) -> None
@spec unregisterPageLocked(Evision.Mat.maybe_mat_in()) :: :ok | {:error, String.t()}

Unmaps the memory of matrix and makes it pageable again.

Positional Arguments

Python prototype (for reference only):

unregisterPageLocked(m) -> None