Skip to content

Improve UMatUsageFlags documentation #20765

@JoeHowse

Description

@JoeHowse

The documentation of UMatUsageFlags does not shed much light on what each flag really does. I suggest that the documentation should be revised to clarify at least the following points:

  • USAGE_DEFAULT is equivalent to USAGE_ALLOCATE_DEVICE_MEMORY.
  • USAGE_ALLOCATE_SHARED_MEMORY depends on Shared Virtual Memory (SVM). For it to work as intended, it needs OpenCV to be built using the WITH_OPENCL_SVM CMake option (which is off by default), it needs to be running on a compatible OpenCL 2 device, and it needs SVM to be enabled via cv::ocl::Context::setUseSVM(true). If these conditions are not met, it falls back to an equivalent of USAGE_ALLOCATE_DEVICE_MEMORY (or possibly just fails with an exception in the case of an incompatible OpenCL device).

(The above is my understanding from reading the ocl.cpp source code, but if any of this is wrong, please correct me.)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions