Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
a7660331a
tesseract
提交
c4d52c77
T
tesseract
项目概览
a7660331a
/
tesseract
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
tesseract
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c4d52c77
编写于
9月 01, 2015
作者:
Z
Zdenko Podobný
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #87 from jbarlow83/master
Get --enable-opencl to compile (but not work)
上级
252d9a4d
73b0297e
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
63 addition
and
58 deletion
+63
-58
.gitignore
.gitignore
+5
-0
api/Makefile.am
api/Makefile.am
+6
-6
ccmain/Makefile.am
ccmain/Makefile.am
+3
-3
ccstruct/Makefile.am
ccstruct/Makefile.am
+1
-3
configure.ac
configure.ac
+27
-16
opencl/Makefile.am
opencl/Makefile.am
+2
-8
opencl/openclwrapper.cpp
opencl/openclwrapper.cpp
+6
-6
textord/Makefile.am
textord/Makefile.am
+2
-3
training/Makefile.am
training/Makefile.am
+11
-13
未找到文件。
.gitignore
浏览文件 @
c4d52c77
...
...
@@ -64,3 +64,8 @@ training/wordlist2dawg
*.cube.*
*.tesseract_cube.*
*.traineddata
# OpenCL
tesseract_opencl_profile_devices.dat
kernel*.bin
api/Makefile.am
浏览文件 @
c4d52c77
...
...
@@ -6,9 +6,9 @@ AM_CPPFLAGS += -DLOCALEDIR=\"$(localedir)\"\
-I
$(top_srcdir)
/classify
-I
$(top_srcdir)
/ccmain
\
-I
$(top_srcdir)
/wordrec
-I
$(top_srcdir)
/cutil
\
-I
$(top_srcdir)
/opencl
if
USE_OPENCL
AM_CPPFLAGS
+=
-I
$(OPENCL_HDR_PATH
)
endif
AM_CPPFLAGS
+=
$(OPENCL_CPPFLAGS
)
if
VISIBILITY
AM_CPPFLAGS
+=
-fvisibility
=
hidden
-fvisibility-inlines-hidden
endif
...
...
@@ -78,9 +78,9 @@ endif
tesseract_LDADD
=
libtesseract.la
if
USE_OPENCL
tesseract_LD
ADD
+=
$(OPENCL_LIB
)
endif
tesseract_LD
FLAGS
=
$(OPENCL_LDFLAGS
)
if
OPENMP
tesseract_LDADD
+=
$(OPENMP_CFLAGS)
endif
...
...
ccmain/Makefile.am
浏览文件 @
c4d52c77
...
...
@@ -5,9 +5,9 @@ AM_CPPFLAGS += \
-I
$(top_srcdir)
/classify
-I
$(top_srcdir)
/dict
\
-I
$(top_srcdir)
/wordrec
-I
$(top_srcdir)
/cutil
\
-I
$(top_srcdir)
/textord
-I
$(top_srcdir)
/opencl
if
USE_OPENCL
AM_CPPFLAGS
+=
-I
$(OPENCL_HDR_PATH
)
endif
AM_CPPFLAGS
+=
$(OPENCL_CPPFLAGS
)
if
VISIBILITY
AM_CPPFLAGS
+=
-DTESS_EXPORTS
\
-fvisibility
=
hidden
-fvisibility-inlines-hidden
...
...
ccstruct/Makefile.am
浏览文件 @
c4d52c77
...
...
@@ -2,9 +2,7 @@ AM_CPPFLAGS += \
-I
$(top_srcdir)
/ccutil
-I
$(top_srcdir)
/cutil
\
-I
$(top_srcdir)
/viewer
\
-I
$(top_srcdir)
/opencl
if
USE_OPENCL
AM_CPPFLAGS
+=
-I
$(OPENCL_HDR_PATH)
endif
AM_CPPFLAGS
+=
$(OPENCL_CPPFLAGS)
if
VISIBILITY
AM_CPPFLAGS
+=
-DTESS_EXPORTS
\
...
...
configure.ac
浏览文件 @
c4d52c77
...
...
@@ -99,7 +99,7 @@ case "${host_os}" in
AM_CONDITIONAL(ADD_RT, true)
;;
*darwin*)
OPENCL_LIBS="
-framework OpenCL
"
OPENCL_LIBS=""
OPENCL_INC=""
AM_CONDITIONAL(ADD_RT, false)
;;
...
...
@@ -212,6 +212,8 @@ m4_define([MY_CHECK_FRAMEWORK],
)
have_opencl_lib=false
OPENCL_CPPFLAGS=''
OPENCL_LDFLAGS=''
case "${host_os}" in
*darwin* | *-macos10*)
echo "checking for OpenCL framework"
...
...
@@ -219,28 +221,37 @@ case "${host_os}" in
if test $my_cv_framework_OpenCL = yes; then
have_opencl_lib=true
fi
if test "$enable_opencl" = "yes"; then
if !($have_opencl_lib); then
AC_MSG_ERROR(Required OpenCL library not found!)
fi
AC_SUBST([AM_CPPFLAGS], [-DUSE_OPENCL])
OPENCL_CPPFLAGS=""
OPENCL_LDFLAGS="-framework OpenCL"
fi
;;
*)
# default
AC_CHECK_LIB(OpenCL, clGetPlatformIDs, have_opencl_lib=true, have_opencl_lib=false)
if test "$enable_opencl" = "yes"; then
if !($have_opencl); then
AC_MSG_ERROR(Required OpenCL headers not found!)
fi
if !($have_opencl_lib); then
AC_MSG_ERROR(Required OpenCL library not found!)
fi
if !($have_tiff); then
AC_MSG_ERROR(Required TIFF headers not found! Try to install libtiff-dev?? package.)
fi
AC_SUBST([AM_CPPFLAGS], [-DUSE_OPENCL])
OPENCL_CPPFLAGS="-I${OPENCL_INC}"
OPENCL_LDFLAGS="${OPENCL_LIBS}"
fi
;;
esac
if test "$enable_opencl" = "yes"; then
if !($have_opencl); then
AC_MSG_ERROR(Required OpenCL headers not found!)
fi
if !($have_opencl_lib); then
AC_MSG_ERROR(Required OpenCL library not found!)
fi
if !($have_tiff); then
AC_MSG_ERROR(Required TIFF headers not found! Try to install libtiff-dev?? package.)
fi
AC_SUBST([AM_CPPFLAGS], [-DUSE_OPENCL])
AC_SUBST([OPENCL_HDR_PATH],[$OPENCL_INC])
AC_SUBST([OPENCL_LIB],[$OPENCL_LIBS])
fi
AM_CONDITIONAL([USE_OPENCL], [test "$enable_opencl" = "yes"])
AC_SUBST(OPENCL_CPPFLAGS)
AC_SUBST(OPENCL_LDFLAGS)
# check whether to build tesseract with -fvisibility=hidden -fvisibility-inlines-hidden
# http://gcc.gnu.org/wiki/Visibility
...
...
opencl/Makefile.am
浏览文件 @
c4d52c77
AM_CPPFLAGS
+=
-I
$(top_srcdir)
/ccutil
-I
$(top_srcdir)
/ccstruct
-I
$(top_srcdir)
/ccmain
if
USE_OPENCL
AM_CPPFLAGS
+=
-I
$(OPENCL_HDR_PATH)
endif
AM_CPPFLAGS
+=
-I
$(top_srcdir)
/ccutil
-I
$(top_srcdir)
/ccstruct
-I
$(top_srcdir)
/ccmain
$(OPENCL_CFLAGS)
noinst_HEADERS
=
\
openclwrapper.h oclkernels.h opencl_device_selection.h
...
...
@@ -9,13 +6,10 @@ if !USING_MULTIPLELIBS
noinst_LTLIBRARIES
=
libtesseract_opencl.la
else
lib_LTLIBRARIES
=
libtesseract_opencl.la
libtesseract_opencl_la_LDFLAGS
=
-version-info
$(GENERIC_LIBRARY_VERSION)
libtesseract_opencl_la_LDFLAGS
=
-version-info
$(GENERIC_LIBRARY_VERSION)
$(OPENCL_LDFLAGS)
libtesseract_opencl_la_LIBADD
=
\
../ccutil/libtesseract_ccutil.la
\
../viewer/libtesseract_viewer.la
if
USE_OPENCL
libtesseract_opencl_la_LDFLAGS
+=
$(OPENCL_LIB)
endif
endif
libtesseract_opencl_la_SOURCES
=
\
...
...
opencl/openclwrapper.cpp
浏览文件 @
c4d52c77
...
...
@@ -60,7 +60,7 @@ KernelEnv rEnv;
// substitute invalid characters in device name with _
void
legalizeFileName
(
char
*
fileName
)
{
//printf("fileName: %s\n", fileName);
c
har
*
invalidChars
=
"/\?:*
\"
><| "
;
// space is valid but can cause headaches
c
onst
char
*
invalidChars
=
"/\?:*
\"
><| "
;
// space is valid but can cause headaches
// for each invalid char
for
(
int
i
=
0
;
i
<
strlen
(
invalidChars
);
i
++
)
{
char
invalidStr
[
4
];
...
...
@@ -2408,9 +2408,9 @@ PERF_COUNT_START("HistogramRectOCL")
int
requestedOccupancy
=
10
;
int
numWorkGroups
=
numCUs
*
requestedOccupancy
;
int
numThreads
=
block_size
*
numWorkGroups
;
size_t
local_work_size
[]
=
{
block_size
};
size_t
global_work_size
[]
=
{
numThreads
};
size_t
red_global_work_size
[]
=
{
block_size
*
kHistogramSize
*
bytes_per_pixel
};
size_t
local_work_size
[]
=
{
static_cast
<
size_t
>
(
block_size
)
};
size_t
global_work_size
[]
=
{
static_cast
<
size_t
>
(
numThreads
)
};
size_t
red_global_work_size
[]
=
{
static_cast
<
size_t
>
(
block_size
*
kHistogramSize
*
bytes_per_pixel
)
};
/* map histogramAllChannels as write only */
int
numBins
=
kHistogramSize
*
bytes_per_pixel
*
numWorkGroups
;
...
...
@@ -3398,8 +3398,8 @@ PERF_COUNT_SUB("pix setup")
int
block_size
=
256
;
int
numWorkGroups
=
((
h
*
w
+
block_size
-
1
)
/
block_size
);
int
numThreads
=
block_size
*
numWorkGroups
;
size_t
local_work_size
[]
=
{
block_size
};
size_t
global_work_size
[]
=
{
numThreads
};
size_t
local_work_size
[]
=
{
static_cast
<
size_t
>
(
block_size
)
};
size_t
global_work_size
[]
=
{
static_cast
<
size_t
>
(
numThreads
)
};
//printf("Enqueueing %i threads for %i output pixels\n", numThreads, w*h);
/* compile kernel */
...
...
textord/Makefile.am
浏览文件 @
c4d52c77
...
...
@@ -5,9 +5,8 @@ AM_CPPFLAGS += \
-I
$(top_srcdir)
/ccmain
-I
$(top_srcdir)
/wordrec
-I
$(top_srcdir)
/api
\
-I
$(top_srcdir)
/cutil
-I
$(top_srcdir)
/classify
-I
$(top_srcdir)
/dict
\
-I
$(top_srcdir)
/opencl
if
USE_OPENCL
AM_CPPFLAGS
+=
-I
$(OPENCL_HDR_PATH)
endif
AM_CPPFLAGS
+=
$(OPENCL_CPPFLAGS)
if
VISIBILITY
AM_CPPFLAGS
+=
-DTESS_EXPORTS
\
...
...
training/Makefile.am
浏览文件 @
c4d52c77
...
...
@@ -298,16 +298,14 @@ noinst_HEADERS += ../vs2010/port/strcasestr.h
libtesseract_training_la_SOURCES
+=
../vs2010/port/strcasestr.cpp
endif
if
USE_OPENCL
ambiguous_words_LDADD
+=
$(OPENCL_LIB)
classifier_tester_LDADD
+=
$(OPENCL_LIB)
cntraining_LDADD
+=
$(OPENCL_LIB)
combine_tessdata_LDADD
+=
$(OPENCL_LIB)
dawg2wordlist_LDADD
+=
$(OPENCL_LIB)
mftraining_LDADD
+=
$(OPENCL_LIB)
set_unicharset_properties_LDADD
+=
$(OPENCL_LIB)
shapeclustering_LDADD
+=
$(OPENCL_LIB)
text2image_LDADD
+=
$(OPENCL_LIB)
unicharset_extractor_LDADD
+=
$(OPENCL_LIB)
wordlist2dawg_LDADD
+=
$(OPENCL_LIB)
endif
ambiguous_words_LDFLAGS
=
$(OPENCL_LDFLAGS)
classifier_tester_LDFLAGS
=
$(OPENCL_LDFLAGS)
cntraining_LDFLAGS
=
$(OPENCL_LDFLAGS)
combine_tessdata_LDFLAGS
=
$(OPENCL_LDFLAGS)
dawg2wordlist_LDFLAGS
=
$(OPENCL_LDFLAGS)
mftraining_LDFLAGS
=
$(OPENCL_LDFLAGS)
set_unicharset_properties_LDFLAGS
=
$(OPENCL_LDFLAGS)
shapeclustering_LDFLAGS
=
$(OPENCL_LDFLAGS)
text2image_LDFLAGS
=
$(OPENCL_LDFLAGS)
unicharset_extractor_LDFLAGS
=
$(OPENCL_LDFLAGS)
wordlist2dawg_LDFLAGS
=
$(OPENCL_LDFLAGS)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录