Skip to content

Document OpenCL acceleration with UMat - #2113

Merged
shimat merged 1 commit into
mainfrom
docs/opencl-and-umat
Aug 10, 2026
Merged

shimat merged 1 commit into
mainfrom
docs/opencl-and-umat

Conversation

@shimat

@shimat shimat commented Aug 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • add a focused guide for OpenCL acceleration through UMat
  • document runtime and device diagnostics exposed by Cv2.Ocl
  • explain transfer boundaries and synchronized benchmarking with Finish()
  • clarify the distinction between OpenCL header versions, runtime versions, and CUDA support
  • link the guide from the DocFX navigation, performance guide, and README

Validation

  • git diff --check
  • verified all newly added local documentation links
  • verified the DocFX xref targets in the generated OpenCvSharp XML documentation

DocFX is not installed locally, so the complete site build is left to the PR workflow to avoid installing another local tool and generating additional build output.

Summary by CodeRabbit

  • Documentation
    • Added a comprehensive guide for OpenCL acceleration with UMat.
    • Documented runtime availability checks, device diagnostics, fallback behavior, data-transfer costs, threading considerations, and performance benchmarking.
    • Added links to the new guide throughout the documentation navigation and essential guides.
    • Clarified requirements for OpenCV OpenCL Transparent API support.

@shimat shimat self-assigned this Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Added a comprehensive guide for OpenCL acceleration with UMat. The documentation covers runtime checks, device diagnostics, pipeline transfers, synchronization, benchmarking, fallback behavior, and navigation links.

Changes

OpenCL UMat documentation

Layer / File(s) Summary
UMat usage and diagnostics
docs/docfx/articles/guides/opencl-and-umat.md
Documents OpenCL availability, platform and device inspection, UMat pipelines, synchronization, and transfer costs.
Benchmarking and performance interpretation
docs/docfx/articles/guides/opencl-and-umat.md, docs/docfx/articles/guides/memory-copy-and-performance.md
Adds synchronized benchmarking guidance, OpenCL build information, performance diagnostics, fallback behavior, and related links.
Documentation navigation and requirements
README.md, docs/docfx/articles/guides/index.md, docs/docfx/articles/index.md, docs/docfx/articles/toc.yml, docs/docfx/index.md
Links the new guide from project requirements, indexes, and documentation navigation.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: enhancement

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: documenting OpenCL acceleration through UMat.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/opencl-and-umat

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Around line 89-90: Propagate the OpenCL/UMat guidance added to the root README
into packaging/nuget/README.managed.md and packaging/nuget/README.runtime.md, or
verify and document that those files are generated from README.md so the content
is inherited automatically.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 15020cae-cd76-4c53-985c-b586c21328b5

📥 Commits

Reviewing files that changed from the base of the PR and between a390f59 and c645944.

📒 Files selected for processing (7)
  • README.md
  • docs/docfx/articles/guides/index.md
  • docs/docfx/articles/guides/memory-copy-and-performance.md
  • docs/docfx/articles/guides/opencl-and-umat.md
  • docs/docfx/articles/index.md
  • docs/docfx/articles/toc.yml
  • docs/docfx/index.md

Comment thread README.md
Comment on lines +89 to +90
OpenCV's OpenCL Transparent API can be used through `UMat`. See [OpenCL Acceleration with UMat](docs/docfx/articles/guides/opencl-and-umat.md) for runtime diagnostics and benchmarking guidance.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Root README context:"
sed -n '70,105p' README.md | cat -n

echo
echo "Locate README.md and NuGet/readme-like files:"
git ls-files | rg '(^|/)(README\.md|.*readme.*|.*\.(nuspec|psd1|psm1))$' | sed -n '1,120p'

echo
echo "Search for OpenCL/UMat mentions:"
rg -n "OpenCL|OpenCL Acceleration|UMat|OpenCL Acceleration with UMat|NuGet|Package" . \
  --glob '!**/.git/**' --glob '!**/bin/**' --glob '!**/obj/**' \
  | sed -n '1,200p'

Repository: shimat/opencvsharp

Length of output: 29859


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Markdown readme files:"
git ls-files | rg '(^|/)(README\.md|README\.[^.]+\.md)$' | sed -n '1,120p'

echo
echo "Managed NuGet README OpenCL/UMat references:"
for f in $(git ls-files | rg '(^|/)README\.(managed|runtime)\.md$'); do
  echo "--- $f"
  rg -n "OpenCL|UMat|OpenCL Acceleration|runtime diagnostics|benchmark" "$f" || true
done

echo
echo "NuGet package README metadata:"
rg -n "PackageReadmeFile|README\.(managed|runtime)\.md|Pack=\"true\" PackPath" \
  packaging nuget src/OpenCvSharp src/OpenCvSharp.WpfExtensions src/OpenCvSharp.GdipExtensions src/OpenCvSharp.AvaloniaExtensions \
  2>/dev/null | sed -n '1,220p' || true

Repository: shimat/opencvsharp

Length of output: 4988


Update the corresponding NuGet README files.

README.md now includes OpenCL/UMat guidance, but packaging/nuget/README.managed.md and packaging/nuget/README.runtime.md do not. Add this guidance to the corresponding NuGet README files, or confirm they are generated from the root README.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 89 - 90, Propagate the OpenCL/UMat guidance added to
the root README into packaging/nuget/README.managed.md and
packaging/nuget/README.runtime.md, or verify and document that those files are
generated from README.md so the content is inherited automatically.

Source: Coding guidelines

@shimat
shimat merged commit eb41039 into main Aug 10, 2026
19 of 20 checks passed
@shimat
shimat deleted the docs/opencl-and-umat branch August 10, 2026 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant