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
36ebf4ef
Commit
36ebf4ef
authored
Nov 25, 2010
by
Anatoly Baksheev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cuda+npp version check at configure time.
parent
03aa0c9f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
16 deletions
+26
-16
CMakeLists.txt
CMakeLists.txt
+4
-4
CMakeLists.txt
modules/gpu/CMakeLists.txt
+2
-1
FindNPP.cmake
modules/gpu/FindNPP.cmake
+14
-11
precomp.hpp
modules/gpu/src/precomp.hpp
+6
-0
No files found.
CMakeLists.txt
View file @
36ebf4ef
...
...
@@ -647,11 +647,11 @@ endif()
############################### CUDA ################################
if
(
WITH_CUDA
)
find_package
(
CUDA
)
if
(
CUDA_FOUND
)
message
(
STATUS
"CUDA detected."
)
find_package
(
CUDA 3.2
)
if
(
CUDA_FOUND
)
set
(
HAVE_CUDA 1
)
message
(
STATUS
"CUDA detected: "
${
CUDA_VERSION
}
)
set
(
CUDA_COMPUTE_CAPABILITIES
" 1.0 1.1 1.2 1.3 2.0 "
CACHE STRING
"Add or remove compute capability"
)
set
(
CUDA_NVCC_FLAGS_ARCH
${
CUDA_COMPUTE_CAPABILITIES
}
)
...
...
modules/gpu/CMakeLists.txt
View file @
36ebf4ef
...
...
@@ -35,7 +35,8 @@ source_group("Include" FILES ${lib_hdrs})
if
(
HAVE_CUDA
)
get_filename_component
(
_path_to_findnpp
"
${
CMAKE_CURRENT_LIST_FILE
}
"
PATH
)
set
(
CMAKE_MODULE_PATH
${
CMAKE_MODULE_PATH
}
${
_path_to_findnpp
}
)
find_package
(
NPP REQUIRED
)
find_package
(
NPP 3.2.16 REQUIRED
)
message
(
STATUS
"NPP detected: "
${
NPP_VERSION
}
)
include_directories
(
${
CUDA_INCLUDE_DIRS
}
${
CUDA_NPP_INCLUDES
}
)
...
...
modules/gpu/FindNPP.cmake
View file @
36ebf4ef
...
...
@@ -95,26 +95,29 @@ if(EXISTS ${CUDA_NPP_INCLUDES}/nppversion.h)
string
(
REGEX MATCH
"[0-9]+"
npp_major
${
npp_major
}
)
string
(
REGEX MATCH
"[0-9]+"
npp_minor
${
npp_minor
}
)
string
(
REGEX MATCH
"[0-9]+"
npp_build
${
npp_build
}
)
set
(
NPP_VERSION
"
${
npp_major
}
.
${
npp_minor
}
.
${
npp_build
}
"
)
MESSAGE
(
STATUS
"Npp version: "
${
NPP_VERSION
}
)
set
(
NPP_VERSION
"
${
npp_major
}
.
${
npp_minor
}
.
${
npp_build
}
"
)
endif
()
if
(
NOT EXISTS
${
CUDA_NPP_LIBRARIES
}
OR NOT EXISTS
${
CUDA_NPP_INCLUDES
}
/npp.h
)
set
(
CUDA_NPP_FOUND FALSE
)
unset
(
CUDA_NPP_INCLUDES CACHE
)
unset
(
CUDA_NPP_LIBRARIES CACHE
)
set
(
CUDA_NPP_FOUND FALSE
)
message
(
FATAL_ERROR
"NPP headers/libraries are not found. Please specify CUDA_NPP_LIBRARY_ROOT_DIR in CMake or set $NPP_ROOT_DIR."
)
endif
()
include
(
FindPackageHandleStandardArgs
)
find_package_handle_standard_args
(
NPP
REQUIRED_VARS
CUDA_NPP_INCLUDES
CUDA_NPP_LIBRARIES
VERSION_VAR
NPP_VERSION
)
if
(
APPLE
)
# We need to add the path to cudart to the linker using rpath, since the
# library name for the cuda libraries is prepended with @rpath.
# We need to add the path to cudart to the linker using rpath, since the library name for the cuda libraries is prepended with @rpath.
get_filename_component
(
_cuda_path_to_npp
"
${
CUDA_NPP_LIBRARIES
}
"
PATH
)
if
(
_cuda_path_to_npp
)
list
(
APPEND CUDA_NPP_LIBRARIES -Wl,-rpath
"-Wl,
${
_cuda_path_to_npp
}
"
)
endif
()
endif
()
endif
()
set
(
CUDA_NPP_FOUND TRUE
)
set
(
CUDA_NPP_LIBRARY_ROOT_DIR_INTERNAL
"
${
CUDA_NPP_LIBRARY_ROOT_DIR
}
"
CACHE INTERNAL
"This is the value of the last time CUDA_NPP_LIBRARY_ROOT_DIR was set successfully."
FORCE
)
...
...
modules/gpu/src/precomp.hpp
View file @
36ebf4ef
...
...
@@ -67,12 +67,18 @@
#include "opencv2/gpu/stream_accessor.hpp"
#include "npp.h"
#define CUDART_MINIMUM_REQUIRED_VERSION 3020
#define NPP_MINIMUM_REQUIRED_VERSION 3216
#if (CUDART_VERSION < CUDART_MINIMUM_REQUIRED_VERSION)
#error "Insufficient Cuda Runtime library version, please update it."
#endif
#if (NPP_VERSION_MAJOR*1000+NPP_VERSION_MINOR*100+NPP_VERSION_BUILD < NPP_MINIMUM_REQUIRED_VERSION)
#error "Insufficient NPP version, please update it."
#endif
#else
/* defined(HAVE_CUDA) */
static
inline
void
throw_nogpu
()
{
CV_Error
(
CV_GpuNotSupported
,
"The library is compilled without GPU support"
);
}
...
...
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