Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
0e80f56e
Commit
0e80f56e
authored
Aug 16, 2018
by
Hamdi Sahloul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix: Detect CUDA archs for Windows
parent
4eb29665
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
OpenCVDetectCUDA.cmake
cmake/OpenCVDetectCUDA.cmake
+10
-2
No files found.
cmake/OpenCVDetectCUDA.cmake
View file @
0e80f56e
...
@@ -70,6 +70,12 @@ if(CUDA_FOUND)
...
@@ -70,6 +70,12 @@ if(CUDA_FOUND)
unset
(
CUDA_ARCH_PTX CACHE
)
unset
(
CUDA_ARCH_PTX CACHE
)
endif
()
endif
()
SET
(
DETECT_ARCHS_COMMAND
"
${
CUDA_NVCC_EXECUTABLE
}
"
${
CUDA_NVCC_FLAGS
}
"
${
OpenCV_SOURCE_DIR
}
/cmake/checks/OpenCVDetectCudaArch.cu"
"--run"
)
if
(
WIN32 AND CMAKE_LINKER
)
#Workaround for VS cl.exe not being in the env. path
get_filename_component
(
host_compiler_bindir
${
CMAKE_LINKER
}
DIRECTORY
)
SET
(
DETECT_ARCHS_COMMAND
${
DETECT_ARCHS_COMMAND
}
"-ccbin"
"
${
host_compiler_bindir
}
"
)
endif
()
set
(
__cuda_arch_ptx
""
)
set
(
__cuda_arch_ptx
""
)
if
(
CUDA_GENERATION STREQUAL
"Fermi"
)
if
(
CUDA_GENERATION STREQUAL
"Fermi"
)
set
(
__cuda_arch_bin
"2.0"
)
set
(
__cuda_arch_bin
"2.0"
)
...
@@ -82,10 +88,11 @@ if(CUDA_FOUND)
...
@@ -82,10 +88,11 @@ if(CUDA_FOUND)
elseif
(
CUDA_GENERATION STREQUAL
"Volta"
)
elseif
(
CUDA_GENERATION STREQUAL
"Volta"
)
set
(
__cuda_arch_bin
"7.0"
)
set
(
__cuda_arch_bin
"7.0"
)
elseif
(
CUDA_GENERATION STREQUAL
"Auto"
)
elseif
(
CUDA_GENERATION STREQUAL
"Auto"
)
execute_process
(
COMMAND
"
${
CUDA_NVCC_EXECUTABLE
}
"
${
CUDA_NVCC_FLAGS
}
"
${
OpenCV_SOURCE_DIR
}
/cmake/checks/OpenCVDetectCudaArch.cu"
"--run"
execute_process
(
COMMAND
${
DETECT_ARCHS_COMMAND
}
WORKING_DIRECTORY
"
${
CMAKE_BINARY_DIR
}${
CMAKE_FILES_DIRECTORY
}
/CMakeTmp/"
WORKING_DIRECTORY
"
${
CMAKE_BINARY_DIR
}${
CMAKE_FILES_DIRECTORY
}
/CMakeTmp/"
RESULT_VARIABLE _nvcc_res OUTPUT_VARIABLE _nvcc_out
RESULT_VARIABLE _nvcc_res OUTPUT_VARIABLE _nvcc_out
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
)
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
)
string
(
REGEX REPLACE
".*
\n
"
""
_nvcc_out
"
${
_nvcc_out
}
"
)
#Strip leading warning messages, if any
if
(
NOT _nvcc_res EQUAL 0
)
if
(
NOT _nvcc_res EQUAL 0
)
message
(
STATUS
"Automatic detection of CUDA generation failed. Going to build for all known architectures."
)
message
(
STATUS
"Automatic detection of CUDA generation failed. Going to build for all known architectures."
)
else
()
else
()
...
@@ -99,10 +106,11 @@ if(CUDA_FOUND)
...
@@ -99,10 +106,11 @@ if(CUDA_FOUND)
set
(
__cuda_arch_bin
"3.2"
)
set
(
__cuda_arch_bin
"3.2"
)
set
(
__cuda_arch_ptx
""
)
set
(
__cuda_arch_ptx
""
)
elseif
(
AARCH64
)
elseif
(
AARCH64
)
execute_process
(
COMMAND
"
${
CUDA_NVCC_EXECUTABLE
}
"
${
CUDA_NVCC_FLAGS
}
"
${
OpenCV_SOURCE_DIR
}
/cmake/checks/OpenCVDetectCudaArch.cu"
"--run"
execute_process
(
COMMAND
${
DETECT_ARCHS_COMMAND
}
WORKING_DIRECTORY
"
${
CMAKE_BINARY_DIR
}${
CMAKE_FILES_DIRECTORY
}
/CMakeTmp/"
WORKING_DIRECTORY
"
${
CMAKE_BINARY_DIR
}${
CMAKE_FILES_DIRECTORY
}
/CMakeTmp/"
RESULT_VARIABLE _nvcc_res OUTPUT_VARIABLE _nvcc_out
RESULT_VARIABLE _nvcc_res OUTPUT_VARIABLE _nvcc_out
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
)
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
)
string
(
REGEX REPLACE
".*
\n
"
""
_nvcc_out
"
${
_nvcc_out
}
"
)
#Strip leading warning messages, if any
if
(
NOT _nvcc_res EQUAL 0
)
if
(
NOT _nvcc_res EQUAL 0
)
message
(
STATUS
"Automatic detection of CUDA generation failed. Going to build for all known architectures."
)
message
(
STATUS
"Automatic detection of CUDA generation failed. Going to build for all known architectures."
)
set
(
__cuda_arch_bin
"5.3 6.2 7.0"
)
set
(
__cuda_arch_bin
"5.3 6.2 7.0"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment