Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
3a959784
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
331
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
271
列表
看板
标记
里程碑
合并请求
78
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle-Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
271
Issue
271
列表
看板
标记
里程碑
合并请求
78
合并请求
78
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
3a959784
编写于
4月 28, 2020
作者:
H
huzhiqiang
提交者:
GitHub
4月 28, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Compile] change compiling option `SHUTDOWN_LOG` into `WITH_LOG` #3514
上级
e47f1607
变更
39
隐藏空白更改
内联
并排
Showing
39 changed file
with
124 addition
and
128 deletion
+124
-128
CMakeLists.txt
CMakeLists.txt
+1
-1
cmake/configure.cmake
cmake/configure.cmake
+2
-2
docs/demo_guides/rknpu.md
docs/demo_guides/rknpu.md
+2
-2
lite/api/CMakeLists.txt
lite/api/CMakeLists.txt
+1
-1
lite/backends/opencl/cl_utility.h
lite/backends/opencl/cl_utility.h
+1
-1
lite/demo/cxx/README.md
lite/demo/cxx/README.md
+1
-1
lite/demo/java/README.md
lite/demo/java/README.md
+1
-1
lite/kernels/opencl/activation_image_compute.cc
lite/kernels/opencl/activation_image_compute.cc
+3
-3
lite/kernels/opencl/bilinear_interp_image_compute.cc
lite/kernels/opencl/bilinear_interp_image_compute.cc
+4
-4
lite/kernels/opencl/box_coder_image_compute.cc
lite/kernels/opencl/box_coder_image_compute.cc
+3
-3
lite/kernels/opencl/concat_image_compute.cc
lite/kernels/opencl/concat_image_compute.cc
+3
-3
lite/kernels/opencl/conv_image_compute.cc
lite/kernels/opencl/conv_image_compute.cc
+19
-19
lite/kernels/opencl/elementwise_add_buffer_compute.cc
lite/kernels/opencl/elementwise_add_buffer_compute.cc
+2
-2
lite/kernels/opencl/elementwise_add_image_compute.cc
lite/kernels/opencl/elementwise_add_image_compute.cc
+3
-3
lite/kernels/opencl/elementwise_mul_image_compute.cc
lite/kernels/opencl/elementwise_mul_image_compute.cc
+3
-3
lite/kernels/opencl/elementwise_sub_image_compute.cc
lite/kernels/opencl/elementwise_sub_image_compute.cc
+4
-4
lite/kernels/opencl/fc_buffer_compute.cc
lite/kernels/opencl/fc_buffer_compute.cc
+2
-2
lite/kernels/opencl/grid_sampler_image_compute.cc
lite/kernels/opencl/grid_sampler_image_compute.cc
+2
-2
lite/kernels/opencl/instance_norm_image_compute.cc
lite/kernels/opencl/instance_norm_image_compute.cc
+4
-4
lite/kernels/opencl/io_copy_buffer_compute.cc
lite/kernels/opencl/io_copy_buffer_compute.cc
+3
-3
lite/kernels/opencl/layout_image_compute.cc
lite/kernels/opencl/layout_image_compute.cc
+4
-4
lite/kernels/opencl/lrn_image_compute.cc
lite/kernels/opencl/lrn_image_compute.cc
+4
-4
lite/kernels/opencl/nearest_interp_image_compute.cc
lite/kernels/opencl/nearest_interp_image_compute.cc
+1
-1
lite/kernels/opencl/pad2d_image_compute.cc
lite/kernels/opencl/pad2d_image_compute.cc
+4
-4
lite/kernels/opencl/pool_image_compute.cc
lite/kernels/opencl/pool_image_compute.cc
+4
-4
lite/kernels/opencl/reshape_image_compute.cc
lite/kernels/opencl/reshape_image_compute.cc
+3
-3
lite/tools/build.bat
lite/tools/build.bat
+1
-1
lite/tools/build.sh
lite/tools/build.sh
+8
-8
lite/tools/build_android.sh
lite/tools/build_android.sh
+6
-6
lite/tools/build_ios.sh
lite/tools/build_ios.sh
+5
-5
lite/tools/build_linux.sh
lite/tools/build_linux.sh
+1
-5
lite/tools/build_npu.sh
lite/tools/build_npu.sh
+3
-3
lite/tools/build_rknpu.sh
lite/tools/build_rknpu.sh
+4
-4
lite/tools/ci_build.sh
lite/tools/ci_build.sh
+3
-3
lite/utils/CMakeLists.txt
lite/utils/CMakeLists.txt
+1
-1
lite/utils/cp_logging.h
lite/utils/cp_logging.h
+1
-1
lite/utils/logging.cc
lite/utils/logging.cc
+2
-2
lite/utils/logging.h
lite/utils/logging.h
+4
-4
lite/utils/replace_stl/stream.cc
lite/utils/replace_stl/stream.cc
+1
-1
未找到文件。
CMakeLists.txt
浏览文件 @
3a959784
...
@@ -97,7 +97,7 @@ lite_option(LITE_WITH_FPGA "Enable FPGA support in lite" OFF)
...
@@ -97,7 +97,7 @@ lite_option(LITE_WITH_FPGA "Enable FPGA support in lite" OFF)
lite_option
(
LITE_WITH_LIGHT_WEIGHT_FRAMEWORK
"Enable light-weight framework"
OFF
)
lite_option
(
LITE_WITH_LIGHT_WEIGHT_FRAMEWORK
"Enable light-weight framework"
OFF
)
lite_option
(
LITE_WITH_PROFILE
"Enable profile mode in lite framework"
OFF
)
lite_option
(
LITE_WITH_PROFILE
"Enable profile mode in lite framework"
OFF
)
lite_option
(
LITE_WITH_PRECISION_PROFILE
"Enable precision profile in profile mode ON in lite"
OFF
)
lite_option
(
LITE_WITH_PRECISION_PROFILE
"Enable precision profile in profile mode ON in lite"
OFF
)
lite_option
(
LITE_
SHUTDOWN_LOG
"Shutdown log system or not."
OFF
)
lite_option
(
LITE_
WITH_LOG
"Enable log printing or not."
ON
)
lite_option
(
LITE_ON_TINY_PUBLISH
"Publish tiny predictor lib."
OFF
)
lite_option
(
LITE_ON_TINY_PUBLISH
"Publish tiny predictor lib."
OFF
)
lite_option
(
LITE_ON_MODEL_OPTIMIZE_TOOL
"Build the model optimize tool"
OFF
)
lite_option
(
LITE_ON_MODEL_OPTIMIZE_TOOL
"Build the model optimize tool"
OFF
)
# publish options
# publish options
...
...
cmake/configure.cmake
浏览文件 @
3a959784
...
@@ -186,8 +186,8 @@ if (LITE_WITH_LIGHT_WEIGHT_FRAMEWORK)
...
@@ -186,8 +186,8 @@ if (LITE_WITH_LIGHT_WEIGHT_FRAMEWORK)
add_definitions
(
"-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK"
)
add_definitions
(
"-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK"
)
endif
()
endif
()
if
(
LITE_
SHUTDOWN
_LOG
)
if
(
LITE_
WITH
_LOG
)
add_definitions
(
"-DLITE_
SHUTDOWN
_LOG"
)
add_definitions
(
"-DLITE_
WITH
_LOG"
)
endif
()
endif
()
if
(
LITE_ON_TINY_PUBLISH
)
if
(
LITE_ON_TINY_PUBLISH
)
...
...
docs/demo_guides/rknpu.md
浏览文件 @
3a959784
...
@@ -131,8 +131,8 @@ $ git clone https://github.com/airockchip/rknpu_ddk.git
...
@@ -131,8 +131,8 @@ $ git clone https://github.com/airockchip/rknpu_ddk.git
```
```
-
编译full_publish and tiny_publish for armv8(注意:RKNPU_DDK只支持armv8)
-
编译full_publish and tiny_publish for armv8(注意:RKNPU_DDK只支持armv8)
```
shell
```
shell
$
./lite/tools/build.sh
--arm_os
=
armlinux
--arm_abi
=
armv8
--arm_lang
=
gcc
--build_extra
=
ON
--
shutdown_log
=
OFF
--build_rknpu
=
ON
--rknpu_ddk_root
=
./rknpu_ddk full_publish
$
./lite/tools/build.sh
--arm_os
=
armlinux
--arm_abi
=
armv8
--arm_lang
=
gcc
--build_extra
=
ON
--
with_log
=
ON
--build_rknpu
=
ON
--rknpu_ddk_root
=
./rknpu_ddk full_publish
$
./lite/tools/build.sh
--arm_os
=
armlinux
--arm_abi
=
armv8
--arm_lang
=
gcc
--build_extra
=
ON
--
shutdown_log
=
OFF
--build_rknpu
=
ON
--rknpu_ddk_root
=
./rknpu_ddk tiny_publish
$
./lite/tools/build.sh
--arm_os
=
armlinux
--arm_abi
=
armv8
--arm_lang
=
gcc
--build_extra
=
ON
--
with_log
=
ON
--build_rknpu
=
ON
--rknpu_ddk_root
=
./rknpu_ddk tiny_publish
```
```
-
将编译生成的build.lite.armlinux.armv8.gcc/inference_lite_lib.armlinux.armv8.rknpu/cxx/include替换PaddleLite-armlinux-demo/Paddle-Lite/include目录;
-
将编译生成的build.lite.armlinux.armv8.gcc/inference_lite_lib.armlinux.armv8.rknpu/cxx/include替换PaddleLite-armlinux-demo/Paddle-Lite/include目录;
-
将编译生成的build.lite.armlinux.armv8.gcc/inference_lite_lib.armlinux.armv8.rknpu/cxx/lib/libpaddle_light_api_shared.so替换PaddleLite-armlinux-demo/Paddle-Lite/libs/armv8/libpaddle_light_api_shared.so文件。
-
将编译生成的build.lite.armlinux.armv8.gcc/inference_lite_lib.armlinux.armv8.rknpu/cxx/lib/libpaddle_light_api_shared.so替换PaddleLite-armlinux-demo/Paddle-Lite/libs/armv8/libpaddle_light_api_shared.so文件。
...
...
lite/api/CMakeLists.txt
浏览文件 @
3a959784
if
(
LITE_WITH_LIGHT_WEIGHT_FRAMEWORK OR
LITE_SHUTDOWN_LOG
)
if
(
LITE_WITH_LIGHT_WEIGHT_FRAMEWORK
OR
(
NOT LITE_WITH_LOG
)
)
lite_cc_library
(
place SRCS paddle_place.cc DEPS logging
)
lite_cc_library
(
place SRCS paddle_place.cc DEPS logging
)
else
()
else
()
lite_cc_library
(
place SRCS paddle_place.cc DEPS glog
)
lite_cc_library
(
place SRCS paddle_place.cc DEPS glog
)
...
...
lite/backends/opencl/cl_utility.h
浏览文件 @
3a959784
...
@@ -32,7 +32,7 @@ const char* opencl_error_to_str(cl_int error);
...
@@ -32,7 +32,7 @@ const char* opencl_error_to_str(cl_int error);
__FILE__, \
__FILE__, \
__LINE__); \
__LINE__); \
}
}
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
#define CL_CHECK_FATAL(err_code__) \
#define CL_CHECK_FATAL(err_code__) \
if (err_code__ != CL_SUCCESS) { \
if (err_code__ != CL_SUCCESS) { \
LOG(FATAL) << string_format( \
LOG(FATAL) << string_format( \
...
...
lite/demo/cxx/README.md
浏览文件 @
3a959784
...
@@ -54,7 +54,7 @@ git checkout release/v2.3
...
@@ -54,7 +54,7 @@ git checkout release/v2.3
--arm_lang
=
gcc
\
--arm_lang
=
gcc
\
--android_stl
=
c++_static
\
--android_stl
=
c++_static
\
--build_extra
=
ON
\
--build_extra
=
ON
\
--
shutdown_log
=
OFF
\
--
with_log
=
ON
\
full_publish
full_publish
```
```
...
...
lite/demo/java/README.md
浏览文件 @
3a959784
...
@@ -24,7 +24,7 @@ cmake .. \
...
@@ -24,7 +24,7 @@ cmake .. \
-DLITE_WITH_ARM=ON \
-DLITE_WITH_ARM=ON \
-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK=ON \
-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK=ON \
-DWITH_TESTING=OFF \
-DWITH_TESTING=OFF \
-DLITE_
SHUTDOWN_LOG=ON
\
-DLITE_
WITH_LOG=OFF
\
-DLITE_ON_TINY_PUBLISH=ON \
-DLITE_ON_TINY_PUBLISH=ON \
-DARM_TARGET_OS=android -DARM_TARGET_ARCH_ABI=armv8 -DARM_TARGET_LANG=gcc
-DARM_TARGET_OS=android -DARM_TARGET_ARCH_ABI=armv8 -DARM_TARGET_LANG=gcc
...
...
lite/kernels/opencl/activation_image_compute.cc
浏览文件 @
3a959784
...
@@ -39,7 +39,7 @@ class ActivationComputeImageDefault
...
@@ -39,7 +39,7 @@ class ActivationComputeImageDefault
void
PrepareForRun
()
override
{
void
PrepareForRun
()
override
{
act_param_
=
param_
.
get_mutable
<
param_t
>
();
act_param_
=
param_
.
get_mutable
<
param_t
>
();
int
act_type
=
static_cast
<
int
>
(
act_param_
->
active_type
);
int
act_type
=
static_cast
<
int
>
(
act_param_
->
active_type
);
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
1
)
<<
"ActivationTypeToStr(act_param_->active_type):"
VLOG
(
1
)
<<
"ActivationTypeToStr(act_param_->active_type):"
<<
ActivationTypeToStr
(
act_param_
->
active_type
);
<<
ActivationTypeToStr
(
act_param_
->
active_type
);
#endif
#endif
...
@@ -72,7 +72,7 @@ class ActivationComputeImageDefault
...
@@ -72,7 +72,7 @@ class ActivationComputeImageDefault
LOG
(
FATAL
)
<<
"This act type:"
<<
act_type
<<
" doesn't support."
;
LOG
(
FATAL
)
<<
"This act type:"
<<
act_type
<<
" doesn't support."
;
return
;
return
;
}
}
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
1
)
<<
"kernel_func_name_:"
<<
kernel_func_name_
;
VLOG
(
1
)
<<
"kernel_func_name_:"
<<
kernel_func_name_
;
#endif
#endif
...
@@ -129,7 +129,7 @@ class ActivationComputeImageDefault
...
@@ -129,7 +129,7 @@ class ActivationComputeImageDefault
status
=
kernel
.
setArg
(
3
,
scale_
);
status
=
kernel
.
setArg
(
3
,
scale_
);
CL_CHECK_FATAL
(
status
);
CL_CHECK_FATAL
(
status
);
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
const
auto
&
x_dims
=
act_param_
->
X
->
dims
();
const
auto
&
x_dims
=
act_param_
->
X
->
dims
();
const
auto
&
y_dims
=
act_param_
->
Out
->
dims
();
// useless: check dim only
const
auto
&
y_dims
=
act_param_
->
Out
->
dims
();
// useless: check dim only
VLOG
(
4
)
<<
TargetToStr
(
act_param_
->
X
->
target
());
VLOG
(
4
)
<<
TargetToStr
(
act_param_
->
X
->
target
());
...
...
lite/kernels/opencl/bilinear_interp_image_compute.cc
浏览文件 @
3a959784
...
@@ -79,7 +79,7 @@ class BilinearInterpImageCompute
...
@@ -79,7 +79,7 @@ class BilinearInterpImageCompute
int
out_h
=
out_dims
[
2
];
int
out_h
=
out_dims
[
2
];
int
out_w
=
out_dims
[
3
];
int
out_w
=
out_dims
[
3
];
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"x->target():"
<<
TargetToStr
(
x
->
target
());
VLOG
(
4
)
<<
"x->target():"
<<
TargetToStr
(
x
->
target
());
VLOG
(
4
)
<<
"out->target():"
<<
TargetToStr
(
out
->
target
());
VLOG
(
4
)
<<
"out->target():"
<<
TargetToStr
(
out
->
target
());
VLOG
(
4
)
<<
"x->dims():"
<<
in_dims
;
VLOG
(
4
)
<<
"x->dims():"
<<
in_dims
;
...
@@ -92,7 +92,7 @@ class BilinearInterpImageCompute
...
@@ -92,7 +92,7 @@ class BilinearInterpImageCompute
auto
*
out_img
=
out
->
mutable_data
<
half_t
,
cl
::
Image2D
>
(
auto
*
out_img
=
out
->
mutable_data
<
half_t
,
cl
::
Image2D
>
(
out_image_shape
[
"width"
],
out_image_shape
[
"height"
]);
out_image_shape
[
"width"
],
out_image_shape
[
"height"
]);
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
// VLOG(4) << "x_image: " << x_img;
// VLOG(4) << "x_image: " << x_img;
// VLOG(4) << "out_image: " << out_img;
// VLOG(4) << "out_image: " << out_img;
VLOG
(
4
)
<<
"out_image_shape[w,h]: "
<<
out_image_shape
[
"width"
]
<<
" "
VLOG
(
4
)
<<
"out_image_shape[w,h]: "
<<
out_image_shape
[
"width"
]
<<
" "
...
@@ -114,7 +114,7 @@ class BilinearInterpImageCompute
...
@@ -114,7 +114,7 @@ class BilinearInterpImageCompute
DDim
(
std
::
vector
<
DDim
::
value_type
>
{
DDim
(
std
::
vector
<
DDim
::
value_type
>
{
static_cast
<
int64_t
>
(
out_image_shape
[
"width"
]),
static_cast
<
int64_t
>
(
out_image_shape
[
"width"
]),
static_cast
<
int64_t
>
(
out_image_shape
[
"height"
])}));
static_cast
<
int64_t
>
(
out_image_shape
[
"height"
])}));
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"default_work_size: "
<<
default_work_size
[
0
]
<<
", "
VLOG
(
4
)
<<
"default_work_size: "
<<
default_work_size
[
0
]
<<
", "
<<
default_work_size
[
1
]
<<
", "
<<
default_work_size
[
2
];
<<
default_work_size
[
1
]
<<
", "
<<
default_work_size
[
2
];
#endif
#endif
...
@@ -150,7 +150,7 @@ class BilinearInterpImageCompute
...
@@ -150,7 +150,7 @@ class BilinearInterpImageCompute
nullptr
,
nullptr
,
nullptr
);
nullptr
);
CL_CHECK_FATAL
(
status
);
CL_CHECK_FATAL
(
status
);
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"global_work_size:[2D]:"
<<
global_work_size
[
0
]
<<
" "
VLOG
(
4
)
<<
"global_work_size:[2D]:"
<<
global_work_size
[
0
]
<<
" "
<<
global_work_size
[
1
]
<<
" "
<<
global_work_size
[
2
];
<<
global_work_size
[
1
]
<<
" "
<<
global_work_size
[
2
];
#endif
#endif
...
...
lite/kernels/opencl/box_coder_image_compute.cc
浏览文件 @
3a959784
...
@@ -61,7 +61,7 @@ class BoxCoderComputeImage : public KernelLite<TARGET(kOpenCL),
...
@@ -61,7 +61,7 @@ class BoxCoderComputeImage : public KernelLite<TARGET(kOpenCL),
boxcoder_param_
->
proposals
->
mutable_data
<
half_t
,
cl
::
Image2D
>
(
boxcoder_param_
->
proposals
->
mutable_data
<
half_t
,
cl
::
Image2D
>
(
image_shape
[
"width"
],
image_shape
[
"height"
]);
image_shape
[
"width"
],
image_shape
[
"height"
]);
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"boxcoder input shape: "
;
VLOG
(
4
)
<<
"boxcoder input shape: "
;
#endif
#endif
...
@@ -93,7 +93,7 @@ class BoxCoderComputeImage : public KernelLite<TARGET(kOpenCL),
...
@@ -93,7 +93,7 @@ class BoxCoderComputeImage : public KernelLite<TARGET(kOpenCL),
int
out_C
=
new_dims
[
1
];
int
out_C
=
new_dims
[
1
];
int
out_H
=
new_dims
[
2
];
int
out_H
=
new_dims
[
2
];
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
TargetToStr
(
boxcoder_param_
->
proposals
->
target
());
VLOG
(
4
)
<<
TargetToStr
(
boxcoder_param_
->
proposals
->
target
());
VLOG
(
4
)
<<
"output shape: "
<<
out_dims
[
0
]
<<
", "
<<
out_dims
[
1
]
<<
", "
VLOG
(
4
)
<<
"output shape: "
<<
out_dims
[
0
]
<<
", "
<<
out_dims
[
1
]
<<
", "
<<
out_dims
[
2
]
<<
", "
<<
out_dims
[
3
];
<<
out_dims
[
2
]
<<
", "
<<
out_dims
[
3
];
...
@@ -130,7 +130,7 @@ class BoxCoderComputeImage : public KernelLite<TARGET(kOpenCL),
...
@@ -130,7 +130,7 @@ class BoxCoderComputeImage : public KernelLite<TARGET(kOpenCL),
nullptr
);
nullptr
);
CL_CHECK_FATAL
(
status
);
CL_CHECK_FATAL
(
status
);
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"global_work_size:[2D]:"
<<
global_work_size
[
0
]
<<
" "
VLOG
(
4
)
<<
"global_work_size:[2D]:"
<<
global_work_size
[
0
]
<<
" "
<<
global_work_size
[
1
];
<<
global_work_size
[
1
];
#endif
#endif
...
...
lite/kernels/opencl/concat_image_compute.cc
浏览文件 @
3a959784
...
@@ -125,7 +125,7 @@ class ConcatComputeImage : public KernelLite<TARGET(kOpenCL),
...
@@ -125,7 +125,7 @@ class ConcatComputeImage : public KernelLite<TARGET(kOpenCL),
int
arg_idx
=
0
;
int
arg_idx
=
0
;
int
width
=
inputs
[
0
]
->
dims
()[
inputs
[
0
]
->
dims
().
size
()
-
1
];
int
width
=
inputs
[
0
]
->
dims
()[
inputs
[
0
]
->
dims
().
size
()
-
1
];
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"concat input shape: "
;
VLOG
(
4
)
<<
"concat input shape: "
;
for
(
size_t
i
=
0
;
i
<
inputs
.
size
();
i
++
)
{
for
(
size_t
i
=
0
;
i
<
inputs
.
size
();
i
++
)
{
VLOG
(
4
)
<<
"inputs ["
<<
i
<<
"]"
VLOG
(
4
)
<<
"inputs ["
<<
i
<<
"]"
...
@@ -149,7 +149,7 @@ class ConcatComputeImage : public KernelLite<TARGET(kOpenCL),
...
@@ -149,7 +149,7 @@ class ConcatComputeImage : public KernelLite<TARGET(kOpenCL),
x_dims
[
x_dims
.
size
()
-
1
]),
x_dims
[
x_dims
.
size
()
-
1
]),
static_cast
<
cl
::
size_type
>
(
image_shape
[
"height"
])};
static_cast
<
cl
::
size_type
>
(
image_shape
[
"height"
])};
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
TargetToStr
(
param
.
output
->
target
());
VLOG
(
4
)
<<
TargetToStr
(
param
.
output
->
target
());
VLOG
(
4
)
<<
"image_shape(w,h):"
<<
image_shape
[
"width"
]
<<
" "
VLOG
(
4
)
<<
"image_shape(w,h):"
<<
image_shape
[
"width"
]
<<
" "
<<
image_shape
[
"height"
];
<<
image_shape
[
"height"
];
...
@@ -204,7 +204,7 @@ class ConcatComputeImage : public KernelLite<TARGET(kOpenCL),
...
@@ -204,7 +204,7 @@ class ConcatComputeImage : public KernelLite<TARGET(kOpenCL),
image_shape
=
InitImageDimInfoWith
(
in_dims
);
image_shape
=
InitImageDimInfoWith
(
in_dims
);
auto
*
x_buf
=
inputs
[
i
]
->
data
<
half_t
,
cl
::
Image2D
>
();
auto
*
x_buf
=
inputs
[
i
]
->
data
<
half_t
,
cl
::
Image2D
>
();
int
in_w
=
in_dims
[
in_dims
.
size
()
-
1
];
int
in_w
=
in_dims
[
in_dims
.
size
()
-
1
];
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"image_shape(w,h):"
<<
image_shape
[
"width"
]
<<
" "
VLOG
(
4
)
<<
"image_shape(w,h):"
<<
image_shape
[
"width"
]
<<
" "
<<
image_shape
[
"height"
];
<<
image_shape
[
"height"
];
#endif
#endif
...
...
lite/kernels/opencl/conv_image_compute.cc
浏览文件 @
3a959784
...
@@ -541,12 +541,12 @@ void ConvImageCompute::Conv2d1x1opt(bool is_turn) {
...
@@ -541,12 +541,12 @@ void ConvImageCompute::Conv2d1x1opt(bool is_turn) {
int
input_c
=
input_dims
[
1
];
int
input_c
=
input_dims
[
1
];
auto
dilations
=
*
param
.
dilations
;
auto
dilations
=
*
param
.
dilations
;
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
// VLOG(4) << "out_image: " << out_image;
// VLOG(4) << "out_image: " << out_image;
VLOG
(
4
)
<<
"global_work_size_[3D]: {"
<<
global_work_size_
[
0
]
<<
","
VLOG
(
4
)
<<
"global_work_size_[3D]: {"
<<
global_work_size_
[
0
]
<<
","
<<
global_work_size_
[
1
]
<<
","
<<
global_work_size_
[
2
]
<<
"}"
;
<<
global_work_size_
[
1
]
<<
","
<<
global_work_size_
[
2
]
<<
"}"
;
#endif
#endif
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"============ conv2d_1x1 params ============"
;
VLOG
(
4
)
<<
"============ conv2d_1x1 params ============"
;
VLOG
(
4
)
<<
"input_image_shape: "
<<
input_image_shape
[
"width"
]
<<
","
VLOG
(
4
)
<<
"input_image_shape: "
<<
input_image_shape
[
"width"
]
<<
","
<<
input_image_shape
[
"height"
];
<<
input_image_shape
[
"height"
];
...
@@ -846,7 +846,7 @@ void ConvImageCompute::Conv2d3x3opt(bool is_turn) {
...
@@ -846,7 +846,7 @@ void ConvImageCompute::Conv2d3x3opt(bool is_turn) {
const
bool
is_element_wise_bias
=
const
bool
is_element_wise_bias
=
has_bias
&&
param
.
output
->
dims
()
==
param
.
bias
->
dims
();
has_bias
&&
param
.
output
->
dims
()
==
param
.
bias
->
dims
();
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"============ conv2d params ============"
;
VLOG
(
4
)
<<
"============ conv2d params ============"
;
// VLOG(4) << "input_image_shape: " << input_image_shape["width"] << ","
// VLOG(4) << "input_image_shape: " << input_image_shape["width"] << ","
// << input_image_shape["height"];
// << input_image_shape["height"];
...
@@ -893,7 +893,7 @@ void ConvImageCompute::Conv2d3x3opt(bool is_turn) {
...
@@ -893,7 +893,7 @@ void ConvImageCompute::Conv2d3x3opt(bool is_turn) {
status
=
kernel
.
setArg
(
++
arg_idx
,
*
filter_image
);
status
=
kernel
.
setArg
(
++
arg_idx
,
*
filter_image
);
CL_CHECK_FATAL
(
status
);
CL_CHECK_FATAL
(
status
);
if
(
has_bias
)
{
if
(
has_bias
)
{
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"set bias_image: "
;
VLOG
(
4
)
<<
"set bias_image: "
;
#endif
#endif
status
=
kernel
.
setArg
(
++
arg_idx
,
*
bias_image
);
status
=
kernel
.
setArg
(
++
arg_idx
,
*
bias_image
);
...
@@ -922,7 +922,7 @@ void ConvImageCompute::Conv2d3x3opt(bool is_turn) {
...
@@ -922,7 +922,7 @@ void ConvImageCompute::Conv2d3x3opt(bool is_turn) {
status
=
kernel
.
setArg
(
++
arg_idx
,
output_height
);
status
=
kernel
.
setArg
(
++
arg_idx
,
output_height
);
CL_CHECK_FATAL
(
status
);
CL_CHECK_FATAL
(
status
);
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
// VLOG(4) << "out_image: " << out_image;
// VLOG(4) << "out_image: " << out_image;
VLOG
(
4
)
<<
"global_work_size_[3D]: {"
<<
global_work_size_
[
0
]
<<
","
VLOG
(
4
)
<<
"global_work_size_[3D]: {"
<<
global_work_size_
[
0
]
<<
","
<<
global_work_size_
[
1
]
<<
","
<<
global_work_size_
[
2
]
<<
"}"
;
<<
global_work_size_
[
1
]
<<
","
<<
global_work_size_
[
2
]
<<
"}"
;
...
@@ -975,7 +975,7 @@ void ConvImageCompute::Conv2d5x5(bool is_turn) {
...
@@ -975,7 +975,7 @@ void ConvImageCompute::Conv2d5x5(bool is_turn) {
int
input_c
=
input_dims
[
1
];
int
input_c
=
input_dims
[
1
];
auto
dilations
=
*
param
.
dilations
;
auto
dilations
=
*
param
.
dilations
;
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"============ conv2d params ============"
;
VLOG
(
4
)
<<
"============ conv2d params ============"
;
VLOG
(
4
)
<<
"input_image_shape: "
<<
input_image_shape
[
"width"
]
<<
","
VLOG
(
4
)
<<
"input_image_shape: "
<<
input_image_shape
[
"width"
]
<<
","
<<
input_image_shape
[
"height"
];
<<
input_image_shape
[
"height"
];
...
@@ -1025,7 +1025,7 @@ void ConvImageCompute::Conv2d5x5(bool is_turn) {
...
@@ -1025,7 +1025,7 @@ void ConvImageCompute::Conv2d5x5(bool is_turn) {
status
=
kernel
.
setArg
(
++
arg_idx
,
*
filter_image
);
status
=
kernel
.
setArg
(
++
arg_idx
,
*
filter_image
);
CL_CHECK_FATAL
(
status
);
CL_CHECK_FATAL
(
status
);
if
(
has_bias
)
{
if
(
has_bias
)
{
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"set bias_image: "
;
VLOG
(
4
)
<<
"set bias_image: "
;
#endif
#endif
status
=
kernel
.
setArg
(
++
arg_idx
,
*
bias_image
);
status
=
kernel
.
setArg
(
++
arg_idx
,
*
bias_image
);
...
@@ -1052,7 +1052,7 @@ void ConvImageCompute::Conv2d5x5(bool is_turn) {
...
@@ -1052,7 +1052,7 @@ void ConvImageCompute::Conv2d5x5(bool is_turn) {
status
=
kernel
.
setArg
(
++
arg_idx
,
output_height
);
status
=
kernel
.
setArg
(
++
arg_idx
,
output_height
);
CL_CHECK_FATAL
(
status
);
CL_CHECK_FATAL
(
status
);
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
// VLOG(4) << "out_image: " << out_image;
// VLOG(4) << "out_image: " << out_image;
VLOG
(
4
)
<<
"global_work_size_[3D]: {"
<<
global_work_size_
[
0
]
<<
","
VLOG
(
4
)
<<
"global_work_size_[3D]: {"
<<
global_work_size_
[
0
]
<<
","
<<
global_work_size_
[
1
]
<<
","
<<
global_work_size_
[
2
]
<<
"}"
;
<<
global_work_size_
[
1
]
<<
","
<<
global_work_size_
[
2
]
<<
"}"
;
...
@@ -1103,7 +1103,7 @@ void ConvImageCompute::Conv2d5x5opt(bool is_turn) {
...
@@ -1103,7 +1103,7 @@ void ConvImageCompute::Conv2d5x5opt(bool is_turn) {
has_bias
&&
param
.
output
->
dims
()
==
param
.
bias
->
dims
();
has_bias
&&
param
.
output
->
dims
()
==
param
.
bias
->
dims
();
// default_work_size[2] = h_blk;
// default_work_size[2] = h_blk;
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"============ conv2d params ============"
;
VLOG
(
4
)
<<
"============ conv2d params ============"
;
// VLOG(4) << "input_image_shape: " << input_image_shape["width"] << ","
// VLOG(4) << "input_image_shape: " << input_image_shape["width"] << ","
// << input_image_shape["height"];
// << input_image_shape["height"];
...
@@ -1223,7 +1223,7 @@ void ConvImageCompute::Conv2d7x7(bool is_turn) {
...
@@ -1223,7 +1223,7 @@ void ConvImageCompute::Conv2d7x7(bool is_turn) {
int
input_c
=
input_dims
[
1
];
int
input_c
=
input_dims
[
1
];
auto
dilations
=
*
param
.
dilations
;
auto
dilations
=
*
param
.
dilations
;
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"============ conv2d params ============"
;
VLOG
(
4
)
<<
"============ conv2d params ============"
;
VLOG
(
4
)
<<
"input_image_shape: "
<<
input_image_shape
[
"width"
]
<<
","
VLOG
(
4
)
<<
"input_image_shape: "
<<
input_image_shape
[
"width"
]
<<
","
<<
input_image_shape
[
"height"
];
<<
input_image_shape
[
"height"
];
...
@@ -1273,7 +1273,7 @@ void ConvImageCompute::Conv2d7x7(bool is_turn) {
...
@@ -1273,7 +1273,7 @@ void ConvImageCompute::Conv2d7x7(bool is_turn) {
status
=
kernel
.
setArg
(
++
arg_idx
,
*
filter_image
);
status
=
kernel
.
setArg
(
++
arg_idx
,
*
filter_image
);
CL_CHECK_FATAL
(
status
);
CL_CHECK_FATAL
(
status
);
if
(
has_bias
)
{
if
(
has_bias
)
{
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"set bias_image: "
;
VLOG
(
4
)
<<
"set bias_image: "
;
#endif
#endif
status
=
kernel
.
setArg
(
++
arg_idx
,
*
bias_image
);
status
=
kernel
.
setArg
(
++
arg_idx
,
*
bias_image
);
...
@@ -1300,7 +1300,7 @@ void ConvImageCompute::Conv2d7x7(bool is_turn) {
...
@@ -1300,7 +1300,7 @@ void ConvImageCompute::Conv2d7x7(bool is_turn) {
status
=
kernel
.
setArg
(
++
arg_idx
,
output_height
);
status
=
kernel
.
setArg
(
++
arg_idx
,
output_height
);
CL_CHECK_FATAL
(
status
);
CL_CHECK_FATAL
(
status
);
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
// VLOG(4) << "out_image: " << out_image;
// VLOG(4) << "out_image: " << out_image;
VLOG
(
4
)
<<
"global_work_size_[3D]: {"
<<
global_work_size_
[
0
]
<<
","
VLOG
(
4
)
<<
"global_work_size_[3D]: {"
<<
global_work_size_
[
0
]
<<
","
<<
global_work_size_
[
1
]
<<
","
<<
global_work_size_
[
2
]
<<
"}"
;
<<
global_work_size_
[
1
]
<<
","
<<
global_work_size_
[
2
]
<<
"}"
;
...
@@ -1349,7 +1349,7 @@ void ConvImageCompute::Conv2d7x7opt(bool is_turn) {
...
@@ -1349,7 +1349,7 @@ void ConvImageCompute::Conv2d7x7opt(bool is_turn) {
const
bool
is_element_wise_bias
=
const
bool
is_element_wise_bias
=
has_bias
&&
param
.
output
->
dims
()
==
param
.
bias
->
dims
();
has_bias
&&
param
.
output
->
dims
()
==
param
.
bias
->
dims
();
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"============ conv2d 7x7 params ============"
;
VLOG
(
4
)
<<
"============ conv2d 7x7 params ============"
;
// VLOG(4) << "input_image_shape: " << input_image_shape["width"] << ","
// VLOG(4) << "input_image_shape: " << input_image_shape["width"] << ","
// << input_image_shape["height"];
// << input_image_shape["height"];
...
@@ -1479,7 +1479,7 @@ void ConvImageCompute::DepthwiseConv2d3x3s1(bool is_turn) {
...
@@ -1479,7 +1479,7 @@ void ConvImageCompute::DepthwiseConv2d3x3s1(bool is_turn) {
const
cl
::
Image2D
*
bias_image
=
nullptr
;
const
cl
::
Image2D
*
bias_image
=
nullptr
;
if
(
has_bias
)
{
if
(
has_bias
)
{
bias_image
=
bias_gpu_image_
->
data
<
half_t
,
cl
::
Image2D
>
();
bias_image
=
bias_gpu_image_
->
data
<
half_t
,
cl
::
Image2D
>
();
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"set bias_image: "
;
VLOG
(
4
)
<<
"set bias_image: "
;
#endif
#endif
status
=
kernel
.
setArg
(
++
arg_idx
,
*
bias_image
);
status
=
kernel
.
setArg
(
++
arg_idx
,
*
bias_image
);
...
@@ -1546,7 +1546,7 @@ void ConvImageCompute::DepthwiseConv2d3x3(bool is_turn) {
...
@@ -1546,7 +1546,7 @@ void ConvImageCompute::DepthwiseConv2d3x3(bool is_turn) {
auto
kernel
=
kernel_
;
auto
kernel
=
kernel_
;
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"setArg"
;
VLOG
(
4
)
<<
"setArg"
;
VLOG
(
4
)
<<
"strides = "
<<
strides
[
0
];
VLOG
(
4
)
<<
"strides = "
<<
strides
[
0
];
VLOG
(
4
)
<<
"offset = "
<<
offset
;
VLOG
(
4
)
<<
"offset = "
<<
offset
;
...
@@ -1576,7 +1576,7 @@ void ConvImageCompute::DepthwiseConv2d3x3(bool is_turn) {
...
@@ -1576,7 +1576,7 @@ void ConvImageCompute::DepthwiseConv2d3x3(bool is_turn) {
const
cl
::
Image2D
*
bias_image
=
nullptr
;
const
cl
::
Image2D
*
bias_image
=
nullptr
;
if
(
has_bias
)
{
if
(
has_bias
)
{
bias_image
=
bias_gpu_image_
->
data
<
half_t
,
cl
::
Image2D
>
();
bias_image
=
bias_gpu_image_
->
data
<
half_t
,
cl
::
Image2D
>
();
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"set bias_image: "
;
VLOG
(
4
)
<<
"set bias_image: "
;
#endif
#endif
status
=
kernel
.
setArg
(
++
arg_idx
,
*
bias_image
);
status
=
kernel
.
setArg
(
++
arg_idx
,
*
bias_image
);
...
@@ -1649,7 +1649,7 @@ void ConvImageCompute::DepthwiseConv2d(bool is_turn) {
...
@@ -1649,7 +1649,7 @@ void ConvImageCompute::DepthwiseConv2d(bool is_turn) {
int
input_c
=
input_dims
[
1
];
int
input_c
=
input_dims
[
1
];
auto
dilations
=
*
param
.
dilations
;
auto
dilations
=
*
param
.
dilations
;
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"============ depthwise conv2d params ============"
;
VLOG
(
4
)
<<
"============ depthwise conv2d params ============"
;
VLOG
(
4
)
<<
"input_image_shape: "
<<
input_image_shape
[
"width"
]
<<
","
VLOG
(
4
)
<<
"input_image_shape: "
<<
input_image_shape
[
"width"
]
<<
","
<<
input_image_shape
[
"height"
];
<<
input_image_shape
[
"height"
];
...
@@ -1700,7 +1700,7 @@ void ConvImageCompute::DepthwiseConv2d(bool is_turn) {
...
@@ -1700,7 +1700,7 @@ void ConvImageCompute::DepthwiseConv2d(bool is_turn) {
status
=
kernel
.
setArg
(
++
arg_idx
,
*
filter_image
);
status
=
kernel
.
setArg
(
++
arg_idx
,
*
filter_image
);
CL_CHECK_FATAL
(
status
);
CL_CHECK_FATAL
(
status
);
if
(
has_bias
)
{
if
(
has_bias
)
{
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"set bias_image: "
;
VLOG
(
4
)
<<
"set bias_image: "
;
#endif
#endif
status
=
kernel
.
setArg
(
++
arg_idx
,
*
bias_image
);
status
=
kernel
.
setArg
(
++
arg_idx
,
*
bias_image
);
...
@@ -1731,7 +1731,7 @@ void ConvImageCompute::DepthwiseConv2d(bool is_turn) {
...
@@ -1731,7 +1731,7 @@ void ConvImageCompute::DepthwiseConv2d(bool is_turn) {
status
=
kernel
.
setArg
(
++
arg_idx
,
filter_height
);
status
=
kernel
.
setArg
(
++
arg_idx
,
filter_height
);
CL_CHECK_FATAL
(
status
);
CL_CHECK_FATAL
(
status
);
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"global_work_size_[3D]: {"
<<
global_work_size_
[
0
]
<<
","
VLOG
(
4
)
<<
"global_work_size_[3D]: {"
<<
global_work_size_
[
0
]
<<
","
<<
global_work_size_
[
1
]
<<
","
<<
global_work_size_
[
2
]
<<
"}"
;
<<
global_work_size_
[
1
]
<<
","
<<
global_work_size_
[
2
]
<<
"}"
;
#endif
#endif
...
...
lite/kernels/opencl/elementwise_add_buffer_compute.cc
浏览文件 @
3a959784
...
@@ -43,7 +43,7 @@ void ElementwiseAddCompute::Run() {
...
@@ -43,7 +43,7 @@ void ElementwiseAddCompute::Run() {
STL
::
stringstream
kernel_key
;
STL
::
stringstream
kernel_key
;
kernel_key
<<
kernel_func_name_
<<
build_options_
<<
time_stamp_
;
kernel_key
<<
kernel_func_name_
<<
build_options_
<<
time_stamp_
;
auto
kernel
=
context
.
cl_context
()
->
GetKernel
(
kernel_key
.
str
());
auto
kernel
=
context
.
cl_context
()
->
GetKernel
(
kernel_key
.
str
());
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
TargetToStr
(
ele_param_
->
X
->
target
());
VLOG
(
4
)
<<
TargetToStr
(
ele_param_
->
X
->
target
());
VLOG
(
4
)
<<
TargetToStr
(
ele_param_
->
Y
->
target
());
VLOG
(
4
)
<<
TargetToStr
(
ele_param_
->
Y
->
target
());
VLOG
(
4
)
<<
TargetToStr
(
ele_param_
->
Out
->
target
());
VLOG
(
4
)
<<
TargetToStr
(
ele_param_
->
Out
->
target
());
...
@@ -86,7 +86,7 @@ void ElementwiseAddCompute::UpdateParams() {
...
@@ -86,7 +86,7 @@ void ElementwiseAddCompute::UpdateParams() {
for
(
int
i
=
static_cast
<
int
>
(
y_dims
.
size
()
+
axis
);
i
<
x_dims
.
size
();
++
i
)
{
for
(
int
i
=
static_cast
<
int
>
(
y_dims
.
size
()
+
axis
);
i
<
x_dims
.
size
();
++
i
)
{
num_
*=
x_dims
[
i
];
num_
*=
x_dims
[
i
];
}
}
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"axis: "
<<
axis
;
VLOG
(
4
)
<<
"axis: "
<<
axis
;
VLOG
(
4
)
<<
"batch: "
<<
batch_
;
VLOG
(
4
)
<<
"batch: "
<<
batch_
;
VLOG
(
4
)
<<
"channels: "
<<
channels_
;
VLOG
(
4
)
<<
"channels: "
<<
channels_
;
...
...
lite/kernels/opencl/elementwise_add_image_compute.cc
浏览文件 @
3a959784
...
@@ -83,7 +83,7 @@ void ElementwiseAddImageCompute::ReInitWhenNeeded() {
...
@@ -83,7 +83,7 @@ void ElementwiseAddImageCompute::ReInitWhenNeeded() {
void
ElementwiseAddImageCompute
::
GetGlobalWorkSize
()
{
void
ElementwiseAddImageCompute
::
GetGlobalWorkSize
()
{
global_work_size_
=
cl
::
NDRange
{
static_cast
<
cl
::
size_type
>
(
x_img_shape_
[
0
]),
global_work_size_
=
cl
::
NDRange
{
static_cast
<
cl
::
size_type
>
(
x_img_shape_
[
0
]),
static_cast
<
cl
::
size_type
>
(
x_img_shape_
[
1
])};
static_cast
<
cl
::
size_type
>
(
x_img_shape_
[
1
])};
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"global_work_size:[2D]:"
<<
x_img_shape_
[
0
]
<<
" "
VLOG
(
4
)
<<
"global_work_size:[2D]:"
<<
x_img_shape_
[
0
]
<<
" "
<<
x_img_shape_
[
1
];
<<
x_img_shape_
[
1
];
#endif
#endif
...
@@ -102,7 +102,7 @@ void ElementwiseAddImageCompute::Run() {
...
@@ -102,7 +102,7 @@ void ElementwiseAddImageCompute::Run() {
auto
*
out_img
=
out
->
mutable_data
<
half_t
,
cl
::
Image2D
>
(
out_img_shape_
[
0
],
auto
*
out_img
=
out
->
mutable_data
<
half_t
,
cl
::
Image2D
>
(
out_img_shape_
[
0
],
out_img_shape_
[
1
]);
out_img_shape_
[
1
]);
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"x->target():"
<<
TargetToStr
(
x
->
target
());
VLOG
(
4
)
<<
"x->target():"
<<
TargetToStr
(
x
->
target
());
VLOG
(
4
)
<<
"y->target():"
<<
TargetToStr
(
y
->
target
());
VLOG
(
4
)
<<
"y->target():"
<<
TargetToStr
(
y
->
target
());
VLOG
(
4
)
<<
"out->target():"
<<
TargetToStr
(
out
->
target
());
VLOG
(
4
)
<<
"out->target():"
<<
TargetToStr
(
out
->
target
());
...
@@ -129,7 +129,7 @@ void ElementwiseAddImageCompute::Run() {
...
@@ -129,7 +129,7 @@ void ElementwiseAddImageCompute::Run() {
}
else
if
(
y_dims
.
size
()
==
1
)
{
}
else
if
(
y_dims
.
size
()
==
1
)
{
if
(
axis
==
x_dims
.
size
()
-
1
||
axis
==
x_dims
.
size
()
-
3
)
{
if
(
axis
==
x_dims
.
size
()
-
1
||
axis
==
x_dims
.
size
()
-
3
)
{
const
int
tensor_w
=
x_dims
[
x_dims
.
size
()
-
1
];
const
int
tensor_w
=
x_dims
[
x_dims
.
size
()
-
1
];
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"tensor_w:"
<<
tensor_w
;
VLOG
(
4
)
<<
"tensor_w:"
<<
tensor_w
;
#endif
#endif
status
=
kernel
.
setArg
(
0
,
*
x_img
);
status
=
kernel
.
setArg
(
0
,
*
x_img
);
...
...
lite/kernels/opencl/elementwise_mul_image_compute.cc
浏览文件 @
3a959784
...
@@ -85,7 +85,7 @@ class ElementwiseMulImageCompute
...
@@ -85,7 +85,7 @@ class ElementwiseMulImageCompute
auto
*
y
=
ele_param_
->
Y
;
auto
*
y
=
ele_param_
->
Y
;
auto
*
out
=
ele_param_
->
Out
;
auto
*
out
=
ele_param_
->
Out
;
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"x->target():"
<<
TargetToStr
(
x
->
target
());
VLOG
(
4
)
<<
"x->target():"
<<
TargetToStr
(
x
->
target
());
VLOG
(
4
)
<<
"y->target():"
<<
TargetToStr
(
y
->
target
());
VLOG
(
4
)
<<
"y->target():"
<<
TargetToStr
(
y
->
target
());
VLOG
(
4
)
<<
"out->target():"
<<
TargetToStr
(
out
->
target
());
VLOG
(
4
)
<<
"out->target():"
<<
TargetToStr
(
out
->
target
());
...
@@ -108,7 +108,7 @@ class ElementwiseMulImageCompute
...
@@ -108,7 +108,7 @@ class ElementwiseMulImageCompute
auto
*
out_img
=
out
->
mutable_data
<
half_t
,
cl
::
Image2D
>
(
out_img_shape
[
0
],
auto
*
out_img
=
out
->
mutable_data
<
half_t
,
cl
::
Image2D
>
(
out_img_shape
[
0
],
out_img_shape
[
1
]);
out_img_shape
[
1
]);
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"x_img_shape[w,h]:"
<<
x_img_width
<<
" "
<<
x_img_height
;
VLOG
(
4
)
<<
"x_img_shape[w,h]:"
<<
x_img_width
<<
" "
<<
x_img_height
;
VLOG
(
4
)
<<
"y_img_shape[w,h]:"
<<
y_img_shape
[
0
]
<<
" "
<<
y_img_shape
[
1
];
VLOG
(
4
)
<<
"y_img_shape[w,h]:"
<<
y_img_shape
[
0
]
<<
" "
<<
y_img_shape
[
1
];
VLOG
(
4
)
<<
"out_img_shape[w,h]:"
<<
out_img_shape
[
0
]
<<
" "
VLOG
(
4
)
<<
"out_img_shape[w,h]:"
<<
out_img_shape
[
0
]
<<
" "
...
@@ -194,7 +194,7 @@ class ElementwiseMulImageCompute
...
@@ -194,7 +194,7 @@ class ElementwiseMulImageCompute
nullptr
,
nullptr
,
nullptr
);
nullptr
);
CL_CHECK_FATAL
(
status
);
CL_CHECK_FATAL
(
status
);
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"global_work_size:[2D]:"
<<
x_img_width
<<
" "
<<
x_img_height
;
VLOG
(
4
)
<<
"global_work_size:[2D]:"
<<
x_img_width
<<
" "
<<
x_img_height
;
#endif
#endif
}
}
...
...
lite/kernels/opencl/elementwise_sub_image_compute.cc
浏览文件 @
3a959784
...
@@ -64,7 +64,7 @@ void ElementwiseSubImageCompute::Run() {
...
@@ -64,7 +64,7 @@ void ElementwiseSubImageCompute::Run() {
auto
*
out
=
ele_param_
->
Out
;
auto
*
out
=
ele_param_
->
Out
;
auto
axis
=
ele_param_
->
axis
;
auto
axis
=
ele_param_
->
axis
;
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"x->target():"
<<
TargetToStr
(
x
->
target
());
VLOG
(
4
)
<<
"x->target():"
<<
TargetToStr
(
x
->
target
());
VLOG
(
4
)
<<
"y->target():"
<<
TargetToStr
(
y
->
target
());
VLOG
(
4
)
<<
"y->target():"
<<
TargetToStr
(
y
->
target
());
VLOG
(
4
)
<<
"out->target():"
<<
TargetToStr
(
out
->
target
());
VLOG
(
4
)
<<
"out->target():"
<<
TargetToStr
(
out
->
target
());
...
@@ -87,7 +87,7 @@ void ElementwiseSubImageCompute::Run() {
...
@@ -87,7 +87,7 @@ void ElementwiseSubImageCompute::Run() {
auto
*
out_img
=
out
->
mutable_data
<
half_t
,
cl
::
Image2D
>
(
out_img_shape
[
0
],
auto
*
out_img
=
out
->
mutable_data
<
half_t
,
cl
::
Image2D
>
(
out_img_shape
[
0
],
out_img_shape
[
1
]);
out_img_shape
[
1
]);
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"x_img_shape[w,h]:"
<<
x_img_width
<<
" "
<<
x_img_height
;
VLOG
(
4
)
<<
"x_img_shape[w,h]:"
<<
x_img_width
<<
" "
<<
x_img_height
;
VLOG
(
4
)
<<
"y_img_shape[w,h]:"
<<
y_img_shape
[
0
]
<<
" "
<<
y_img_shape
[
1
];
VLOG
(
4
)
<<
"y_img_shape[w,h]:"
<<
y_img_shape
[
0
]
<<
" "
<<
y_img_shape
[
1
];
VLOG
(
4
)
<<
"out_img_shape[w,h]:"
<<
out_img_shape
[
0
]
<<
" "
VLOG
(
4
)
<<
"out_img_shape[w,h]:"
<<
out_img_shape
[
0
]
<<
" "
...
@@ -110,7 +110,7 @@ void ElementwiseSubImageCompute::Run() {
...
@@ -110,7 +110,7 @@ void ElementwiseSubImageCompute::Run() {
}
else
if
(
y_dims
.
size
()
==
1
)
{
}
else
if
(
y_dims
.
size
()
==
1
)
{
if
(
axis
==
x
->
dims
().
size
()
-
1
||
axis
==
x
->
dims
().
size
()
-
3
)
{
if
(
axis
==
x
->
dims
().
size
()
-
1
||
axis
==
x
->
dims
().
size
()
-
3
)
{
int
tensor_w
=
x
->
dims
()[
x
->
dims
().
size
()
-
1
];
int
tensor_w
=
x
->
dims
()[
x
->
dims
().
size
()
-
1
];
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"tensor_w:"
<<
tensor_w
;
VLOG
(
4
)
<<
"tensor_w:"
<<
tensor_w
;
#endif
#endif
cl_int
status
=
kernel
.
setArg
(
arg_idx
,
*
x_img
);
cl_int
status
=
kernel
.
setArg
(
arg_idx
,
*
x_img
);
...
@@ -134,7 +134,7 @@ void ElementwiseSubImageCompute::Run() {
...
@@ -134,7 +134,7 @@ void ElementwiseSubImageCompute::Run() {
auto
global_work_size
=
cl
::
NDRange
{
static_cast
<
cl
::
size_type
>
(
x_img_width
),
auto
global_work_size
=
cl
::
NDRange
{
static_cast
<
cl
::
size_type
>
(
x_img_width
),
static_cast
<
cl
::
size_type
>
(
x_img_height
)};
static_cast
<
cl
::
size_type
>
(
x_img_height
)};
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"global_work_size:[2D]:"
<<
x_img_width
<<
" "
<<
x_img_height
;
VLOG
(
4
)
<<
"global_work_size:[2D]:"
<<
x_img_width
<<
" "
<<
x_img_height
;
#endif
#endif
...
...
lite/kernels/opencl/fc_buffer_compute.cc
浏览文件 @
3a959784
...
@@ -52,7 +52,7 @@ class FcCompute
...
@@ -52,7 +52,7 @@ class FcCompute
n_
=
w_dims
[
1
];
n_
=
w_dims
[
1
];
CHECK_EQ
(
k_
,
static_cast
<
int
>
(
w_dims
[
0
]));
CHECK_EQ
(
k_
,
static_cast
<
int
>
(
w_dims
[
0
]));
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"x_dims:"
<<
x_dims
[
0
]
<<
" "
<<
x_dims
[
1
]
<<
" "
<<
x_dims
[
2
]
VLOG
(
4
)
<<
"x_dims:"
<<
x_dims
[
0
]
<<
" "
<<
x_dims
[
1
]
<<
" "
<<
x_dims
[
2
]
<<
" "
<<
x_dims
[
3
];
<<
" "
<<
x_dims
[
3
];
VLOG
(
4
)
<<
"w_dims:"
<<
w_dims
[
0
]
<<
" "
<<
w_dims
[
1
]
<<
" "
<<
w_dims
[
2
]
VLOG
(
4
)
<<
"w_dims:"
<<
w_dims
[
0
]
<<
" "
<<
w_dims
[
1
]
<<
" "
<<
w_dims
[
2
]
...
@@ -66,7 +66,7 @@ class FcCompute
...
@@ -66,7 +66,7 @@ class FcCompute
}
else
{
// gemm
}
else
{
// gemm
kernel_func_name_
=
"fc_gemm_4x4"
;
kernel_func_name_
=
"fc_gemm_4x4"
;
}
}
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
1
)
<<
"kernel_func_name_:"
<<
kernel_func_name_
;
VLOG
(
1
)
<<
"kernel_func_name_:"
<<
kernel_func_name_
;
#endif
#endif
...
...
lite/kernels/opencl/grid_sampler_image_compute.cc
浏览文件 @
3a959784
...
@@ -80,7 +80,7 @@ class GridSamplerImageCompute : public KernelLite<TARGET(kOpenCL),
...
@@ -80,7 +80,7 @@ class GridSamplerImageCompute : public KernelLite<TARGET(kOpenCL),
cl
::
NDRange
{
static_cast
<
cl
::
size_type
>
(
default_work_size
[
0
]),
cl
::
NDRange
{
static_cast
<
cl
::
size_type
>
(
default_work_size
[
0
]),
static_cast
<
cl
::
size_type
>
(
default_work_size
[
1
]),
static_cast
<
cl
::
size_type
>
(
default_work_size
[
1
]),
static_cast
<
cl
::
size_type
>
(
default_work_size
[
2
]
/
4
)};
static_cast
<
cl
::
size_type
>
(
default_work_size
[
2
]
/
4
)};
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"default_work_size: "
<<
default_work_size
[
0
]
<<
", "
VLOG
(
4
)
<<
"default_work_size: "
<<
default_work_size
[
0
]
<<
", "
<<
default_work_size
[
1
]
<<
", "
<<
default_work_size
[
2
];
<<
default_work_size
[
1
]
<<
", "
<<
default_work_size
[
2
];
VLOG
(
4
)
<<
"global_work_size_:[2D]:"
<<
global_work_size_
[
0
]
<<
" "
VLOG
(
4
)
<<
"global_work_size_:[2D]:"
<<
global_work_size_
[
0
]
<<
" "
...
@@ -102,7 +102,7 @@ class GridSamplerImageCompute : public KernelLite<TARGET(kOpenCL),
...
@@ -102,7 +102,7 @@ class GridSamplerImageCompute : public KernelLite<TARGET(kOpenCL),
auto
*
out_img
=
out
->
mutable_data
<
half_t
,
cl
::
Image2D
>
(
out_img_shape_
[
0
],
auto
*
out_img
=
out
->
mutable_data
<
half_t
,
cl
::
Image2D
>
(
out_img_shape_
[
0
],
out_img_shape_
[
1
]);
out_img_shape_
[
1
]);
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
auto
in_dims
=
x
->
dims
();
auto
in_dims
=
x
->
dims
();
VLOG
(
4
)
<<
"x->target():"
<<
TargetToStr
(
x
->
target
());
VLOG
(
4
)
<<
"x->target():"
<<
TargetToStr
(
x
->
target
());
VLOG
(
4
)
<<
"out->target():"
<<
TargetToStr
(
out
->
target
());
VLOG
(
4
)
<<
"out->target():"
<<
TargetToStr
(
out
->
target
());
...
...
lite/kernels/opencl/instance_norm_image_compute.cc
浏览文件 @
3a959784
...
@@ -96,7 +96,7 @@ class InstanceNormImageCompute : public KernelLite<TARGET(kOpenCL),
...
@@ -96,7 +96,7 @@ class InstanceNormImageCompute : public KernelLite<TARGET(kOpenCL),
static_cast
<
cl
::
size_type
>
(
lws1
),
static_cast
<
cl
::
size_type
>
(
lws1
),
static_cast
<
cl
::
size_type
>
(
lws2
)};
static_cast
<
cl
::
size_type
>
(
lws2
)};
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"global_work_size:"
<<
static_cast
<
int
>
(
global_work_size
[
0
])
VLOG
(
4
)
<<
"global_work_size:"
<<
static_cast
<
int
>
(
global_work_size
[
0
])
<<
" "
<<
static_cast
<
int
>
(
global_work_size
[
1
])
<<
" "
<<
" "
<<
static_cast
<
int
>
(
global_work_size
[
1
])
<<
" "
<<
static_cast
<
int
>
(
global_work_size
[
2
]);
<<
static_cast
<
int
>
(
global_work_size
[
2
]);
...
@@ -200,7 +200,7 @@ class InstanceNormImageCompute : public KernelLite<TARGET(kOpenCL),
...
@@ -200,7 +200,7 @@ class InstanceNormImageCompute : public KernelLite<TARGET(kOpenCL),
int
in_h
=
in_dims
[
2
];
int
in_h
=
in_dims
[
2
];
int
in_w
=
in_dims
[
3
];
int
in_w
=
in_dims
[
3
];
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"x->target():"
<<
TargetToStr
(
x
->
target
());
VLOG
(
4
)
<<
"x->target():"
<<
TargetToStr
(
x
->
target
());
VLOG
(
4
)
<<
"out->target():"
<<
TargetToStr
(
out
->
target
());
VLOG
(
4
)
<<
"out->target():"
<<
TargetToStr
(
out
->
target
());
VLOG
(
4
)
<<
"x->dims():"
<<
in_dims
;
VLOG
(
4
)
<<
"x->dims():"
<<
in_dims
;
...
@@ -211,7 +211,7 @@ class InstanceNormImageCompute : public KernelLite<TARGET(kOpenCL),
...
@@ -211,7 +211,7 @@ class InstanceNormImageCompute : public KernelLite<TARGET(kOpenCL),
auto
*
out_img
=
out
->
mutable_data
<
half_t
,
cl
::
Image2D
>
(
auto
*
out_img
=
out
->
mutable_data
<
half_t
,
cl
::
Image2D
>
(
out_image_shape
[
"width"
],
out_image_shape
[
"height"
]);
out_image_shape
[
"width"
],
out_image_shape
[
"height"
]);
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"out_image_shape[w,h]: "
<<
out_image_shape
[
"width"
]
<<
" "
VLOG
(
4
)
<<
"out_image_shape[w,h]: "
<<
out_image_shape
[
"width"
]
<<
" "
<<
out_image_shape
[
"height"
];
<<
out_image_shape
[
"height"
];
...
@@ -229,7 +229,7 @@ class InstanceNormImageCompute : public KernelLite<TARGET(kOpenCL),
...
@@ -229,7 +229,7 @@ class InstanceNormImageCompute : public KernelLite<TARGET(kOpenCL),
static_cast
<
cl
::
size_type
>
(
group_size_y
),
static_cast
<
cl
::
size_type
>
(
group_size_y
),
static_cast
<
cl
::
size_type
>
(
1
)};
static_cast
<
cl
::
size_type
>
(
1
)};
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"local_work_size:[2D]:"
<<
local_work_size
[
0
]
<<
" "
VLOG
(
4
)
<<
"local_work_size:[2D]:"
<<
local_work_size
[
0
]
<<
" "
<<
local_work_size
[
1
]
<<
" "
<<
local_work_size
[
2
];
<<
local_work_size
[
1
]
<<
" "
<<
local_work_size
[
2
];
VLOG
(
4
)
<<
"global_work_size:[2D]:"
<<
global_work_size
[
0
]
<<
" "
VLOG
(
4
)
<<
"global_work_size:[2D]:"
<<
global_work_size
[
0
]
<<
" "
...
...
lite/kernels/opencl/io_copy_buffer_compute.cc
浏览文件 @
3a959784
...
@@ -42,7 +42,7 @@ class IoCopyHostToOpenCLCompute
...
@@ -42,7 +42,7 @@ class IoCopyHostToOpenCLCompute
CHECK
(
param
.
x
->
target
()
==
TARGET
(
kHost
)
||
CHECK
(
param
.
x
->
target
()
==
TARGET
(
kHost
)
||
param
.
x
->
target
()
==
TARGET
(
kARM
));
param
.
x
->
target
()
==
TARGET
(
kARM
));
auto
mem_size
=
param
.
x
->
memory_size
();
auto
mem_size
=
param
.
x
->
memory_size
();
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
2
)
<<
"param.x->memory_size():"
<<
mem_size
;
VLOG
(
2
)
<<
"param.x->memory_size():"
<<
mem_size
;
VLOG
(
2
)
<<
"param.x->dims().size():"
<<
param
.
x
->
dims
().
size
();
VLOG
(
2
)
<<
"param.x->dims().size():"
<<
param
.
x
->
dims
().
size
();
VLOG
(
2
)
<<
"param.x->dims():"
<<
param
.
x
->
dims
();
VLOG
(
2
)
<<
"param.x->dims():"
<<
param
.
x
->
dims
();
...
@@ -87,7 +87,7 @@ class IoCopykOpenCLToHostCompute
...
@@ -87,7 +87,7 @@ class IoCopykOpenCLToHostCompute
CHECK
(
param
.
x
->
target
()
==
TARGET
(
kOpenCL
));
CHECK
(
param
.
x
->
target
()
==
TARGET
(
kOpenCL
));
auto
mem_size
=
param
.
x
->
memory_size
();
auto
mem_size
=
param
.
x
->
memory_size
();
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
2
)
<<
"copy size "
<<
mem_size
;
VLOG
(
2
)
<<
"copy size "
<<
mem_size
;
VLOG
(
2
)
<<
"param.x->dims().size():"
<<
param
.
x
->
dims
().
size
();
VLOG
(
2
)
<<
"param.x->dims().size():"
<<
param
.
x
->
dims
().
size
();
VLOG
(
2
)
<<
"param.x->dims():"
<<
param
.
x
->
dims
();
VLOG
(
2
)
<<
"param.x->dims():"
<<
param
.
x
->
dims
();
...
@@ -106,7 +106,7 @@ class IoCopykOpenCLToHostCompute
...
@@ -106,7 +106,7 @@ class IoCopykOpenCLToHostCompute
auto
&
context
=
ctx_
->
As
<
OpenCLContext
>
();
auto
&
context
=
ctx_
->
As
<
OpenCLContext
>
();
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
2
)
<<
"--- Find the sync event for the target cl tensor. ---"
;
VLOG
(
2
)
<<
"--- Find the sync event for the target cl tensor. ---"
;
#endif
#endif
CLRuntime
::
Global
()
->
command_queue
().
finish
();
CLRuntime
::
Global
()
->
command_queue
().
finish
();
...
...
lite/kernels/opencl/layout_image_compute.cc
浏览文件 @
3a959784
...
@@ -76,7 +76,7 @@ class LayoutComputeBufferChwToImageDefault
...
@@ -76,7 +76,7 @@ class LayoutComputeBufferChwToImageDefault
const
int
Stride1
=
out_H
*
out_W
;
const
int
Stride1
=
out_H
*
out_W
;
const
int
Stride0
=
out_W
;
const
int
Stride0
=
out_W
;
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
2
)
<<
"param.process_type:"
<<
param
.
process_type
;
VLOG
(
2
)
<<
"param.process_type:"
<<
param
.
process_type
;
VLOG
(
2
)
<<
"x_dims:"
<<
x_dims
;
VLOG
(
2
)
<<
"x_dims:"
<<
x_dims
;
VLOG
(
2
)
<<
"param.x->memory_size():"
<<
param
.
x
->
memory_size
();
VLOG
(
2
)
<<
"param.x->memory_size():"
<<
param
.
x
->
memory_size
();
...
@@ -118,7 +118,7 @@ class LayoutComputeBufferChwToImageDefault
...
@@ -118,7 +118,7 @@ class LayoutComputeBufferChwToImageDefault
status
=
kernel
.
setArg
(
++
arg_idx
,
static_cast
<
const
int
>
(
Stride2
));
status
=
kernel
.
setArg
(
++
arg_idx
,
static_cast
<
const
int
>
(
Stride2
));
CL_CHECK_FATAL
(
status
);
CL_CHECK_FATAL
(
status
);
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
2
)
<<
"gws:[3D]"
<<
((
new_dims
[
1
]
+
3
)
/
4
)
<<
" "
<<
new_dims
[
3
]
VLOG
(
2
)
<<
"gws:[3D]"
<<
((
new_dims
[
1
]
+
3
)
/
4
)
<<
" "
<<
new_dims
[
3
]
<<
" "
<<
(
new_dims
[
0
]
*
new_dims
[
2
]);
<<
" "
<<
(
new_dims
[
0
]
*
new_dims
[
2
]);
#endif
#endif
...
@@ -186,7 +186,7 @@ class LayoutComputeImageDefaultToBufferChw
...
@@ -186,7 +186,7 @@ class LayoutComputeImageDefaultToBufferChw
new_dims
[
4
-
x_dims
.
size
()
+
j
]
=
x_dims
[
j
];
new_dims
[
4
-
x_dims
.
size
()
+
j
]
=
x_dims
[
j
];
}
}
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
2
)
<<
"param.process_type:"
<<
param
.
process_type
;
VLOG
(
2
)
<<
"param.process_type:"
<<
param
.
process_type
;
VLOG
(
2
)
<<
"x_dims:"
<<
x_dims
;
VLOG
(
2
)
<<
"x_dims:"
<<
x_dims
;
VLOG
(
2
)
<<
"param.x->memory_size():"
<<
param
.
x
->
memory_size
();
VLOG
(
2
)
<<
"param.x->memory_size():"
<<
param
.
x
->
memory_size
();
...
@@ -228,7 +228,7 @@ class LayoutComputeImageDefaultToBufferChw
...
@@ -228,7 +228,7 @@ class LayoutComputeImageDefaultToBufferChw
CL_CHECK_FATAL
(
status
);
CL_CHECK_FATAL
(
status
);
status
=
kernel
.
setArg
(
++
arg_idx
,
static_cast
<
const
int
>
(
C
));
status
=
kernel
.
setArg
(
++
arg_idx
,
static_cast
<
const
int
>
(
C
));
CL_CHECK_FATAL
(
status
);
CL_CHECK_FATAL
(
status
);
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
2
)
<<
"gws:[3D]"
<<
((
new_dims
[
1
]
+
3
)
/
4
)
<<
" "
<<
new_dims
[
3
]
VLOG
(
2
)
<<
"gws:[3D]"
<<
((
new_dims
[
1
]
+
3
)
/
4
)
<<
" "
<<
new_dims
[
3
]
<<
" "
<<
(
new_dims
[
0
]
*
new_dims
[
2
]);
<<
" "
<<
(
new_dims
[
0
]
*
new_dims
[
2
]);
#endif
#endif
...
...
lite/kernels/opencl/lrn_image_compute.cc
浏览文件 @
3a959784
...
@@ -65,7 +65,7 @@ class LrnImageCompute : public KernelLite<TARGET(kOpenCL),
...
@@ -65,7 +65,7 @@ class LrnImageCompute : public KernelLite<TARGET(kOpenCL),
auto
out_dims
=
out
->
dims
();
auto
out_dims
=
out
->
dims
();
auto
in_dims
=
x
->
dims
();
auto
in_dims
=
x
->
dims
();
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"x->target(): "
<<
TargetToStr
(
x
->
target
());
VLOG
(
4
)
<<
"x->target(): "
<<
TargetToStr
(
x
->
target
());
VLOG
(
4
)
<<
"out->target(): "
<<
TargetToStr
(
out
->
target
());
VLOG
(
4
)
<<
"out->target(): "
<<
TargetToStr
(
out
->
target
());
VLOG
(
4
)
<<
"x->dims(): "
<<
in_dims
;
VLOG
(
4
)
<<
"x->dims(): "
<<
in_dims
;
...
@@ -84,7 +84,7 @@ class LrnImageCompute : public KernelLite<TARGET(kOpenCL),
...
@@ -84,7 +84,7 @@ class LrnImageCompute : public KernelLite<TARGET(kOpenCL),
auto
*
out_img
=
out
->
mutable_data
<
half_t
,
cl
::
Image2D
>
(
auto
*
out_img
=
out
->
mutable_data
<
half_t
,
cl
::
Image2D
>
(
out_image_shape
[
"width"
],
out_image_shape
[
"height"
]);
out_image_shape
[
"width"
],
out_image_shape
[
"height"
]);
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
// VLOG(4) << "out_image" << out_img;
// VLOG(4) << "out_image" << out_img;
VLOG
(
4
)
<<
"out_image_shape[w,h]:"
<<
out_image_shape
[
"width"
]
<<
" "
VLOG
(
4
)
<<
"out_image_shape[w,h]:"
<<
out_image_shape
[
"width"
]
<<
" "
<<
out_image_shape
[
"height"
];
<<
out_image_shape
[
"height"
];
...
@@ -102,7 +102,7 @@ class LrnImageCompute : public KernelLite<TARGET(kOpenCL),
...
@@ -102,7 +102,7 @@ class LrnImageCompute : public KernelLite<TARGET(kOpenCL),
DDim
(
std
::
vector
<
DDim
::
value_type
>
{
DDim
(
std
::
vector
<
DDim
::
value_type
>
{
static_cast
<
int64_t
>
(
out_image_shape
[
"width"
]),
static_cast
<
int64_t
>
(
out_image_shape
[
"width"
]),
static_cast
<
int64_t
>
(
out_image_shape
[
"height"
])}));
static_cast
<
int64_t
>
(
out_image_shape
[
"height"
])}));
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"default_work_size: "
<<
default_work_size
[
0
]
<<
", "
VLOG
(
4
)
<<
"default_work_size: "
<<
default_work_size
[
0
]
<<
", "
<<
default_work_size
[
1
]
<<
", "
<<
default_work_size
[
3
];
<<
default_work_size
[
1
]
<<
", "
<<
default_work_size
[
3
];
#endif
#endif
...
@@ -136,7 +136,7 @@ class LrnImageCompute : public KernelLite<TARGET(kOpenCL),
...
@@ -136,7 +136,7 @@ class LrnImageCompute : public KernelLite<TARGET(kOpenCL),
nullptr
,
nullptr
,
nullptr
);
nullptr
);
CL_CHECK_FATAL
(
status
);
CL_CHECK_FATAL
(
status
);
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"global_work_size:[2D]:"
<<
global_work_size
[
0
]
<<
" "
VLOG
(
4
)
<<
"global_work_size:[2D]:"
<<
global_work_size
[
0
]
<<
" "
<<
global_work_size
[
1
]
<<
" "
<<
global_work_size
[
2
];
<<
global_work_size
[
1
]
<<
" "
<<
global_work_size
[
2
];
#endif
#endif
...
...
lite/kernels/opencl/nearest_interp_image_compute.cc
浏览文件 @
3a959784
...
@@ -89,7 +89,7 @@ class NearestInterpComputeImageDefault
...
@@ -89,7 +89,7 @@ class NearestInterpComputeImageDefault
status
=
kernel
.
setArg
(
++
arg_idx
,
static_cast
<
const
int
>
(
out_dims_w
));
status
=
kernel
.
setArg
(
++
arg_idx
,
static_cast
<
const
int
>
(
out_dims_w
));
CL_CHECK_FATAL
(
status
);
CL_CHECK_FATAL
(
status
);
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
TargetToStr
(
param
.
X
->
target
());
VLOG
(
4
)
<<
TargetToStr
(
param
.
X
->
target
());
VLOG
(
4
)
<<
TargetToStr
(
param
.
Out
->
target
());
VLOG
(
4
)
<<
TargetToStr
(
param
.
Out
->
target
());
VLOG
(
4
)
<<
"out_image_shape(w,h):"
<<
out_image_shape
[
"width"
]
<<
" "
VLOG
(
4
)
<<
"out_image_shape(w,h):"
<<
out_image_shape
[
"width"
]
<<
" "
...
...
lite/kernels/opencl/pad2d_image_compute.cc
浏览文件 @
3a959784
...
@@ -73,7 +73,7 @@ class Pad2dCompute : public KernelLite<TARGET(kOpenCL),
...
@@ -73,7 +73,7 @@ class Pad2dCompute : public KernelLite<TARGET(kOpenCL),
int
out_h
=
out_dims
[
2
];
int
out_h
=
out_dims
[
2
];
int
out_w
=
out_dims
[
3
];
int
out_w
=
out_dims
[
3
];
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"x->target():"
<<
TargetToStr
(
x
->
target
());
VLOG
(
4
)
<<
"x->target():"
<<
TargetToStr
(
x
->
target
());
VLOG
(
4
)
<<
"out->target():"
<<
TargetToStr
(
out
->
target
());
VLOG
(
4
)
<<
"out->target():"
<<
TargetToStr
(
out
->
target
());
VLOG
(
4
)
<<
"x->dims():"
<<
in_dims
;
VLOG
(
4
)
<<
"x->dims():"
<<
in_dims
;
...
@@ -86,7 +86,7 @@ class Pad2dCompute : public KernelLite<TARGET(kOpenCL),
...
@@ -86,7 +86,7 @@ class Pad2dCompute : public KernelLite<TARGET(kOpenCL),
auto
*
out_img
=
out
->
mutable_data
<
half_t
,
cl
::
Image2D
>
(
auto
*
out_img
=
out
->
mutable_data
<
half_t
,
cl
::
Image2D
>
(
out_image_shape
[
"width"
],
out_image_shape
[
"height"
]);
out_image_shape
[
"width"
],
out_image_shape
[
"height"
]);
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"out_image_shape[w,h]: "
<<
out_image_shape
[
"width"
]
<<
" "
VLOG
(
4
)
<<
"out_image_shape[w,h]: "
<<
out_image_shape
[
"width"
]
<<
" "
<<
out_image_shape
[
"height"
];
<<
out_image_shape
[
"height"
];
...
@@ -104,7 +104,7 @@ class Pad2dCompute : public KernelLite<TARGET(kOpenCL),
...
@@ -104,7 +104,7 @@ class Pad2dCompute : public KernelLite<TARGET(kOpenCL),
DDim
(
std
::
vector
<
DDim
::
value_type
>
{
DDim
(
std
::
vector
<
DDim
::
value_type
>
{
static_cast
<
int64_t
>
(
out_image_shape
[
"width"
]),
static_cast
<
int64_t
>
(
out_image_shape
[
"width"
]),
static_cast
<
int64_t
>
(
out_image_shape
[
"height"
])}));
static_cast
<
int64_t
>
(
out_image_shape
[
"height"
])}));
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"default_work_size: "
<<
default_work_size
[
0
]
<<
", "
VLOG
(
4
)
<<
"default_work_size: "
<<
default_work_size
[
0
]
<<
", "
<<
default_work_size
[
1
]
<<
", "
<<
default_work_size
[
2
];
<<
default_work_size
[
1
]
<<
", "
<<
default_work_size
[
2
];
#endif
#endif
...
@@ -150,7 +150,7 @@ class Pad2dCompute : public KernelLite<TARGET(kOpenCL),
...
@@ -150,7 +150,7 @@ class Pad2dCompute : public KernelLite<TARGET(kOpenCL),
nullptr
,
nullptr
,
nullptr
);
nullptr
);
CL_CHECK_FATAL
(
status
);
CL_CHECK_FATAL
(
status
);
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"global_work_size:[2D]:"
<<
global_work_size
[
0
]
<<
" "
VLOG
(
4
)
<<
"global_work_size:[2D]:"
<<
global_work_size
[
0
]
<<
" "
<<
global_work_size
[
1
]
<<
" "
<<
global_work_size
[
2
];
<<
global_work_size
[
1
]
<<
" "
<<
global_work_size
[
2
];
#endif
#endif
...
...
lite/kernels/opencl/pool_image_compute.cc
浏览文件 @
3a959784
...
@@ -60,7 +60,7 @@ class PoolComputeImage2D : public KernelLite<TARGET(kOpenCL),
...
@@ -60,7 +60,7 @@ class PoolComputeImage2D : public KernelLite<TARGET(kOpenCL),
std
::
vector
<
int
>
strides
=
param
.
strides
;
std
::
vector
<
int
>
strides
=
param
.
strides
;
std
::
vector
<
int
>
ksize
=
param
.
ksize
;
std
::
vector
<
int
>
ksize
=
param
.
ksize
;
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"global_pooling: "
<<
global_pooling
;
VLOG
(
4
)
<<
"global_pooling: "
<<
global_pooling
;
VLOG
(
4
)
<<
"pooling_type: "
<<
pooling_type
;
VLOG
(
4
)
<<
"pooling_type: "
<<
pooling_type
;
VLOG
(
4
)
<<
"paddings : "
<<
paddings
[
0
]
<<
" "
<<
paddings
[
1
]
<<
" "
VLOG
(
4
)
<<
"paddings : "
<<
paddings
[
0
]
<<
" "
<<
paddings
[
1
]
<<
" "
...
@@ -75,7 +75,7 @@ class PoolComputeImage2D : public KernelLite<TARGET(kOpenCL),
...
@@ -75,7 +75,7 @@ class PoolComputeImage2D : public KernelLite<TARGET(kOpenCL),
}
}
}
}
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"in_dims : ["
<<
in_dims
.
size
()
<<
"]"
<<
in_dims
[
0
]
<<
" "
VLOG
(
4
)
<<
"in_dims : ["
<<
in_dims
.
size
()
<<
"]"
<<
in_dims
[
0
]
<<
" "
<<
in_dims
[
1
]
<<
" "
<<
in_dims
[
2
]
<<
" "
<<
in_dims
[
3
];
<<
in_dims
[
1
]
<<
" "
<<
in_dims
[
2
]
<<
" "
<<
in_dims
[
3
];
VLOG
(
4
)
<<
"out_dims : ["
<<
out_dims
.
size
()
<<
"]"
<<
out_dims
[
0
]
<<
" "
VLOG
(
4
)
<<
"out_dims : ["
<<
out_dims
.
size
()
<<
"]"
<<
out_dims
[
0
]
<<
" "
...
@@ -103,7 +103,7 @@ class PoolComputeImage2D : public KernelLite<TARGET(kOpenCL),
...
@@ -103,7 +103,7 @@ class PoolComputeImage2D : public KernelLite<TARGET(kOpenCL),
// VLOG(4) << "x_image" << x_img;
// VLOG(4) << "x_image" << x_img;
auto
out_image_shape
=
InitImageDimInfoWith
(
out_dims
);
auto
out_image_shape
=
InitImageDimInfoWith
(
out_dims
);
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"out_image_shape = "
<<
out_image_shape
[
"width"
]
<<
" "
VLOG
(
4
)
<<
"out_image_shape = "
<<
out_image_shape
[
"width"
]
<<
" "
<<
out_image_shape
[
"height"
];
<<
out_image_shape
[
"height"
];
#endif
#endif
...
@@ -119,7 +119,7 @@ class PoolComputeImage2D : public KernelLite<TARGET(kOpenCL),
...
@@ -119,7 +119,7 @@ class PoolComputeImage2D : public KernelLite<TARGET(kOpenCL),
int
w
=
out_dims
[
3
];
int
w
=
out_dims
[
3
];
int
nh
=
out_dims
[
0
]
*
out_dims
[
2
];
int
nh
=
out_dims
[
0
]
*
out_dims
[
2
];
auto
global_work_size
=
cl
::
NDRange
(
c_block
,
w
,
nh
);
auto
global_work_size
=
cl
::
NDRange
(
c_block
,
w
,
nh
);
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"global_work_size : ["
<<
3
<<
"]"
<<
c_block
<<
" "
<<
w
VLOG
(
4
)
<<
"global_work_size : ["
<<
3
<<
"]"
<<
c_block
<<
" "
<<
w
<<
" "
<<
nh
<<
" "
;
<<
" "
<<
nh
<<
" "
;
#endif
#endif
...
...
lite/kernels/opencl/reshape_image_compute.cc
浏览文件 @
3a959784
...
@@ -64,7 +64,7 @@ class ReshapeComputeFloatImage : public KernelLite<TARGET(kOpenCL),
...
@@ -64,7 +64,7 @@ class ReshapeComputeFloatImage : public KernelLite<TARGET(kOpenCL),
InitImageDimInfoWith
(
out_dims
);
InitImageDimInfoWith
(
out_dims
);
cl
::
Image2D
*
const
out_image
=
output
->
mutable_data
<
half_t
,
cl
::
Image2D
>
(
cl
::
Image2D
*
const
out_image
=
output
->
mutable_data
<
half_t
,
cl
::
Image2D
>
(
out_image_shape
.
at
(
"width"
),
out_image_shape
.
at
(
"height"
));
out_image_shape
.
at
(
"width"
),
out_image_shape
.
at
(
"height"
));
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"out_dims= "
<<
out_dims
;
VLOG
(
4
)
<<
"out_dims= "
<<
out_dims
;
#endif
#endif
const
std
::
vector
<
size_t
>&
default_work_size
=
DefaultWorkSize
(
const
std
::
vector
<
size_t
>&
default_work_size
=
DefaultWorkSize
(
...
@@ -96,7 +96,7 @@ class ReshapeComputeFloatImage : public KernelLite<TARGET(kOpenCL),
...
@@ -96,7 +96,7 @@ class ReshapeComputeFloatImage : public KernelLite<TARGET(kOpenCL),
int
out_Stride1
=
out_H
*
out_W
;
int
out_Stride1
=
out_H
*
out_W
;
int
out_Stride2
=
out_C
*
out_H
*
out_W
;
int
out_Stride2
=
out_C
*
out_H
*
out_W
;
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
"out_C="
<<
out_C
;
VLOG
(
4
)
<<
"out_C="
<<
out_C
;
VLOG
(
4
)
<<
"out_H="
<<
out_H
;
VLOG
(
4
)
<<
"out_H="
<<
out_H
;
VLOG
(
4
)
<<
"out_W="
<<
out_W
;
VLOG
(
4
)
<<
"out_W="
<<
out_W
;
...
@@ -115,7 +115,7 @@ class ReshapeComputeFloatImage : public KernelLite<TARGET(kOpenCL),
...
@@ -115,7 +115,7 @@ class ReshapeComputeFloatImage : public KernelLite<TARGET(kOpenCL),
kernel_key
<<
kernel_func_name_
<<
build_options_
<<
time_stamp_
;
kernel_key
<<
kernel_func_name_
<<
build_options_
<<
time_stamp_
;
auto
kernel
=
context
.
cl_context
()
->
GetKernel
(
kernel_key
.
str
());
auto
kernel
=
context
.
cl_context
()
->
GetKernel
(
kernel_key
.
str
());
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
VLOG
(
4
)
<<
TargetToStr
(
x
->
target
());
VLOG
(
4
)
<<
TargetToStr
(
x
->
target
());
VLOG
(
4
)
<<
TargetToStr
(
param
.
output
->
target
());
VLOG
(
4
)
<<
TargetToStr
(
param
.
output
->
target
());
#endif
#endif
...
...
lite/tools/build.bat
浏览文件 @
3a959784
...
@@ -11,7 +11,7 @@ set BUILD_DIR=%source_path%
...
@@ -11,7 +11,7 @@ set BUILD_DIR=%source_path%
set
OPTMODEL_DIR
=
""
set
OPTMODEL_DIR
=
""
set
BUILD_TAILOR
=
OFF
set
BUILD_TAILOR
=
OFF
set
BUILD_CV
=
OFF
set
BUILD_CV
=
OFF
set
SHUTDOWN
_LOG
=
ON
set
WITH
_LOG
=
ON
set
THIRDPARTY_TAR
=
https
://paddle
-inference-dist
.bj.bcebos.com/PaddleLite/third
-party
-
05
b862
.tar.gz
set
THIRDPARTY_TAR
=
https
://paddle
-inference-dist
.bj.bcebos.com/PaddleLite/third
-party
-
05
b862
.tar.gz
...
...
lite/tools/build.sh
浏览文件 @
3a959784
...
@@ -21,7 +21,7 @@ BUILD_DIR=$(pwd)
...
@@ -21,7 +21,7 @@ BUILD_DIR=$(pwd)
OPTMODEL_DIR
=
""
OPTMODEL_DIR
=
""
BUILD_TAILOR
=
OFF
BUILD_TAILOR
=
OFF
BUILD_CV
=
OFF
BUILD_CV
=
OFF
SHUTDOWN
_LOG
=
ON
WITH
_LOG
=
ON
BUILD_NPU
=
OFF
BUILD_NPU
=
OFF
NPU_DDK_ROOT
=
"
$(
pwd
)
/ai_ddk_lib/"
# Download HiAI DDK from https://developer.huawei.com/consumer/cn/hiai/
NPU_DDK_ROOT
=
"
$(
pwd
)
/ai_ddk_lib/"
# Download HiAI DDK from https://developer.huawei.com/consumer/cn/hiai/
BUILD_XPU
=
OFF
BUILD_XPU
=
OFF
...
@@ -124,7 +124,7 @@ function make_tiny_publish_so {
...
@@ -124,7 +124,7 @@ function make_tiny_publish_so {
-DWITH_TESTING
=
OFF
\
-DWITH_TESTING
=
OFF
\
-DLITE_WITH_JAVA
=
$BUILD_JAVA
\
-DLITE_WITH_JAVA
=
$BUILD_JAVA
\
-DLITE_WITH_PYTHON
=
$BUILD_PYTHON
\
-DLITE_WITH_PYTHON
=
$BUILD_PYTHON
\
-DLITE_
SHUTDOWN_LOG
=
$SHUTDOWN
_LOG
\
-DLITE_
WITH_LOG
=
$WITH
_LOG
\
-DLITE_ON_TINY_PUBLISH
=
ON
\
-DLITE_ON_TINY_PUBLISH
=
ON
\
-DANDROID_STL_TYPE
=
$android_stl
\
-DANDROID_STL_TYPE
=
$android_stl
\
-DLITE_BUILD_EXTRA
=
$BUILD_EXTRA
\
-DLITE_BUILD_EXTRA
=
$BUILD_EXTRA
\
...
@@ -179,7 +179,7 @@ function make_opencl {
...
@@ -179,7 +179,7 @@ function make_opencl {
-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK
=
ON
\
-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK
=
ON
\
-DWITH_TESTING
=
OFF
\
-DWITH_TESTING
=
OFF
\
-DLITE_BUILD_EXTRA
=
$BUILD_EXTRA
\
-DLITE_BUILD_EXTRA
=
$BUILD_EXTRA
\
-DLITE_
SHUTDOWN_LOG
=
$SHUTDOWN
_LOG
\
-DLITE_
WITH_LOG
=
$WITH
_LOG
\
-DLITE_WITH_CV
=
$BUILD_CV
\
-DLITE_WITH_CV
=
$BUILD_CV
\
-DARM_TARGET_OS
=
$1
-DARM_TARGET_ARCH_ABI
=
$2
-DARM_TARGET_LANG
=
$3
-DARM_TARGET_OS
=
$1
-DARM_TARGET_ARCH_ABI
=
$2
-DARM_TARGET_LANG
=
$3
...
@@ -217,7 +217,7 @@ function make_full_publish_so {
...
@@ -217,7 +217,7 @@ function make_full_publish_so {
-DWITH_TESTING
=
OFF
\
-DWITH_TESTING
=
OFF
\
-DLITE_WITH_JAVA
=
$BUILD_JAVA
\
-DLITE_WITH_JAVA
=
$BUILD_JAVA
\
-DLITE_WITH_PYTHON
=
$BUILD_PYTHON
\
-DLITE_WITH_PYTHON
=
$BUILD_PYTHON
\
-DLITE_
SHUTDOWN_LOG
=
$SHUTDOWN
_LOG
\
-DLITE_
WITH_LOG
=
$WITH
_LOG
\
-DANDROID_STL_TYPE
=
$android_stl
\
-DANDROID_STL_TYPE
=
$android_stl
\
-DLITE_BUILD_EXTRA
=
$BUILD_EXTRA
\
-DLITE_BUILD_EXTRA
=
$BUILD_EXTRA
\
-DLITE_WITH_CV
=
$BUILD_CV
\
-DLITE_WITH_CV
=
$BUILD_CV
\
...
@@ -298,7 +298,7 @@ function make_ios {
...
@@ -298,7 +298,7 @@ function make_ios {
-DLITE_WITH_ARM
=
ON
\
-DLITE_WITH_ARM
=
ON
\
-DWITH_TESTING
=
OFF
\
-DWITH_TESTING
=
OFF
\
-DLITE_WITH_JAVA
=
OFF
\
-DLITE_WITH_JAVA
=
OFF
\
-DLITE_
SHUTDOWN
_LOG
=
ON
\
-DLITE_
WITH
_LOG
=
ON
\
-DLITE_ON_TINY_PUBLISH
=
ON
\
-DLITE_ON_TINY_PUBLISH
=
ON
\
-DLITE_WITH_OPENMP
=
OFF
\
-DLITE_WITH_OPENMP
=
OFF
\
-DWITH_ARM_DOTPROD
=
OFF
\
-DWITH_ARM_DOTPROD
=
OFF
\
...
@@ -402,7 +402,7 @@ function print_usage {
...
@@ -402,7 +402,7 @@ function print_usage {
echo
-e
" ./build.sh --arm_os=<os> --arm_abi=<abi> --arm_lang=<lang> test"
echo
-e
" ./build.sh --arm_os=<os> --arm_abi=<abi> --arm_lang=<lang> test"
echo
echo
echo
-e
"optional argument:"
echo
-e
"optional argument:"
echo
-e
"--
shutdown_log: (OFF|ON); controls whether to shutdown log
, default is ON"
echo
-e
"--
with_log: (OFF|ON); controls whether to print log information
, default is ON"
echo
-e
"--build_extra: (OFF|ON); controls whether to publish extra operators and kernels for (sequence-related model such as OCR or NLP)"
echo
-e
"--build_extra: (OFF|ON); controls whether to publish extra operators and kernels for (sequence-related model such as OCR or NLP)"
echo
-e
"--build_train: (OFF|ON); controls whether to publish training operators and kernels, build_train is only for full_publish library now"
echo
-e
"--build_train: (OFF|ON); controls whether to publish training operators and kernels, build_train is only for full_publish library now"
echo
-e
"--build_python: (OFF|ON); controls whether to publish python api lib (ANDROID and IOS is not supported)"
echo
-e
"--build_python: (OFF|ON); controls whether to publish python api lib (ANDROID and IOS is not supported)"
...
@@ -481,8 +481,8 @@ function main {
...
@@ -481,8 +481,8 @@ function main {
BUILD_TAILOR
=
"
${
i
#*=
}
"
BUILD_TAILOR
=
"
${
i
#*=
}
"
shift
shift
;;
;;
--
shutdown
_log
=
*
)
--
with
_log
=
*
)
SHUTDOWN
_LOG
=
"
${
i
#*=
}
"
WITH
_LOG
=
"
${
i
#*=
}
"
shift
shift
;;
;;
--build_npu
=
*
)
--build_npu
=
*
)
...
...
lite/tools/build_android.sh
浏览文件 @
3a959784
...
@@ -16,7 +16,7 @@ WITH_JAVA=ON
...
@@ -16,7 +16,7 @@ WITH_JAVA=ON
# controls whether to compile cv functions into lib, default is OFF.
# controls whether to compile cv functions into lib, default is OFF.
WITH_CV
=
OFF
WITH_CV
=
OFF
# controls whether to hide log information, default is ON.
# controls whether to hide log information, default is ON.
SHUTDOWN
_LOG
=
ON
WITH
_LOG
=
ON
# options of striping lib according to input model.
# options of striping lib according to input model.
OPTMODEL_DIR
=
""
OPTMODEL_DIR
=
""
WITH_STRIP
=
OFF
WITH_STRIP
=
OFF
...
@@ -144,7 +144,7 @@ function make_tiny_publish_so {
...
@@ -144,7 +144,7 @@ function make_tiny_publish_so {
local
cmake_mutable_options
=
"
local
cmake_mutable_options
=
"
-DLITE_BUILD_EXTRA=
$WITH_EXTRA
\
-DLITE_BUILD_EXTRA=
$WITH_EXTRA
\
-DLITE_
SHUTDOWN_LOG=
$SHUTDOWN
_LOG
\
-DLITE_
WITH_LOG=
$WITH
_LOG
\
-DLITE_BUILD_TAILOR=
$WITH_STRIP
\
-DLITE_BUILD_TAILOR=
$WITH_STRIP
\
-DLITE_OPTMODEL_DIR=
$OPTMODEL_DIR
\
-DLITE_OPTMODEL_DIR=
$OPTMODEL_DIR
\
-DLITE_WITH_JAVA=
$WITH_JAVA
\
-DLITE_WITH_JAVA=
$WITH_JAVA
\
...
@@ -193,7 +193,7 @@ function make_full_publish_so {
...
@@ -193,7 +193,7 @@ function make_full_publish_so {
local
cmake_mutable_options
=
"
local
cmake_mutable_options
=
"
-DLITE_BUILD_EXTRA=
$WITH_EXTRA
\
-DLITE_BUILD_EXTRA=
$WITH_EXTRA
\
-DLITE_
SHUTDOWN_LOG=
$SHUTDOWN
_LOG
\
-DLITE_
WITH_LOG=
$WITH
_LOG
\
-DLITE_BUILD_TAILOR=
$WITH_STRIP
\
-DLITE_BUILD_TAILOR=
$WITH_STRIP
\
-DLITE_OPTMODEL_DIR=
$OPTMODEL_DIR
\
-DLITE_OPTMODEL_DIR=
$OPTMODEL_DIR
\
-DLITE_WITH_JAVA=
$WITH_JAVA
\
-DLITE_WITH_JAVA=
$WITH_JAVA
\
...
@@ -236,7 +236,7 @@ function print_usage {
...
@@ -236,7 +236,7 @@ function print_usage {
echo
-e
"| --android_stl: (c++_static|c++_shared|gnu_static|gnu_shared), default is c++_static |"
echo
-e
"| --android_stl: (c++_static|c++_shared|gnu_static|gnu_shared), default is c++_static |"
echo
-e
"| --with_java: (OFF|ON); controls whether to publish java api lib, default is ON |"
echo
-e
"| --with_java: (OFF|ON); controls whether to publish java api lib, default is ON |"
echo
-e
"| --with_cv: (OFF|ON); controls whether to compile cv functions into lib, default is OFF |"
echo
-e
"| --with_cv: (OFF|ON); controls whether to compile cv functions into lib, default is OFF |"
echo
-e
"| --
shutdown_log: (OFF|ON); controls whether to hide
log information, default is ON |"
echo
-e
"| --
with_log: (OFF|ON); controls whether to print
log information, default is ON |"
echo
-e
"| --with_extra: (OFF|ON); controls whether to publish extra operators and kernels for (sequence-related model such as OCR or NLP) |"
echo
-e
"| --with_extra: (OFF|ON); controls whether to publish extra operators and kernels for (sequence-related model such as OCR or NLP) |"
echo
-e
"| |"
echo
-e
"| |"
echo
-e
"| arguments of striping lib according to input model:(armv8, gcc, c++_static) |"
echo
-e
"| arguments of striping lib according to input model:(armv8, gcc, c++_static) |"
...
@@ -315,8 +315,8 @@ function main {
...
@@ -315,8 +315,8 @@ function main {
shift
shift
;;
;;
# ON or OFF, default ON
# ON or OFF, default ON
--
shutdown
_log
=
*
)
--
with
_log
=
*
)
SHUTDOWN
_LOG
=
"
${
i
#*=
}
"
WITH
_LOG
=
"
${
i
#*=
}
"
shift
shift
;;
;;
# compiling lib which can operate on opencl and cpu.
# compiling lib which can operate on opencl and cpu.
...
...
lite/tools/build_ios.sh
浏览文件 @
3a959784
...
@@ -11,7 +11,7 @@ WITH_EXTRA=OFF
...
@@ -11,7 +11,7 @@ WITH_EXTRA=OFF
# controls whether to compile cv functions into lib, default is OFF.
# controls whether to compile cv functions into lib, default is OFF.
WITH_CV
=
OFF
WITH_CV
=
OFF
# controls whether to hide log information, default is ON.
# controls whether to hide log information, default is ON.
SHUTDOWN
_LOG
=
ON
WITH
_LOG
=
ON
# absolute path of Paddle-Lite.
# absolute path of Paddle-Lite.
workspace
=
$PWD
/
$(
dirname
$0
)
/../../
workspace
=
$PWD
/
$(
dirname
$0
)
/../../
# options of striping lib according to input model.
# options of striping lib according to input model.
...
@@ -67,7 +67,7 @@ function make_ios {
...
@@ -67,7 +67,7 @@ function make_ios {
-DLITE_WITH_OPENMP
=
OFF
\
-DLITE_WITH_OPENMP
=
OFF
\
-DWITH_ARM_DOTPROD
=
OFF
\
-DWITH_ARM_DOTPROD
=
OFF
\
-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK
=
ON
\
-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK
=
ON
\
-DLITE_
SHUTDOWN_LOG
=
$SHUTDOWN
_LOG
\
-DLITE_
WITH_LOG
=
$WITH
_LOG
\
-DLITE_BUILD_TAILOR
=
$WITH_STRIP
\
-DLITE_BUILD_TAILOR
=
$WITH_STRIP
\
-DLITE_OPTMODEL_DIR
=
$OPTMODEL_DIR
\
-DLITE_OPTMODEL_DIR
=
$OPTMODEL_DIR
\
-DARM_TARGET_ARCH_ABI
=
$abi
\
-DARM_TARGET_ARCH_ABI
=
$abi
\
...
@@ -94,7 +94,7 @@ function print_usage {
...
@@ -94,7 +94,7 @@ function print_usage {
echo
-e
"| optional argument: |"
echo
-e
"| optional argument: |"
echo
-e
"| --arm_abi: (armv8|armv7), default is armv8 |"
echo
-e
"| --arm_abi: (armv8|armv7), default is armv8 |"
echo
-e
"| --with_cv: (OFF|ON); controls whether to compile cv functions into lib, default is OFF |"
echo
-e
"| --with_cv: (OFF|ON); controls whether to compile cv functions into lib, default is OFF |"
echo
-e
"| --
shutdown_log: (OFF|ON); controls whether to hide
log information, default is ON |"
echo
-e
"| --
with_log: (OFF|ON); controls whether to print
log information, default is ON |"
echo
-e
"| --with_extra: (OFF|ON); controls whether to publish extra operators and kernels for (sequence-related model such as OCR or NLP) |"
echo
-e
"| --with_extra: (OFF|ON); controls whether to publish extra operators and kernels for (sequence-related model such as OCR or NLP) |"
echo
-e
"| |"
echo
-e
"| |"
echo
-e
"| arguments of striping lib according to input model:(armv8, gcc, c++_static) |"
echo
-e
"| arguments of striping lib according to input model:(armv8, gcc, c++_static) |"
...
@@ -136,8 +136,8 @@ function main {
...
@@ -136,8 +136,8 @@ function main {
WITH_STRIP
=
"
${
i
#*=
}
"
WITH_STRIP
=
"
${
i
#*=
}
"
shift
shift
;;
;;
--
shutdown
_log
=
*
)
--
with
_log
=
*
)
SHUTDOWN
_LOG
=
"
${
i
#*=
}
"
WITH
_LOG
=
"
${
i
#*=
}
"
shift
shift
;;
;;
help
)
help
)
...
...
lite/tools/build_linux.sh
浏览文件 @
3a959784
...
@@ -52,17 +52,13 @@ readonly CMAKE_COMMON_OPTIONS="-DWITH_LITE=ON \
...
@@ -52,17 +52,13 @@ readonly CMAKE_COMMON_OPTIONS="-DWITH_LITE=ON \
-DWITH_TESTING=OFF"
-DWITH_TESTING=OFF"
# mutable options for linux compiling.
# mutable options for linux compiling.
function
init_cmake_mutable_options
{
function
init_cmake_mutable_options
{
SHUTDOWN_LOG
=
ON
if
[
"
$WITH_LOG
"
=
"ON"
]
;
then
SHUTDOWN_LOG
=
OFF
fi
cmake_mutable_options
=
"-DARM_TARGET_ARCH_ABI=
$ARCH
\
cmake_mutable_options
=
"-DARM_TARGET_ARCH_ABI=
$ARCH
\
-DARM_TARGET_LANG=
$TOOLCHAIN
\
-DARM_TARGET_LANG=
$TOOLCHAIN
\
-DLITE_BUILD_EXTRA=
$WITH_EXTRA
\
-DLITE_BUILD_EXTRA=
$WITH_EXTRA
\
-DLITE_WITH_PYTHON=
$WITH_PYTHON
\
-DLITE_WITH_PYTHON=
$WITH_PYTHON
\
-DLITE_WITH_CV=
$WITH_CV
\
-DLITE_WITH_CV=
$WITH_CV
\
-DLITE_
SHUTDOWN_LOG=
$SHUTDOWN
_LOG
\
-DLITE_
WITH_LOG=
$WITH
_LOG
\
-DLITE_BUILD_TAILOR=
$WITH_STRIP
\
-DLITE_BUILD_TAILOR=
$WITH_STRIP
\
-DLITE_OPTMODEL_DIR=
$OPTMODEL_DIR
\
-DLITE_OPTMODEL_DIR=
$OPTMODEL_DIR
\
-DLITE_WITH_OPENCL=
$WITH_OPENCL
\
-DLITE_WITH_OPENCL=
$WITH_OPENCL
\
...
...
lite/tools/build_npu.sh
浏览文件 @
3a959784
...
@@ -11,7 +11,7 @@ TARGET_NAME="test_subgraph_pass" # default target
...
@@ -11,7 +11,7 @@ TARGET_NAME="test_subgraph_pass" # default target
BUILD_EXTRA
=
OFF
# ON(with sequence ops)/OFF
BUILD_EXTRA
=
OFF
# ON(with sequence ops)/OFF
WITH_JAVA
=
ON
# ON(build jar and jni so)/OFF
WITH_JAVA
=
ON
# ON(build jar and jni so)/OFF
WITH_TESTING
=
ON
# ON/OFF
WITH_TESTING
=
ON
# ON/OFF
SHUTDOWN_LOG
=
OFF
# ON(disable logging)/OFF
WITH_LOG
=
ON
# ON(disable logging)/OFF
ON_TINY_PUBLISH
=
OFF
# ON(tiny publish)/OFF(full publish)
ON_TINY_PUBLISH
=
OFF
# ON(tiny publish)/OFF(full publish)
function
print_usage
{
function
print_usage
{
...
@@ -76,7 +76,7 @@ function build_npu {
...
@@ -76,7 +76,7 @@ function build_npu {
fi
fi
if
[[
"
${
ON_TINY_PUBLISH
}
"
==
"ON"
]]
;
then
if
[[
"
${
ON_TINY_PUBLISH
}
"
==
"ON"
]]
;
then
WITH_TESTING
=
OFF
WITH_TESTING
=
OFF
SHUTDOWN_LOG
=
ON
WITH_LOG
=
OFF
publish_dir
=
"tiny_publish"
publish_dir
=
"tiny_publish"
else
else
publish_dir
=
"full_publish"
publish_dir
=
"full_publish"
...
@@ -99,7 +99,7 @@ function build_npu {
...
@@ -99,7 +99,7 @@ function build_npu {
-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK
=
ON
\
-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK
=
ON
\
-DWITH_TESTING
=
${
WITH_TESTING
}
\
-DWITH_TESTING
=
${
WITH_TESTING
}
\
-DLITE_WITH_JAVA
=
${
WITH_JAVA
}
\
-DLITE_WITH_JAVA
=
${
WITH_JAVA
}
\
-DLITE_
SHUTDOWN_LOG
=
${
SHUTDOWN
_LOG
}
\
-DLITE_
WITH_LOG
=
${
WITH
_LOG
}
\
-DLITE_WITH_NPU
=
ON
\
-DLITE_WITH_NPU
=
ON
\
-DLITE_ON_TINY_PUBLISH
=
${
ON_TINY_PUBLISH
}
\
-DLITE_ON_TINY_PUBLISH
=
${
ON_TINY_PUBLISH
}
\
-DANDROID_API_LEVEL
=
24
\
-DANDROID_API_LEVEL
=
24
\
...
...
lite/tools/build_rknpu.sh
浏览文件 @
3a959784
...
@@ -8,8 +8,8 @@ ARM_LANG="gcc" # gcc only yet
...
@@ -8,8 +8,8 @@ ARM_LANG="gcc" # gcc only yet
DDK_ROOT
=
"
$(
pwd
)
/rknpu"
DDK_ROOT
=
"
$(
pwd
)
/rknpu"
TARGET_NAME
=
"test_subgraph_pass"
# default target
TARGET_NAME
=
"test_subgraph_pass"
# default target
BUILD_EXTRA
=
OFF
# ON(with sequence ops)/OFF
BUILD_EXTRA
=
OFF
# ON(with sequence ops)/OFF
WITH_TESTING
=
ON
# ON/OFF
WITH_TESTING
=
ON
# ON/OFF
SHUTDOWN_LOG
=
OFF
# ON(disable logging)/OFF
WITH_LOG
=
ON
# ON(disable logging)/OFF
ON_TINY_PUBLISH
=
OFF
# ON(tiny publish)/OFF(full publish)
ON_TINY_PUBLISH
=
OFF
# ON(tiny publish)/OFF(full publish)
function
print_usage
{
function
print_usage
{
...
@@ -65,7 +65,7 @@ function build_npu {
...
@@ -65,7 +65,7 @@ function build_npu {
local
publish_dir
local
publish_dir
if
[[
"
${
ON_TINY_PUBLISH
}
"
==
"ON"
]]
;
then
if
[[
"
${
ON_TINY_PUBLISH
}
"
==
"ON"
]]
;
then
WITH_TESTING
=
OFF
WITH_TESTING
=
OFF
SHUTDOWN_LOG
=
ON
WITH_LOG
=
OFF
publish_dir
=
"tiny_publish"
publish_dir
=
"tiny_publish"
else
else
publish_dir
=
"full_publish"
publish_dir
=
"full_publish"
...
@@ -89,7 +89,7 @@ function build_npu {
...
@@ -89,7 +89,7 @@ function build_npu {
-DWITH_ARM_DOTPROD
=
ON
\
-DWITH_ARM_DOTPROD
=
ON
\
-DLITE_BUILD_EXTRA
=
${
BUILD_EXTRA
}
\
-DLITE_BUILD_EXTRA
=
${
BUILD_EXTRA
}
\
-DWITH_TESTING
=
${
WITH_TESTING
}
\
-DWITH_TESTING
=
${
WITH_TESTING
}
\
-DLITE_
SHUTDOWN_LOG
=
${
SHUTDOWN
_LOG
}
\
-DLITE_
WITH_LOG
=
${
WITH
_LOG
}
\
-DLITE_ON_TINY_PUBLISH
=
${
ON_TINY_PUBLISH
}
\
-DLITE_ON_TINY_PUBLISH
=
${
ON_TINY_PUBLISH
}
\
-DARM_TARGET_OS
=
${
ARM_OS
}
\
-DARM_TARGET_OS
=
${
ARM_OS
}
\
-DARM_TARGET_ARCH_ABI
=
${
ARM_ABI
}
\
-DARM_TARGET_ARCH_ABI
=
${
ARM_ABI
}
\
...
...
lite/tools/ci_build.sh
浏览文件 @
3a959784
...
@@ -118,7 +118,7 @@ function cmake_opencl {
...
@@ -118,7 +118,7 @@ function cmake_opencl {
-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK
=
ON
\
-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK
=
ON
\
-DWITH_TESTING
=
ON
\
-DWITH_TESTING
=
ON
\
-DLITE_BUILD_EXTRA
=
ON
\
-DLITE_BUILD_EXTRA
=
ON
\
-DLITE_
SHUTDOWN_LOG
=
OFF
\
-DLITE_
WITH_LOG
=
ON
\
-DLITE_WITH_CV
=
OFF
\
-DLITE_WITH_CV
=
OFF
\
-DARM_TARGET_OS
=
$1
-DARM_TARGET_ARCH_ABI
=
$2
-DARM_TARGET_LANG
=
$3
-DARM_TARGET_OS
=
$1
-DARM_TARGET_ARCH_ABI
=
$2
-DARM_TARGET_LANG
=
$3
}
}
...
@@ -653,7 +653,7 @@ function build_ios {
...
@@ -653,7 +653,7 @@ function build_ios {
-DLITE_WITH_ARM
=
ON
\
-DLITE_WITH_ARM
=
ON
\
-DWITH_TESTING
=
OFF
\
-DWITH_TESTING
=
OFF
\
-DLITE_WITH_JAVA
=
OFF
\
-DLITE_WITH_JAVA
=
OFF
\
-DLITE_
SHUTDOWN_LOG
=
ON
\
-DLITE_
WITH_LOG
=
OFF
\
-DLITE_ON_TINY_PUBLISH
=
ON
\
-DLITE_ON_TINY_PUBLISH
=
ON
\
-DLITE_WITH_OPENMP
=
OFF
\
-DLITE_WITH_OPENMP
=
OFF
\
-DWITH_ARM_DOTPROD
=
OFF
\
-DWITH_ARM_DOTPROD
=
OFF
\
...
@@ -1000,7 +1000,7 @@ function mobile_publish {
...
@@ -1000,7 +1000,7 @@ function mobile_publish {
-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK
=
ON
\
-DLITE_WITH_LIGHT_WEIGHT_FRAMEWORK
=
ON
\
-DWITH_TESTING
=
OFF
\
-DWITH_TESTING
=
OFF
\
-DLITE_WITH_JAVA
=
ON
\
-DLITE_WITH_JAVA
=
ON
\
-DLITE_
SHUTDOWN_LOG
=
ON
\
-DLITE_
WITH_LOG
=
OFF
\
-DLITE_ON_TINY_PUBLISH
=
ON
\
-DLITE_ON_TINY_PUBLISH
=
ON
\
-DARM_TARGET_OS
=
${
os
}
-DARM_TARGET_ARCH_ABI
=
${
abi
}
-DARM_TARGET_LANG
=
${
lang
}
-DARM_TARGET_OS
=
${
os
}
-DARM_TARGET_ARCH_ABI
=
${
abi
}
-DARM_TARGET_LANG
=
${
lang
}
...
...
lite/utils/CMakeLists.txt
浏览文件 @
3a959784
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
# else()
# else()
# endif()
# endif()
if
(
LITE_WITH_LIGHT_WEIGHT_FRAMEWORK OR LITE_ON_MODEL_OPTIMIZE_TOOL OR
LITE_SHUTDOWN_LOG
)
if
(
LITE_WITH_LIGHT_WEIGHT_FRAMEWORK OR LITE_ON_MODEL_OPTIMIZE_TOOL
OR
(
NOT LITE_WITH_LOG
)
)
lite_cc_library
(
logging SRCS logging.cc
)
lite_cc_library
(
logging SRCS logging.cc
)
set
(
utils_DEPS logging
)
set
(
utils_DEPS logging
)
lite_cc_test
(
test_logging SRCS logging_test.cc DEPS
${
utils_DEPS
}
)
lite_cc_test
(
test_logging SRCS logging_test.cc DEPS
${
utils_DEPS
}
)
...
...
lite/utils/cp_logging.h
浏览文件 @
3a959784
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
#pragma once
#pragma once
#if defined(LITE_WITH_LIGHT_WEIGHT_FRAMEWORK) || \
#if defined(LITE_WITH_LIGHT_WEIGHT_FRAMEWORK) || \
defined(LITE_ON_MODEL_OPTIMIZE_TOOL) ||
defined(LITE_SHUTDOWN
_LOG)
defined(LITE_ON_MODEL_OPTIMIZE_TOOL) ||
!defined(LITE_WITH
_LOG)
#include "lite/utils/logging.h"
#include "lite/utils/logging.h"
#else // LITE_WITH_LIGHT_WEIGHT_FRAMEWORK
#else // LITE_WITH_LIGHT_WEIGHT_FRAMEWORK
#include <glog/logging.h>
#include <glog/logging.h>
...
...
lite/utils/logging.cc
浏览文件 @
3a959784
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
#if defined(LITE_WITH_LIGHT_WEIGHT_FRAMEWORK) || \
#if defined(LITE_WITH_LIGHT_WEIGHT_FRAMEWORK) || \
defined(LITE_ON_MODEL_OPTIMIZE_TOOL)
defined(LITE_ON_MODEL_OPTIMIZE_TOOL)
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
namespace
paddle
{
namespace
paddle
{
namespace
lite
{
namespace
lite
{
...
@@ -60,5 +60,5 @@ void gen_log(STL::ostream& log_stream_,
...
@@ -60,5 +60,5 @@ void gen_log(STL::ostream& log_stream_,
}
// namespace lite
}
// namespace lite
}
// namespace paddle
}
// namespace paddle
#endif // LITE_
SHUTDOWN
_LOG
#endif // LITE_
WITH
_LOG
#endif // LITE_WITH_LIGHT_FRAMEWORK
#endif // LITE_WITH_LIGHT_FRAMEWORK
lite/utils/logging.h
浏览文件 @
3a959784
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
// NOLINTFILE()
// NOLINTFILE()
// LOG()
// LOG()
#if
def LITE_SHUTDOWN
_LOG
#if
ndef LITE_WITH
_LOG
#define LOG(status) LOG_##status
#define LOG(status) LOG_##status
#define LOG_INFO paddle::lite::Voidify()
#define LOG_INFO paddle::lite::Voidify()
#define LOG_ERROR LOG_INFO
#define LOG_ERROR LOG_INFO
...
@@ -62,7 +62,7 @@
...
@@ -62,7 +62,7 @@
paddle::lite::LogMessageFatal(__FILE__, __FUNCTION__, __LINE__)
paddle::lite::LogMessageFatal(__FILE__, __FUNCTION__, __LINE__)
#endif
#endif
#if
def LITE_SHUTDOWN
_LOG
#if
ndef LITE_WITH
_LOG
#define VLOG(level) paddle::lite::Voidify()
#define VLOG(level) paddle::lite::Voidify()
#else
#else
// VLOG()
// VLOG()
...
@@ -72,7 +72,7 @@
...
@@ -72,7 +72,7 @@
// CHECK()
// CHECK()
// clang-format off
// clang-format off
#if
def LITE_SHUTDOWN
_LOG
#if
ndef LITE_WITH
_LOG
#define CHECK(x) if (!(x)) paddle::lite::VoidifyFatal()
#define CHECK(x) if (!(x)) paddle::lite::VoidifyFatal()
#define _CHECK_BINARY(x, cmp, y) CHECK(x cmp y)
#define _CHECK_BINARY(x, cmp, y) CHECK(x cmp y)
#else
#else
...
@@ -91,7 +91,7 @@
...
@@ -91,7 +91,7 @@
namespace
paddle
{
namespace
paddle
{
namespace
lite
{
namespace
lite
{
#if
ndef LITE_SHUTDOWN
_LOG
#if
def LITE_WITH
_LOG
void
gen_log
(
STL
::
ostream
&
log_stream_
,
void
gen_log
(
STL
::
ostream
&
log_stream_
,
const
char
*
file
,
const
char
*
file
,
const
char
*
func
,
const
char
*
func
,
...
...
lite/utils/replace_stl/stream.cc
浏览文件 @
3a959784
...
@@ -37,7 +37,7 @@ void ostream::pad(const std::string& text) {
...
@@ -37,7 +37,7 @@ void ostream::pad(const std::string& text) {
}
}
}
}
#if
def LITE_SHUTDOWN
_LOG
#if
ndef LITE_WITH
_LOG
#define ADD_DATA_AS_STRING(data_, obj_)
#define ADD_DATA_AS_STRING(data_, obj_)
#else
#else
#define ADD_DATA_AS_STRING(data_, obj_) \
#define ADD_DATA_AS_STRING(data_, obj_) \
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录