Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

yeatse
Copy link
Contributor

@yeatse yeatse commented Jan 8, 2023

Fixes #23085.

After #22271 was merged, OpenCV can no longer initialize on M1 macs due to missing the required NEON_DOTPROD feature. This patch simply checks if __ARM_FEATURE_DOTPROD is enabled (which should be true when compiling for M1 macs), and turns on CV_CPU_NEON_DOTPROD if this feature is supported in runtime.

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • 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
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

@alalek
Copy link
Member

alalek commented Jan 9, 2023

This patch should go into 3.4 branch first.
We will merge changes from 3.4 into 4.x regularly (weekly/bi-weekly).

Please:

  • change "base" branch of this PR: 4.x => 3.4 (use "Edit" button near PR title)
  • rebase your commits from 4.x onto 3.4 branch. For example:
    git rebase -i --onto upstream/3.4 upstream/4.x
    (check list of your commits, save and quit (Esc + "wq" + Enter)
    where upstream is configured by following this GitHub guide and fetched (git fetch upstream).
  • push rebased commits into source branch of your fork (with --force option)

Note: no needs to re-open PR, apply changes "inplace".

@yeatse yeatse changed the base branch from 4.x to 3.4 January 9, 2023 11:27
@yeatse
Copy link
Contributor Author

yeatse commented Jan 9, 2023

This patch should go into 3.4 branch first. We will merge changes from 3.4 into 4.x regularly (weekly/bi-weekly).

Please:

  • change "base" branch of this PR: 4.x => 3.4 (use "Edit" button near PR title)
  • rebase your commits from 4.x onto 3.4 branch. For example:
    git rebase -i --onto upstream/3.4 upstream/4.x
    (check list of your commits, save and quit (Esc + "wq" + Enter)
    where upstream is configured by following this GitHub guide and fetched (git fetch upstream).
  • push rebased commits into source branch of your fork (with --force option)

Note: no needs to re-open PR, apply changes "inplace".

Rebased. Please take another look 😃

Copy link
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you for contribution 👍

@opencv-pushbot opencv-pushbot merged commit cbc9745 into opencv:3.4 Jan 9, 2023
@yeatse yeatse deleted the fix-apple-silicon-build branch January 9, 2023 23:48
This was referenced Jan 21, 2023
foundry added a commit to foundry/opencv_fork that referenced this pull request May 1, 2023
@asmorkalov asmorkalov mentioned this pull request May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NEON_DOTPROD missing feature on Apple M1 cpu

4 participants