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
dbff16eb
Commit
dbff16eb
authored
Jan 25, 2011
by
Alexey Spizhevoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated cmake file to allow specifying GPU archs in BIN(PTX) format
parent
397a6353
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
CMakeLists.txt
CMakeLists.txt
+9
-5
No files found.
CMakeLists.txt
View file @
dbff16eb
...
...
@@ -708,15 +708,15 @@ if(WITH_CUDA)
set
(
HAVE_CUDA 1
)
message
(
STATUS
"CUDA detected: "
${
CUDA_VERSION
}
)
set
(
CUDA_ARCH_
GPU
"1.3 2.0"
CACHE STRING
"Specify 'real' GPU architectures to build binaries for
"
)
set
(
CUDA_ARCH_
BIN
"1.3 2.0"
CACHE STRING
"Specify 'real' GPU architectures to build binaries for, BIN(PTX) format is supported
"
)
set
(
CUDA_ARCH_PTX
"1.1 1.3"
CACHE STRING
"Specify 'virtual' PTX architectures to build PTX intermediate code for"
)
# These variables are used in config templates
string
(
REGEX REPLACE
"
\\
."
""
ARCH_GPU_NO_POINTS
"
${
CUDA_ARCH_
GPU
}
"
)
string
(
REGEX REPLACE
"
\\
."
""
ARCH_GPU_NO_POINTS
"
${
CUDA_ARCH_
BIN
}
"
)
string
(
REGEX REPLACE
"
\\
."
""
ARCH_PTX_NO_POINTS
"
${
CUDA_ARCH_PTX
}
"
)
# Ckeck if user specified 1.0 compute capability
string
(
REGEX MATCH
"1.0"
HAS_ARCH_10
"
${
CUDA_ARCH_
GPU
}
${
CUDA_ARCH_PTX
}
"
)
string
(
REGEX MATCH
"1.0"
HAS_ARCH_10
"
${
CUDA_ARCH_
BIN
}
${
CUDA_ARCH_PTX
}
"
)
if
(
NOT
${
HAS_ARCH_10
}
STREQUAL
""
)
set
(
OPENCV_ARCH_GPU_OR_PTX_10 1
)
endif
()
...
...
@@ -724,9 +724,13 @@ if(WITH_CUDA)
set
(
NVCC_FLAGS_EXTRA
""
)
# Tell nvcc to add binaries for the specified GPUs
string
(
REGEX MATCHALL
"[0-9]+"
ARCH_LIST
"
${
ARCH_GPU_NO_POINTS
}
"
)
string
(
REGEX MATCHALL
"[0-9
()
]+"
ARCH_LIST
"
${
ARCH_GPU_NO_POINTS
}
"
)
foreach
(
ARCH IN LISTS ARCH_LIST
)
set
(
NVCC_FLAGS_EXTRA
${
NVCC_FLAGS_EXTRA
}
-gencode arch=compute_
${
ARCH
}
,code=sm_
${
ARCH
}
)
if
(
ARCH MATCHES
"([0-9]+)
\\
(([0-9]+)
\\
)"
)
set
(
NVCC_FLAGS_EXTRA
${
NVCC_FLAGS_EXTRA
}
-gencode arch=compute_
${
CMAKE_MATCH_2
}
,code=sm_
${
CMAKE_MATCH_1
}
)
else
()
set
(
NVCC_FLAGS_EXTRA
${
NVCC_FLAGS_EXTRA
}
-gencode arch=compute_
${
ARCH
}
,code=sm_
${
ARCH
}
)
endif
()
endforeach
()
# Tell nvcc to add PTX intermediate code for the specified architectures
...
...
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