Skip to content

Fix Flann compilation under nvcc + NEON - #13865

Merged
opencv-pushbot merged 1 commit into
opencv:3.4from
lsr0:flann_cudacc
Feb 19, 2019
Merged

opencv-pushbot merged 1 commit into
opencv:3.4from
lsr0:flann_cudacc

Conversation

@lsr0

@lsr0 lsr0 commented Feb 19, 2019 •

Copy link
Copy Markdown
Contributor

All <arm_neon.h> includes in core/cv_cpu_dispatch.h are protected by an
ifndef __CUDACC__ to prevent attempting to use neon intrinsics when
compiling cuda kernels (.cu) -- this prevents hard errors such as
error: identifier "__builtin_neon_qi" is undefined

Add this same protection to flann/dist.h to fix compilation involving
flann.hpp.

This pullrequest changes

Only protection around the inline neon code in flann/dist.h's Hamming distance function.

force_builders=Custom
buildworker:Custom=linux-1,linux-2,linux-4
docker_image:Custom=ubuntu-cuda:16.04

@alalek

alalek commented Feb 19, 2019

Copy link
Copy Markdown
Member

As a bugfix this patch should go into 3.4 branch first. We will merge changes from 3.4 into master regularly (weekly/bi-weekly).

So, please:

  • change "base" branch of this PR: master => 3.4 (use "Edit" button near PR title)
  • rebase your commits from master onto 3.4 branch. For example:
    git rebase -i --onto upstream/3.4 upstream/master
    (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".

@lsr0
lsr0 changed the base branch from master to 3.4 February 19, 2019 13:10
All <arm_neon.h> includes in core/cv_cpu_dispatch.h are protected by an
ifndef __CUDACC__ to prevent attempting to use neon intrinsics when
compiling cuda kernels (.cu) -- this prevents hard errors such as
  error: identifier "__builtin_neon_qi" is undefined

Add this same protection to flann/dist.h to fix compilation involving
flann.hpp.

@alalek alalek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me! Thank you 👍

@opencv-pushbot
opencv-pushbot merged commit 7c72e09 into opencv:3.4 Feb 19, 2019
@alalek alalek mentioned this pull request Feb 19, 2019
SavyaSanchi-Sharma pushed a commit to SavyaSanchi-Sharma/opencv that referenced this pull request Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug category: build/install category: flann category: gpu/cuda (contrib) OpenCV 4.0+: moved to opencv_contrib platform: arm ARM boards related issues: RPi, NVIDIA TK/TX, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants