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
Conversation
Alloc for CUDA to be used at the same time as datapar
c1372c5
to
3f87b2d
Compare
@@ -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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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:
hpx/cmake/HPX_AddCompileFlag.cmake
Line 33 in 3f87b2d
if(HPX_WITH_CUDA AND (NOT MSVC)) |
There was a problem hiding this comment.
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:
hpx/cmake/HPX_AddCompileFlag.cmake
Line 33 in 3f87b2d
if(HPX_WITH_CUDA AND (NOT MSVC)) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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/cmake/HPX_AddCompileFlag.cmake
Line 34 in 3f87b2d
hpx_add_compile_flag(${FLAG}) |
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, thanks.
We should have really reverted the nvcc flags and look for a proper fix.
Not everyone wants to keep the intermediates and have verbose output.
|
I will remove |
This also fixes some possible problems with base_lco_with_value