Skip to content

199 create a set of cvgswarp versions that do not get an input gpumat - #200

Merged
morousg merged 3 commits into
mainfrom
199-create-a-set-of-cvgswarp-versions-that-do-not-get-an-input-gpumat
Aug 26, 2026
Merged

199 create a set of cvgswarp versions that do not get an input gpumat#200
morousg merged 3 commits into
mainfrom
199-create-a-set-of-cvgswarp-versions-that-do-not-get-an-input-gpumat

Conversation

@morousg

@morousg morousg commented Aug 26, 2026

Copy link
Copy Markdown
Member

No description provided.

@morousg
morousg requested a balanced review from Copilot August 26, 2026 20:34
@morousg morousg self-assigned this Aug 26, 2026
@morousg morousg linked an issue Aug 26, 2026 that may be closed by this pull request

Copilot AI 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.

Pull request overview

Adds input-independent warp operation descriptors for flexible pipeline composition.

Changes:

  • Adds standalone and batch no-input warp overloads.
  • Extracts reusable GpuMat reader construction.
  • Adds tests for no-input affine and perspective warping.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
include/cvGPUSpeedup.cuh Adds no-input warp overloads.
include/cvGPUSpeedupHelpers.cuh Adds the reusable reader helper.
tests/warping/test_warping_opencv.cu Exercises the new operation composition paths.
Suppressed comments (2)

tests/warping/test_warping_opencv.cu:421

  • Every per-image comparison is discarded and the test returns success unconditionally. Aggregate the comparison results and return them (using either the existing cvGS overload as the oracle or an explicit tolerance), otherwise batch-output regressions in the new overload remain undetected.
    return true;

tests/warping/test_warping_opencv.cu:492

  • This test also returns success regardless of every comparison. After switching it to the no-input overload, aggregate checks for the active planes and verify inactive planes against defaultValue; do not compare inactive OpenCV buffers, because indices usedPlanes..NUM_IMGS2 were never initialized by warpPerspective.
    return true;

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread include/cvGPUSpeedup.cuh

std::cout << "Perspective transformation: " << (correct ? "PASS" : "EXPECTED_FAIL") << std::endl;

return true;
Comment thread tests/warping/test_warping_opencv.cu Outdated
@morousg
morousg requested a balanced review from Copilot August 26, 2026 20:53
@morousg
morousg merged commit 9564128 into main Aug 26, 2026
8 checks passed
@morousg
morousg deleted the 199-create-a-set-of-cvgswarp-versions-that-do-not-get-an-input-gpumat branch August 26, 2026 20:59

Copilot AI 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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Suppressed comments (4)

include/cvGPUSpeedup.cuh:484

  • usedPlanes is caller-controlled but is used as an array bound before any validation. Values greater than BATCH index past transform_matrices/dstSize, while negative values are forwarded to FKL. Reject values outside [0, BATCH] before entering the loop.
                           const int& usedPlanes, const cv::Scalar& defaultValue) {
    for (int i = 0; i < usedPlanes; ++i) {

tests/warping/test_warping_opencv.cu:306

  • This test always returns success even when the new no-input perspective pipeline produces an incorrect result; correct only affects the log. Since exact border equality is known not to hold, use a border-aware/tolerant assertion and return that predicate so this overload has effective regression coverage.
    return true;

tests/warping/test_warping_opencv.cu:421

  • Every per-plane comparison is discarded and the full-batch no-input test returns true unconditionally. Aggregate the comparison results (with the intended perspective-border tolerance) and return the aggregate so regressions in this new overload fail CTest.
    return true;

tests/warping/test_warping_opencv.cu:491

  • Only the first usedPlanes OpenCV outputs are written, but this loop compares all ten planes, including uninitialized reference buffers, and then the function returns success regardless. Check active planes against OpenCV, explicitly validate the expected default for inactive planes, and return the aggregate result so the partial-batch overload is actually tested.
    for (int i = 0; i < NUM_IMGS2; ++i) {
        cv::Mat resultcv(d_resultscv[i]);
        cv::Mat resultcvGS(d_resultscvGS[i]);
        const bool correct = compareAndCheck<CV_8UC3>(resultcv, resultcvGS);
        std::cout << "Perspective transformation batch " << i << ": " << (correct ? "PASS" : "EXPECTED_FAIL") << std::endl;

namespace cvGS {

template <int InputType>
inline constexpr auto getReader(const cv::cuda::GpuMat& input) {
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.

Create a set of cvGS::warp versions that do not get an input GpuMat

3 participants