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

Adding fixes and workarounds to allow compilation with nvcc/msvc (VS2015up3) #2416

Merged
merged 3 commits into from Dec 7, 2016

Conversation

hkaiser
Copy link
Member

@hkaiser hkaiser commented Nov 30, 2016

This also fixes some possible problems with base_lco_with_value

Alloc for CUDA to be used at the same time as datapar
@hkaiser hkaiser force-pushed the fixing_nvcc_msvc branch 2 times, most recently from c1372c5 to 3f87b2d Compare December 4, 2016 19:47
@@ -1088,15 +1088,15 @@ if(HPX_WITH_CUDA AND NOT HPX_WITH_CUDA_CLANG)
hpx_library_dir(${CUDA_TOOLKIT_ROOT_DIR}/lib/x64)
link_directories(${CUDA_TOOLKIT_ROOT_DIR}/lib/x64)
set(CUDA_NVCC_FLAGS_DEBUG ${CUDA_NVCC_FLAGS_DEBUG};-D_DEBUG;-O0;-g;-G;-Xcompiler=-MDd;-Xcompiler=-Od;-Xcompiler=-Zi;-Xcompiler=-bigobj)
set(CUDA_NVCC_FLAGS_RELWITHDEBINFO ${CUDA_NVCC_FLAGS_RELWITHDEBINFO};-DNDEBUG;-O2;-g;-Xcompiler=-MD,-O2,-Zi;-Xcompiler=-bigobj)
set(CUDA_NVCC_FLAGS_RELWITHDEBINFO ${CUDA_NVCC_FLAGS_RELWITHDEBINFO};-DNDEBUG;-O2;-g;--verbose;-Xcompiler=-MD,-O2,-Zi;-Xcompiler=-bigobj;--keep)
Copy link
Member

Choose a reason for hiding this comment

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

should we keep the verbose and keep flag here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't see any other way as nvcc is not picking up the flags set through cmake generator settings. I had to comment out this for instance:

if(HPX_WITH_CUDA AND (NOT MSVC))
.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't see any other way as nvcc is not picking up the flags set through cmake generator settings. I had to comment out this for instance:

if(HPX_WITH_CUDA AND (NOT MSVC))
.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm, I don't like having that as a default. Sounds like there's a bigger underlying issue here. Could we open a ticket and fix it properly instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure. You have 'solved' the very same issue by unconditionally setting the compilation flags for all build configurations (here:

hpx_add_compile_flag(${FLAG})
). This however does not work for multi-target build systems like VS. So while I would like to solve it, I have no idea how to approach this issue as it seems to be a problem in FindCUDA.cmake not picking up settings from cmake generator constructs.

set(CUDA_NVCC_FLAGS_MINSIZEREL ${CUDA_NVCC_FLAGS_MINSIZEREL};-DNDEBUG;-O1;-Xcompiler=-MD,-O1;-Xcompiler=-bigobj)
set(CUDA_NVCC_FLAGS_RELEASE ${CUDA_NVCC_FLAGS_RELEASE};-DNDEBUG;-O2;-Xcompiler=-MD,-Ox;-Xcompiler=-bigobj)
endif()
set(CUDA_SEPARABLE_COMPILATION ON)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode=arch=compute_30,code=sm_30)
set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode=arch=compute_35,code=sm_35)
# set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode=arch=compute_35,code=sm_35)
Copy link
Member

Choose a reason for hiding this comment

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

why was this commented out?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, that's a left-over from experimentation

{
return channel_.get(launch::sync);
}
result_type get_value(error_code& ec)
{
return channel_.get(launch::sync);
Copy link
Member

Choose a reason for hiding this comment

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

Did you miss to pass the error code here?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, thanks.

@hkaiser hkaiser merged commit 6f16707 into master Dec 7, 2016
@hkaiser hkaiser deleted the fixing_nvcc_msvc branch December 7, 2016 22:17
@sithhell
Copy link
Member

sithhell commented Dec 8, 2016 via email

@hkaiser
Copy link
Member Author

hkaiser commented Dec 8, 2016

I will remove --verbose and --keep

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.

None yet

2 participants