Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #6500 cmake bug to build using NVCC #6590

Closed
wants to merge 1 commit into from

Conversation

guysoft
Copy link
Contributor

@guysoft guysoft commented May 26, 2016

Resolves #6500
Similar to what was done at BVLC/caffe#4046

What does this PR change?

Single line that adds -D_FORCE_INLINES to the cuda detection line.

Thanks @chapaev28 for finding out where it actually goes.

@@ -128,7 +128,7 @@ if(CUDA_FOUND)
foreach(ARCH IN LISTS ARCH_LIST)
if(ARCH MATCHES "([0-9]+)\\(([0-9]+)\\)")
# User explicitly specified PTX for the concrete BIN
set(NVCC_FLAGS_EXTRA ${NVCC_FLAGS_EXTRA} -gencode arch=compute_${CMAKE_MATCH_2},code=sm_${CMAKE_MATCH_1})
set(NVCC_FLAGS_EXTRA ${NVCC_FLAGS_EXTRA} -D_FORCE_INLINES -gencode arch=compute_${CMAKE_MATCH_2},code=sm_${CMAKE_MATCH_1})
Copy link
Contributor

Choose a reason for hiding this comment

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

In this case the -D_FORCE_INLINES will be added multiple times, since we are inside foreach loop.

I think it will be better to add this flag after the loop:

set(NVCC_FLAGS_EXTRA ${NVCC_FLAGS_EXTRA} -D_FORCE_INLINES)

@guysoft
Copy link
Contributor Author

guysoft commented May 26, 2016

Thanks @Jet47
Tested, works too, now opened with that fix #6592

@guysoft guysoft closed this May 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants