mirror of
https://github.com/opencv/opencv.git
synced 2026-11-24 18:27:56 -06:00
core: explicit UMat transfers for non OpenCL builds - #30259 ## Summary Core groundwork for moving the DNN CUDA backend from mapped `getMat()` to explicit host/device copies (related: #29807): -`fitSameSize` keeps tensor layout, the missing `_OutputArray::fit*` overloads are defined, `UMat::create` reports a failing bound allocator, and cross-allocator `copyTo` no longer maps a device destination. - OpenCL paths (`Kernel::set`, `isCLBuffer`, clFFT, `arithm_op`) now decline CUDA UMats instead of passing a CUDA pointer as `cl_mem`, which segfaulted with NVIDIA OpenCL. - Adds a private `HostDeviceBuffer` (CUDA → OpenCL → CPU fallback) for the follow-up DNN PR, with tests for all of the above. ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [ ] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake