-
Notifications
You must be signed in to change notification settings - Fork 555
Fix errors and warnings with CUDA 9.0 builds #2923
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
Changes from all commits
cc87488
b23adf6
4466bec
d2b3273
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,7 +7,7 @@ | |
|
|
||
| dependency_check(CUDA_FOUND "CUDA not found.") | ||
| if(AF_WITH_CUDNN) | ||
| dependency_check(cuDNN_FOUND "CUDA not found.") | ||
| dependency_check(cuDNN_FOUND "CUDNN not found.") | ||
| endif() | ||
|
|
||
| include(AFcuda_helpers) | ||
|
|
@@ -34,7 +34,7 @@ endif() | |
|
|
||
| # Find if CUDA Toolkit is at least 10.0 to use static | ||
| # lapack library. Otherwise, we have to use regular shared library | ||
| if(UNIX AND CUDA_VERSION_MAJOR VERSION_GREATER 10 OR CUDA_VERSION_MAJOR VERSION_EQUAL 10) | ||
| if(UNIX AND (CUDA_VERSION_MAJOR VERSION_GREATER 10 OR CUDA_VERSION_MAJOR VERSION_EQUAL 10)) | ||
| set(use_static_cuda_lapack ON) | ||
| else() | ||
| set(use_static_cuda_lapack OFF) | ||
|
|
@@ -52,7 +52,6 @@ if(UNIX) | |
| # FIXME When NVCC resolves this particular issue. | ||
| # NVCC doesn't like -l<full_path_static_lib>, hence we cannot | ||
| # use ${CMAKE_*_LIBRARY} variables in the following flags. | ||
| set(af_cuda_static_flags "-rdc=true;-dlink") | ||
| set(af_cuda_static_flags "${af_cuda_static_flags};-lculibos") | ||
| set(af_cuda_static_flags "${af_cuda_static_flags};-lcublas_static") | ||
| set(af_cuda_static_flags "${af_cuda_static_flags};-lcublasLt_static") | ||
|
|
@@ -71,7 +70,7 @@ if(UNIX) | |
|
|
||
| set(af_cuda_static_flags "${af_cuda_static_flags};-lcusolver_static") | ||
| else() | ||
| set(cusolver_lib "${CUDA_cusolver_LIBRARY}") | ||
| set(cusolver_lib "${CUDA_cusolver_LIBRARY}" OpenMP::OpenMP_CXX) | ||
| endif() | ||
| endif() | ||
|
|
||
|
|
@@ -89,12 +88,6 @@ message(STATUS "CUDA_architecture_build_targets: ${CUDA_architecture_build_targe | |
|
|
||
| set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};${cuda_architecture_flags}) | ||
|
|
||
| if(${CUDA_SEPARABLE_COMPILATION}) | ||
| # Enable relocatable device code generation for separable | ||
| # compilation which is in turn required for any device linking done. | ||
| set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-rdc=true) | ||
| endif() | ||
|
|
||
| mark_as_advanced( | ||
| CUDA_LIBRARIES_PATH | ||
| CUDA_architecture_build_targets) | ||
|
|
@@ -301,13 +294,19 @@ if(UNIX) | |
| -Wl,--start-group | ||
| ${CUDA_culibos_LIBRARY} #also a static libary | ||
| ${CUDA_cublas_static_LIBRARY} | ||
| ${CUDA_cublasLt_static_LIBRARY} | ||
| ${CUDA_cufft_static_LIBRARY} | ||
| ${CUDA_lapack_static_LIBRARY} | ||
| ${CUDA_cusparse_static_LIBRARY} | ||
| ${cusolver_static_lib} | ||
| -Wl,--end-group | ||
| ) | ||
|
|
||
| if(CUDA_VERSION VERSION_GREATER 9.5) | ||
| target_link_libraries(af_cuda_static_cuda_library | ||
| PRIVATE | ||
| ${CUDA_cublasLt_static_LIBRARY} | ||
| ${CUDA_lapack_static_LIBRARY}) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense, these are not there prior to toolkit 10 - I should have thought about this |
||
| endif() | ||
|
|
||
| set(CUDA_SEPARABLE_COMPILATION ${pior_val_CUDA_SEPARABLE_COMPILATION}) | ||
| else() | ||
| target_link_libraries(af_cuda_static_cuda_library | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -71,8 +71,9 @@ void generateBufferRead(std::stringstream& kerStream, int id, | |
| << "];\n"; | ||
| } | ||
|
|
||
| void generateShiftNodeOffsets(std::stringstream& kerStream, int id, | ||
| bool is_linear, const std::string& type_str) { | ||
| inline void generateShiftNodeOffsets(std::stringstream& kerStream, int id, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: looks like this is just to make the compiler silent even though this won't be actually inlined. |
||
| bool is_linear, | ||
| const std::string& type_str) { | ||
| UNUSED(is_linear); | ||
| std::string idx_str = std::string("idx") + std::to_string(id); | ||
| std::string info_str = std::string("in") + std::to_string(id); | ||
|
|
@@ -99,8 +100,8 @@ void generateShiftNodeOffsets(std::stringstream& kerStream, int id, | |
| kerStream << type_str << " *in" << id << "_ptr = in" << id << ".ptr;\n"; | ||
| } | ||
|
|
||
| void generateShiftNodeRead(std::stringstream& kerStream, int id, | ||
| const std::string& type_str) { | ||
| inline void generateShiftNodeRead(std::stringstream& kerStream, int id, | ||
| const std::string& type_str) { | ||
| kerStream << type_str << " val" << id << " = in" << id << "_ptr[idx" << id | ||
| << "];\n"; | ||
| } | ||
|
|
||
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.
nit: I think a better check to avoid any unexpected issues (with decimals and all against different cmake versions) with cmake is to do
On another note, I will take care of this with some other change.