Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
huiyeruzhou
openpose
提交
28f605c8
O
openpose
项目概览
huiyeruzhou
/
openpose
与 Fork 源项目一致
从无法访问的项目Fork
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
openpose
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
28f605c8
编写于
3月 01, 2018
作者:
G
gineshidalgo99
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Display error message if wrong GPU device id
上级
252e7f09
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
22 addition
and
10 deletion
+22
-10
CMakeLists.txt
CMakeLists.txt
+10
-6
include/openpose/wrapper/wrapper.hpp
include/openpose/wrapper/wrapper.hpp
+12
-4
未找到文件。
CMakeLists.txt
浏览文件 @
28f605c8
...
...
@@ -98,12 +98,6 @@ if (WIN32)
endif
(
${
INSTRUCTION_SET
}
MATCHES
"SSE"
)
endif
(
WIN32
)
# Look for CUDA
find_package
(
CUDA
)
# Look for OpenCL
set
(
OpenCL_FOUND FALSE
)
find_package
(
OpenCL
)
# Set the acceleration library
set
(
GPU_MODE CUDA CACHE STRING
"Select the acceleration GPU library or CPU otherwise."
)
# Display proper options to user
...
...
@@ -118,6 +112,16 @@ set(GPU_MODE CUDA CACHE STRING "Select the acceleration GPU library or CPU other
# endif ()
set_property
(
CACHE GPU_MODE PROPERTY STRINGS CUDA
)
# Look for CUDA
if
(
${
GPU_MODE
}
MATCHES
"CUDA"
)
find_package
(
CUDA
)
endif
(
${
GPU_MODE
}
MATCHES
"CUDA"
)
# Look for OpenCL
set
(
OpenCL_FOUND FALSE
)
if
(
${
GPU_MODE
}
MATCHES
"OPENCL"
)
find_package
(
OpenCL
)
endif
(
${
GPU_MODE
}
MATCHES
"OPENCL"
)
# Code to avoid crash at compiling time if OpenCL is not found
if
(
NOT OpenCL_FOUND
)
set
(
OpenCL_LIBRARIES
""
)
...
...
include/openpose/wrapper/wrapper.hpp
浏览文件 @
28f605c8
...
...
@@ -469,14 +469,14 @@ namespace op
// GPU --> user picks (<= #GPUs)
else
{
// Get total number GPUs
const
auto
totalGpuNumber
=
getGpuNumber
();
// If number GPU < 0 --> set it to all the available GPUs
if
(
numberThreads
<
0
)
{
// Get total number GPUs
const
auto
totalGpuNumber
=
getGpuNumber
();
if
(
totalGpuNumber
<=
gpuNumberStart
)
error
(
"Number of initial GPU
s (`--number_gpu_start`) must be lower than the total number of used
"
" GPUs (`--number_gpu`)"
,
__LINE__
,
__FUNCTION__
,
__FILE__
);
error
(
"Number of initial GPU
(`--number_gpu_start`) must be lower than the total number of
"
"
used
GPUs (`--number_gpu`)"
,
__LINE__
,
__FUNCTION__
,
__FILE__
);
numberThreads
=
totalGpuNumber
-
gpuNumberStart
;
// Reset initial GPU to 0 (we want them all)
// Logging message
...
...
@@ -484,6 +484,14 @@ namespace op
+
" GPU(s), using "
+
std
::
to_string
(
numberThreads
)
+
" of them starting at GPU "
+
std
::
to_string
(
gpuNumberStart
)
+
"."
,
Priority
::
High
);
}
// Security check
if
(
gpuNumberStart
+
numberThreads
>
totalGpuNumber
)
error
(
"Initial GPU selected (`--number_gpu_start`) + number GPUs to use (`--number_gpu`) must"
" be lower or equal than the total number of GPUs in your machine ("
+
std
::
to_string
(
gpuNumberStart
)
+
" + "
+
std
::
to_string
(
numberThreads
)
+
" vs. "
+
std
::
to_string
(
totalGpuNumber
)
+
")."
,
__LINE__
,
__FUNCTION__
,
__FILE__
);
}
// Proper format
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录