Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Opencv
提交
24be7b26
O
Opencv
项目概览
Greenplum
/
Opencv
11 个月 前同步成功
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Opencv
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
24be7b26
编写于
12月 26, 2013
作者:
R
Roman Donchenko
提交者:
OpenCV Buildbot
12月 26, 2013
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2049 from asmorkalov:android_cuda_warning_fix
上级
1acc1085
1e038e28
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
49 addition
and
27 deletion
+49
-27
modules/core/src/gpumat.cpp
modules/core/src/gpumat.cpp
+38
-16
modules/dynamicuda/CMakeLists.txt
modules/dynamicuda/CMakeLists.txt
+1
-1
modules/dynamicuda/src/main.cpp
modules/dynamicuda/src/main.cpp
+10
-10
未找到文件。
modules/core/src/gpumat.cpp
浏览文件 @
24be7b26
...
...
@@ -45,29 +45,42 @@
#include <iostream>
#if defined(HAVE_CUDA)
#
include <cuda_runtime.h>
#
include <npp.h>
#
include <cuda_runtime.h>
#
include <npp.h>
#
define CUDART_MINIMUM_REQUIRED_VERSION 4020
#
define NPP_MINIMUM_REQUIRED_VERSION 4200
#
define CUDART_MINIMUM_REQUIRED_VERSION 4020
#
define NPP_MINIMUM_REQUIRED_VERSION 4200
#
if (CUDART_VERSION < CUDART_MINIMUM_REQUIRED_VERSION)
#
error "Insufficient Cuda Runtime library version, please update it."
#
endif
#
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
#
if (NPP_VERSION_MAJOR * 1000 + NPP_VERSION_MINOR * 100 + NPP_VERSION_BUILD < NPP_MINIMUM_REQUIRED_VERSION)
#
error "Insufficient NPP version, please update it."
#
endif
#endif
#ifdef DYNAMIC_CUDA_SUPPORT
#include <dlfcn.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#
include <dlfcn.h>
#
include <sys/types.h>
#
include <sys/stat.h>
#
include <dirent.h>
#endif
#ifdef ANDROID
# ifdef LOG_TAG
# undef LOG_TAG
# endif
# ifdef LOGE
# undef LOGE
# endif
# ifdef LOGD
# undef LOGD
# endif
# ifdef LOGI
# undef LOGI
# endif
# include <android/log.h>
# define LOG_TAG "OpenCV::CUDA"
...
...
@@ -93,6 +106,9 @@ static GpuFactoryType gpuFactory = NULL;
static
DeviceInfoFactoryType
deviceInfoFactory
=
NULL
;
# if defined(__linux__) || defined(__APPLE__) || defined (ANDROID)
const
std
::
string
DYNAMIC_CUDA_LIB_NAME
=
"libopencv_dynamicuda.so"
;
# ifdef ANDROID
static
const
std
::
string
getCudaSupportLibName
()
{
...
...
@@ -144,7 +160,7 @@ static const std::string getCudaSupportLibName()
LOGD
(
"Libraries folder found: %s"
,
pathBegin
);
fclose
(
file
);
return
std
::
string
(
pathBegin
)
+
"/libopencv_core_cuda.so"
;
return
std
::
string
(
pathBegin
)
+
DYNAMIC_CUDA_LIB_NAME
;
}
fclose
(
file
);
LOGE
(
"Could not find library path"
);
...
...
@@ -165,7 +181,7 @@ static const std::string getCudaSupportLibName()
# else
static
const
std
::
string
getCudaSupportLibName
()
{
return
"libopencv_core_cuda.so"
;
return
DYNAMIC_CUDA_LIB_NAME
;
}
# endif
...
...
@@ -173,13 +189,18 @@ static bool loadCudaSupportLib()
{
void
*
handle
;
const
std
::
string
name
=
getCudaSupportLibName
();
dlerror
();
handle
=
dlopen
(
name
.
c_str
(),
RTLD_LAZY
);
if
(
!
handle
)
{
LOGE
(
"Cannot dlopen %s: %s"
,
name
.
c_str
(),
dlerror
());
return
false
;
}
deviceInfoFactory
=
(
DeviceInfoFactoryType
)
dlsym
(
handle
,
"deviceInfoFactory"
);
if
(
!
deviceInfoFactory
)
{
LOGE
(
"Cannot dlsym deviceInfoFactory: %s"
,
dlerror
());
dlclose
(
handle
);
return
false
;
}
...
...
@@ -187,6 +208,7 @@ static bool loadCudaSupportLib()
gpuFactory
=
(
GpuFactoryType
)
dlsym
(
handle
,
"gpuFactory"
);
if
(
!
gpuFactory
)
{
LOGE
(
"Cannot dlsym gpuFactory: %s"
,
dlerror
());
dlclose
(
handle
);
return
false
;
}
...
...
modules/dynamicuda/CMakeLists.txt
浏览文件 @
24be7b26
...
...
@@ -5,7 +5,7 @@ endif()
set
(
the_description
"Dynamic CUDA linkage"
)
add_definitions
(
-DUSE_CUDA
)
ocv_warnings_disable
(
CMAKE_CXX_FLAGS -Wundef
)
ocv_warnings_disable
(
CMAKE_CXX_FLAGS -Wundef
-Wshadow
)
ocv_module_include_directories
(
"
${
OpenCV_SOURCE_DIR
}
/modules/gpu/include"
)
set
(
OPENCV_MODULE_TYPE SHARED
)
if
(
BUILD_FAT_JAVA_LIB
)
...
...
modules/dynamicuda/src/main.cpp
浏览文件 @
24be7b26
...
...
@@ -6,19 +6,19 @@
#include <iostream>
#ifdef HAVE_CUDA
#include <cuda_runtime.h>
#include <npp.h>
#
include <cuda_runtime.h>
#
include <npp.h>
#define CUDART_MINIMUM_REQUIRED_VERSION 4020
#define NPP_MINIMUM_REQUIRED_VERSION 4200
#
define CUDART_MINIMUM_REQUIRED_VERSION 4020
#
define NPP_MINIMUM_REQUIRED_VERSION 4200
#if (CUDART_VERSION < CUDART_MINIMUM_REQUIRED_VERSION)
#error "Insufficient Cuda Runtime library version, please update it."
#endif
#
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
#
if (NPP_VERSION_MAJOR * 1000 + NPP_VERSION_MINOR * 100 + NPP_VERSION_BUILD < NPP_MINIMUM_REQUIRED_VERSION)
#
error "Insufficient NPP version, please update it."
#
endif
#endif
using
namespace
std
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录