Add support for std::array<T, N>#8535
Merged
alalek merged 3 commits intoopencv:masterfrom Apr 19, 2017
arnaudbrejeon:std_array
Merged
Add support for std::array<T, N>#8535alalek merged 3 commits intoopencv:masterfrom arnaudbrejeon:std_array
alalek merged 3 commits intoopencv:masterfrom
arnaudbrejeon:std_array
Conversation
alalek
reviewed
Apr 11, 2017
modules/core/src/copy.cpp
Outdated
| // For some cases (with vector) dst.size != src.size, so force to column-based form | ||
| // It prevents memory corruption in case of column-based src | ||
| if (_dst.isVector()) | ||
| if (_dst.isVector() || _dst.isArray()) |
Member
There was a problem hiding this comment.
Probably we should avoid introduction of new "isArray()" method and merge it with isVector().
Contributor
Author
There was a problem hiding this comment.
Good idea. I will update the commits to take this into account
Contributor
Author
|
I've removed isArray and added support for |
alalek
reviewed
Apr 18, 2017
| #ifdef CV_CXX_STD_ARRAY | ||
| //! builds matrix from std::array with or without copying the data | ||
| template<typename _Tp, std::size_t _N> explicit UMat(const std::array<_Tp, _N>& vec, bool copyData=false); | ||
| #endif |
Member
There was a problem hiding this comment.
Please remove this overload.
UMat usage is highly integrated with OpenCL, which usually requires large enough amount of data (there is significant overhead for small arrays). In general, we should not allow users/developers to write a slow code.
Member
|
Well done! 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
resolves #5086
Partially adds support for std::array from request "Add InputArray and OutputArray overloads for std::array #5086"
CV_CXX_STD_ARRAYis defined to know ifstd::arrayis supported by the compilerInputArray,OutputArray,InputOutputArray, andMatthat takestd::arrayandstd::array<Mat>as input.std::vectortests)