Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleOCR
提交
bfed1819
P
PaddleOCR
项目概览
s920243400
/
PaddleOCR
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleOCR
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleOCR
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
bfed1819
编写于
9月 27, 2020
作者:
L
lidanqing-intel
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add /openmp for windows flag
上级
5d202e44
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
30 addition
and
8 deletion
+30
-8
deploy/cpp_infer/CMakeLists.txt
deploy/cpp_infer/CMakeLists.txt
+14
-8
deploy/cpp_infer/src/main.cpp
deploy/cpp_infer/src/main.cpp
+16
-0
未找到文件。
deploy/cpp_infer/CMakeLists.txt
浏览文件 @
bfed1819
...
...
@@ -42,7 +42,6 @@ if (WIN32)
include_directories
(
"
${
PADDLE_LIB
}
/paddle/include"
)
link_directories
(
"
${
PADDLE_LIB
}
/paddle/fluid/inference"
)
find_package
(
OpenCV REQUIRED PATHS
${
OPENCV_DIR
}
/build/ NO_DEFAULT_PATH
)
else
()
find_package
(
OpenCV REQUIRED PATHS
${
OPENCV_DIR
}
/share/OpenCV NO_DEFAULT_PATH
)
include_directories
(
"
${
PADDLE_LIB
}
/paddle/include"
)
...
...
@@ -52,20 +51,26 @@ include_directories(${OpenCV_INCLUDE_DIRS})
if
(
WIN32
)
add_definitions
(
"/DGOOGLE_GLOG_DLL_DECL="
)
set
(
CMAKE_C_FLAGS_DEBUG
"
${
CMAKE_C_FLAGS_DEBUG
}
/bigobj /MTd"
)
set
(
CMAKE_C_FLAGS_RELEASE
"
${
CMAKE_C_FLAGS_RELEASE
}
/bigobj /MT"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"
${
CMAKE_CXX_FLAGS_DEBUG
}
/bigobj /MTd"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"
${
CMAKE_CXX_FLAGS_RELEASE
}
/bigobj /MT"
)
if
(
WITH_MKL
)
set
(
FLAG_OPENMP
"/openmp"
)
endif
()
set
(
CMAKE_C_FLAGS_DEBUG
"
${
CMAKE_C_FLAGS_DEBUG
}
/bigobj /MTd
${
FLAG_OPENMP
}
"
)
set
(
CMAKE_C_FLAGS_RELEASE
"
${
CMAKE_C_FLAGS_RELEASE
}
/bigobj /MT
${
FLAG_OPENMP
}
"
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"
${
CMAKE_CXX_FLAGS_DEBUG
}
/bigobj /MTd
${
FLAG_OPENMP
}
"
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"
${
CMAKE_CXX_FLAGS_RELEASE
}
/bigobj /MT
${
FLAG_OPENMP
}
"
)
if
(
WITH_STATIC_LIB
)
safe_set_static_flag
()
add_definitions
(
-DSTATIC_LIB
)
endif
()
message
(
"cmake c debug flags "
${
CMAKE_C_FLAGS_DEBUG
}
)
message
(
"cmake c release flags "
${
CMAKE_C_FLAGS_RELEASE
}
)
message
(
"cmake cxx debug flags "
${
CMAKE_CXX_FLAGS_DEBUG
}
)
message
(
"cmake cxx release flags "
${
CMAKE_CXX_FLAGS_RELEASE
}
)
else
()
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-g -o3 -std=c++11"
)
set
(
CMAKE_STATIC_LIBRARY_PREFIX
""
)
message
(
"flags"
${
CMAKE_CXX_FLAGS
}
)
endif
()
message
(
"flags"
${
CMAKE_CXX_FLAGS
}
)
if
(
WITH_GPU
)
if
(
NOT DEFINED CUDA_LIB OR
${
CUDA_LIB
}
STREQUAL
""
)
...
...
@@ -198,4 +203,5 @@ if (WIN32 AND WITH_MKL)
COMMAND
${
CMAKE_COMMAND
}
-E copy_if_different
${
PADDLE_LIB
}
/third_party/install/mklml/lib/libiomp5md.dll ./release/libiomp5md.dll
COMMAND
${
CMAKE_COMMAND
}
-E copy_if_different
${
PADDLE_LIB
}
/third_party/install/mkldnn/lib/mkldnn.dll ./release/mkldnn.dll
)
endif
()
\ No newline at end of file
endif
()
deploy/cpp_infer/src/main.cpp
浏览文件 @
bfed1819
...
...
@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "omp.h"
#include "opencv2/core.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/imgproc.hpp"
...
...
@@ -67,6 +68,21 @@ int main(int argc, char **argv) {
config
.
use_mkldnn
,
config
.
use_zero_copy_run
,
config
.
char_list_file
);
#ifdef USE_MKL
// test omp parallel
int
i
;
std
::
cout
<<
"...........Testing MKL......... "
<<
omp_get_num_threads
()
<<
std
::
endl
;
#pragma omp parallel for private(i)
for
(
i
=
0
;
i
<
50
;
i
++
)
{
std
::
cout
<<
"omp_get_num_threads(): "
<<
omp_get_num_threads
()
<<
std
::
endl
;
int
tid
=
omp_get_thread_num
();
std
::
cout
<<
"Log from omp thread "
<<
tid
<<
std
::
endl
;
}
#endif
auto
start
=
std
::
chrono
::
system_clock
::
now
();
std
::
vector
<
std
::
vector
<
std
::
vector
<
int
>>>
boxes
;
det
.
Run
(
srcimg
,
boxes
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录