opencv_contrib
opencv_contrib copied to clipboard
Get CUDA code to compile with clang CUDA and without CUDA
Changelist:
- there are some syntactic changes:
<< <-><<<. For some reason, I do not need to change all those in the code. ::min->std::minin__host__codemodules/cudaimgproc/src/moments.cppneeds to have the CUDA code in the#ifdef- The signature of
cv::cuda::swapChannelsis not exactly the same as the C++ one inmodules/cudaimgproc/src/color.cpp cv::cuda::FarnebackOpticalFlow::createneeds to be explicit about which FarnebackOpticalFlow it returns
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 are some syntactic changes:
<< <-><<<. For some reason, I do not need to change all those in the code.
On Windows this is an annoying default in Visual Studio, what errors does clang give from this? I'm concerned that if any new kernel's are added by users of VS then it will brake the clang build.
Strangely it build fine for me on Ubuntu 20:04 - clang version 10.0.0-4ubuntu1.
Thx @cudawarped . I am ok fixing the << < as it goes with whatever new code comes in. This is the kind of error I get:
polar_cart.cu.cc:195:43: error:
expected expression
195 | polarToCartImpl_<T, false> << <grid, block, 0, stream >> >(shrinkPtr(magc), shrinkPtr(anglec), shrinkP
tr(xc), shrinkPtr(yc), scale, anglec.rows, anglec.cols);
| ^
@vrabaud Could you add some notes how you build OpenCV + CUDA + Clang. Just to be sure that we are talking about the same thing.
@asmorkalov , for my purpose, I do not use nvcc but clang cuda instead. This is all internal to Google so I actually have no idea of the command lines unfortunately.
I am done adding missing implementations, PTAL