Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
b4ec6c3b
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
338
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看板
提交
b4ec6c3b
编写于
4月 16, 2020
作者:
Y
yanghongtian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed linking ascend library
上级
9bae4c5a
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
259 addition
and
113 deletion
+259
-113
cmake/device/hw_ascend_npu.cmake
cmake/device/hw_ascend_npu.cmake
+89
-43
lite/backends/hw_ascend_npu/CMakeLists.txt
lite/backends/hw_ascend_npu/CMakeLists.txt
+4
-5
lite/core/arena/CMakeLists.txt
lite/core/arena/CMakeLists.txt
+14
-1
lite/core/arena/framework.cc
lite/core/arena/framework.cc
+2
-1
lite/kernels/hw_ascend_npu/CMakeLists.txt
lite/kernels/hw_ascend_npu/CMakeLists.txt
+7
-2
lite/kernels/hw_ascend_npu/bridges/CMakeLists.txt
lite/kernels/hw_ascend_npu/bridges/CMakeLists.txt
+11
-5
lite/kernels/hw_ascend_npu/bridges/act_op.cc
lite/kernels/hw_ascend_npu/bridges/act_op.cc
+0
-4
lite/kernels/hw_ascend_npu/bridges/paddle_use_bridges.h
lite/kernels/hw_ascend_npu/bridges/paddle_use_bridges.h
+69
-0
lite/kernels/hw_ascend_npu/bridges/utility.cc
lite/kernels/hw_ascend_npu/bridges/utility.cc
+4
-4
lite/kernels/hw_ascend_npu/subgraph_compute.cc
lite/kernels/hw_ascend_npu/subgraph_compute.cc
+1
-1
lite/tests/kernels/CMakeLists.txt
lite/tests/kernels/CMakeLists.txt
+58
-47
未找到文件。
cmake/device/hw_ascend_npu.cmake
浏览文件 @
b4ec6c3b
...
@@ -32,37 +32,25 @@ endif()
...
@@ -32,37 +32,25 @@ endif()
include_directories
(
"
${
ACL_INC
}
"
)
include_directories
(
"
${
ACL_INC
}
"
)
# find ascendcl library
set
(
ACL_LIB_FILES
find_library
(
ACL_LIB_FILE NAMES ascendcl PATHS
${
ASCEND_HOME
}
/acllib/lib64
)
acl_dvpp
if
(
NOT ACL_LIB_FILE
)
ascendcl
message
(
FATAL_ERROR
"Can not find ACL Library in
${
ASCEND_HOME
}
/acllib/lib64"
)
register
else
()
runtime
message
(
STATUS
"Found ACL Library:
${
ACL_LIB_FILE
}
"
)
)
add_library
(
acl_lib SHARED IMPORTED GLOBAL
)
set_property
(
TARGET acl_lib PROPERTY IMPORTED_LOCATION
${
ACL_LIB_FILE
}
)
endif
()
# find register library
foreach
(
libname
${
ACL_LIB_FILES
}
)
find_library
(
REG_LIB_FILE NAMES register PATHS
${
ASCEND_HOME
}
/acllib/lib64
)
find_library
(
lib_name_path_
${
libname
}
NAMES
${
libname
}
PATHS
${
ASCEND_HOME
}
/acllib/lib64
)
if
(
NOT REG_LIB_FILE
)
if
(
lib_name_path_
${
libname
}
)
message
(
FATAL_ERROR
"Can not find REG Library in
${
ASCEND_HOME
}
/acllib/lib64"
)
add_library
(
acl_
${
libname
}
SHARED IMPORTED GLOBAL
)
else
()
set_property
(
TARGET acl_
${
libname
}
PROPERTY IMPORTED_LOCATION
${
lib_name_path_
${
libname
}}
)
message
(
STATUS
"Found REG Library:
${
REG_LIB_FILE
}
"
)
list
(
APPEND acl_libs acl_
${
libname
}
)
add_library
(
register_lib SHARED IMPORTED GLOBAL
)
else
()
set_property
(
TARGET register_lib PROPERTY IMPORTED_LOCATION
${
REG_LIB_FILE
}
)
message
(
FATAL_ERROR
"can not find library:
${
libname
}
"
)
endif
()
endif
()
endforeach
()
set
(
hw_ascend_npu_runtime_libs
${
acl_libs
}
CACHE INTERNAL
"ascend runtime libs"
)
find_library
(
RT_LIB_FILE NAMES runtime PATHS
${
ASCEND_HOME
}
/acllib/lib64
)
if
(
NOT RT_LIB_FILE
)
message
(
FATAL_ERROR
"Can not find RT Library in
${
ASCEND_HOME
}
/acllib/lib64"
)
else
()
message
(
STATUS
"Found RT Library:
${
RT_LIB_FILE
}
"
)
add_library
(
runtime_lib SHARED IMPORTED GLOBAL
)
set_property
(
TARGET runtime_lib PROPERTY IMPORTED_LOCATION
${
RT_LIB_FILE
}
)
endif
()
set
(
hw_ascend_npu_runtime_libs acl_lib register_lib runtime_lib CACHE INTERNAL
"ascend runtime libs"
)
# find atc include folder and library
# find atc include folder and library
find_path
(
ATC_INC NAMES ge/ge_ir_build.h
find_path
(
ATC_INC NAMES ge/ge_ir_build.h
...
@@ -72,14 +60,49 @@ if (NOT ATC_INC)
...
@@ -72,14 +60,49 @@ if (NOT ATC_INC)
endif
()
endif
()
include_directories
(
"
${
ATC_INC
}
"
)
include_directories
(
"
${
ATC_INC
}
"
)
find_library
(
GRAPH_LIB_FILE graph PATHS
${
ASCEND_HOME
}
/atc/lib64
)
set
(
ATC_LIB_FILES
if
(
NOT GRAPH_LIB_FILE
)
_caffe_parser
message
(
FATAL_ERROR
"Can not find libgraph.so library in
${
ASCEND_HOME
}
/atc/lib64"
)
auto_tiling
else
()
c_sec
message
(
STATUS
"Found Graph Library:
${
GRAPH_LIB_FILE
}
"
)
cce
add_library
(
graph_lib SHARED IMPORTED GLOBAL
)
cce_aicore
set_property
(
TARGET graph_lib PROPERTY IMPORTED_LOCATION
${
GRAPH_LIB_FILE
}
)
cce_aicpudev_online
endif
()
cce_tools
drvdevdrv
drvdevmm
drvdsmi_host
drvhdc_host
fmk_caffe_parser
fmk_tensorflow_parser
ge_client
ge_common
ge_compiler
ge_executor
graph
mmpa
msprof
parser_common
register
resource
runtime
slog
te_fusion
tiling
tvm
tvm_runtime
tvm_topi
)
foreach
(
libname
${
ATC_LIB_FILES
}
)
find_library
(
lib_name_path_
${
libname
}
NAMES
${
libname
}
PATHS
${
ASCEND_HOME
}
/atc/lib64
)
if
(
lib_name_path_
${
libname
}
)
add_library
(
atc_
${
libname
}
SHARED IMPORTED GLOBAL
)
set_property
(
TARGET atc_
${
libname
}
PROPERTY IMPORTED_LOCATION
${
lib_name_path_
${
libname
}}
)
list
(
APPEND atc_libs atc_
${
libname
}
)
else
()
message
(
FATAL_ERROR
"can not find library:
${
libname
}
"
)
endif
()
endforeach
()
# find opp include folder and library
# find opp include folder and library
find_path
(
OPP_INC NAMES all_ops.h
find_path
(
OPP_INC NAMES all_ops.h
...
@@ -89,14 +112,37 @@ if (NOT OPP_INC)
...
@@ -89,14 +112,37 @@ if (NOT OPP_INC)
endif
()
endif
()
include_directories
(
"
${
OPP_INC
}
"
)
include_directories
(
"
${
OPP_INC
}
"
)
find_library
(
OPP_LIB_FILE opsproto PATHS
${
ASCEND_HOME
}
/opp/op_proto/built-in
)
find_library
(
OPP_
OPSPROTO_
LIB_FILE opsproto PATHS
${
ASCEND_HOME
}
/opp/op_proto/built-in
)
if
(
NOT OPP_LIB_FILE
)
if
(
NOT OPP_
OPSPROTO_
LIB_FILE
)
message
(
FATAL_ERROR
"Can not find libopsproto.so in
${
ASCEND_HOME
}
/opp/op_proto/built-in"
)
message
(
FATAL_ERROR
"Can not find libopsproto.so in
${
ASCEND_HOME
}
/opp/op_proto/built-in"
)
else
()
else
()
message
(
STATUS
"Found OPP Library:
${
OPP_LIB_FILE
}
"
)
message
(
STATUS
"Found OPP proto Library:
${
OPP_OPSPROTO_LIB_FILE
}
"
)
add_library
(
opp_lib SHARED IMPORTED GLOBAL
)
add_library
(
opp_opsproto_lib SHARED IMPORTED GLOBAL
)
set_property
(
TARGET opp_lib PROPERTY IMPORTED_LOCATION
${
OPP_LIB_FILE
}
)
set_property
(
TARGET opp_opsproto_lib PROPERTY IMPORTED_LOCATION
${
OPP_OPSPROTO_LIB_FILE
}
)
endif
()
find_library
(
OPP_FUSION_AICORE ops_fusion_pass_aicore PATHS
${
ASCEND_HOME
}
/opp/fusion_pass/built_in/
)
if
(
NOT OPP_FUSION_AICORE
)
message
(
FATAL_ERROR
"Can not find libops_fusion_pass_aicore.so in
${
ASCEND_HOME
}
/opp/fusion_pass/built_in/"
)
else
()
message
(
STATUS
"Found fusion_pass_aicore Library:
${
OPP_FUSION_AICORE
}
"
)
add_library
(
opp_fusion_pass_aicore_lib SHARED IMPORTED GLOBAL
)
set_property
(
TARGET opp_fusion_pass_aicore_lib PROPERTY IMPORTED_LOCATION
${
OPP_FUSION_AICORE
}
)
endif
()
find_library
(
OPP_FUSION_VECTORCORE ops_fusion_pass_vectorcore PATHS
${
ASCEND_HOME
}
/opp/fusion_pass/built_in/vector_core
)
if
(
NOT OPP_FUSION_VECTORCORE
)
message
(
FATAL_ERROR
"Can not find libops_fusion_pass_vectorcore.so in
${
ASCEND_HOME
}
/opp/fusion_pass/built_in/vector_core"
)
else
()
message
(
STATUS
"Found fusion_pass_vectorcore Library:
${
OPP_FUSION_VECTORCORE
}
"
)
add_library
(
opp_fusion_pass_vectorcore_lib SHARED IMPORTED GLOBAL
)
set_property
(
TARGET opp_fusion_pass_vectorcore_lib PROPERTY IMPORTED_LOCATION
${
OPP_FUSION_VECTORCORE
}
)
endif
()
endif
()
set
(
hw_ascend_npu_builder_libs graph_lib opp_lib CACHE INTERNAL
"ascend builder libs"
)
set
(
hw_ascend_npu_builder_libs
${
atc_libs
}
opp_opsproto_lib
opp_fusion_pass_aicore_lib
opp_fusion_pass_vectorcore_lib
CACHE INTERNAL
"ascend builder libs"
)
lite/backends/hw_ascend_npu/CMakeLists.txt
浏览文件 @
b4ec6c3b
if
(
NOT LITE_WITH_HW_ASCEND_NPU
)
if
(
NOT LITE_WITH_HW_ASCEND_NPU
)
return
()
return
()
endif
()
endif
()
lite_cc_library
(
runtime_hw_ascend_npu SRCS runtime.cc DEPS
${
hw_ascend_npu_builder_libs
}
${
hw_ascend_npu_runtime_libs
}
)
lite_cc_library
(
target_wrapper_hw_ascend_npu SRCS target_wrapper.cc DEPS
lite_cc_library
(
target_wrapper_hw_ascend_npu SRCS target_wrapper.cc DEPS
${
hw_ascend_npu_builder_libs
}
${
hw_ascend_npu_runtime_libs
}
)
${
hw_ascend_npu_runtime_libs
}
)
lite_cc_library
(
runtime_hw_ascend_npu SRCS runtime.cc DEPS
${
hw_ascend_npu_runtime_libs
}
target_wrapper_hw_ascend_npu
)
lite_cc_library
(
device_hw_ascend_npu SRCS device.cc DEPS
lite_cc_library
(
device_hw_ascend_npu SRCS device.cc DEPS
${
hw_ascend_npu_builder_libs
}
${
hw_ascend_npu_runtime_libs
}
${
hw_ascend_npu_runtime_libs
}
target_wrapper_hw_ascend_npu
target_wrapper_hw_ascend_npu
runtime_hw_ascend_npu
)
runtime_hw_ascend_npu
)
lite/core/arena/CMakeLists.txt
浏览文件 @
b4ec6c3b
...
@@ -6,5 +6,18 @@ endif()
...
@@ -6,5 +6,18 @@ endif()
lite_cc_library
(
arena_framework SRCS framework.cc DEPS program gtest
)
lite_cc_library
(
arena_framework SRCS framework.cc DEPS program gtest
)
if
((
NOT LITE_WITH_OPENCL
)
AND
(
LITE_WITH_X86 OR LITE_WITH_ARM
))
if
((
NOT LITE_WITH_OPENCL
)
AND
(
LITE_WITH_X86 OR LITE_WITH_ARM
))
lite_cc_test
(
test_arena_framework SRCS framework_test.cc DEPS arena_framework
${
mlu_kernels
}
${
bm_kernels
}
${
npu_kernels
}
${
xpu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
fpga_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_arena_framework SRCS framework_test.cc DEPS
arena_framework
${
mlu_kernels
}
${
bm_kernels
}
${
npu_kernels
}
${
xpu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
fpga_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
endif
()
endif
()
lite/core/arena/framework.cc
浏览文件 @
b4ec6c3b
...
@@ -22,7 +22,8 @@ namespace arena {
...
@@ -22,7 +22,8 @@ namespace arena {
void
TestCase
::
CreateInstruction
()
{
void
TestCase
::
CreateInstruction
()
{
std
::
shared_ptr
<
lite
::
OpLite
>
op
=
nullptr
;
std
::
shared_ptr
<
lite
::
OpLite
>
op
=
nullptr
;
if
(
place_
.
target
==
TARGET
(
kNPU
)
||
place_
.
target
==
TARGET
(
kXPU
))
{
if
(
place_
.
target
==
TARGET
(
kNPU
)
||
place_
.
target
==
TARGET
(
kXPU
)
||
place_
.
target
==
TARGET
(
kHWAscendNPU
))
{
// Create a new block desc to wrap the original op desc
// Create a new block desc to wrap the original op desc
int
sub_block_idx
=
0
;
int
sub_block_idx
=
0
;
auto
sub_block_desc
=
new
cpp
::
BlockDesc
();
auto
sub_block_desc
=
new
cpp
::
BlockDesc
();
...
...
lite/kernels/hw_ascend_npu/CMakeLists.txt
浏览文件 @
b4ec6c3b
add_subdirectory
(
bridges
)
add_subdirectory
(
bridges
)
add_kernel
(
subgraph_compute_hw_ascend_npu HWAscendNPU basic SRCS subgraph_compute.cc DEPS
add_kernel
(
subgraph_compute_hw_ascend_npu HW_ASCEND_NPU basic SRCS subgraph_compute.cc DEPS
${
lite_kernel_deps
}
device_hw_ascend_npu subgraph_bridge_engine
${
hw_ascend_npu_subgraph_bridges
}
)
${
lite_kernel_deps
}
device_hw_ascend_npu
subgraph_bridge_engine
${
hw_ascend_npu_subgraph_bridges
}
subgraph_bridge_registry
)
lite/kernels/hw_ascend_npu/bridges/CMakeLists.txt
浏览文件 @
b4ec6c3b
...
@@ -2,18 +2,24 @@ if (NOT LITE_WITH_HW_ASCEND_NPU)
...
@@ -2,18 +2,24 @@ if (NOT LITE_WITH_HW_ASCEND_NPU)
return
()
return
()
endif
()
endif
()
message
(
STATUS
"======compile hw_ascend_npu bridges,
${
hw_ascend_npu_builder_libs
}
"
)
lite_cc_library
(
subgraph_bridge_utility_hw_ascend_npu
lite_cc_library
(
subgraph_bridge_utility_hw_ascend_npu
SRCS utility.cc
SRCS utility.cc
DEPS
${
hw_ascend_npu_builder_libs
}
tensor
)
DEPS
${
hw_ascend_npu_builder_libs
}
tensor
)
lite_cc_library
(
subgraph_bridge_graph_hw_ascend_npu
lite_cc_library
(
subgraph_bridge_graph_hw_ascend_npu
SRCS graph.cc
SRCS graph.cc
DEPS
${
hw_ascend_npu_builder_libs
}
subgraph_bridge_utility_hw_ascend_npu
)
DEPS
${
hw_ascend_npu_builder_libs
}
subgraph_bridge_utility_hw_ascend_npu
)
set
(
hw_ascend_npu_subgraph_bridge_deps subgraph_bridge_registry subgraph_bridge_utility_hw_ascend_npu subgraph_bridge_graph_hw_ascend_npu
)
lite_cc_library
(
subgraph_bridge_act_op_hw_ascend_npu SRCS act_op.cc DEPS
${
hw_ascend_npu_builder_libs
}
${
hw_ascend_npu_subgraph_bridge_deps
}
)
set
(
hw_ascend_npu_subgraph_bridges
set
(
hw_ascend_npu_subgraph_bridges
subgraph_bridge_graph_hw_ascend_npu
subgraph_bridge_graph_hw_ascend_npu
subgraph_bridge_registry
subgraph_bridge_utility_hw_ascend_npu
subgraph_bridge_act_op_hw_ascend_npu
CACHE INTERNAL
"hw_ascend_npu_subgraph_bridges"
)
CACHE INTERNAL
"hw_ascend_npu_subgraph_bridges"
)
lite_cc_library
(
subgraph_bridge_act_op_hw_ascend_npu SRCS act_op.cc DEPS
${
hw_ascend_npu_subgraph_bridge_deps
}
)
lite/kernels/hw_ascend_npu/bridges/act_op.cc
浏览文件 @
b4ec6c3b
...
@@ -138,10 +138,6 @@ REGISTER_SUBGRAPH_BRIDGE(
...
@@ -138,10 +138,6 @@ REGISTER_SUBGRAPH_BRIDGE(
softplus
,
softplus
,
kHWAscendNPU
,
kHWAscendNPU
,
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
op
::
Activation
>
);
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
op
::
Activation
>
);
REGISTER_SUBGRAPH_BRIDGE
(
hard_sigmoid
,
kHWAscendNPU
,
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
op
::
Activation
>
);
REGISTER_SUBGRAPH_BRIDGE
(
REGISTER_SUBGRAPH_BRIDGE
(
log
,
log
,
...
...
lite/kernels/hw_ascend_npu/bridges/paddle_use_bridges.h
0 → 100644
浏览文件 @
b4ec6c3b
// Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#pragma once
USE_SUBGRAPH_BRIDGE
(
sigmoid
,
kHWAscendNPU
);
USE_SUBGRAPH_BRIDGE
(
relu
,
kHWAscendNPU
);
USE_SUBGRAPH_BRIDGE
(
tanh
,
kHWAscendNPU
);
/// USE_SUBGRAPH_BRIDGE(relu_clipped, kHWAscendNPU);
USE_SUBGRAPH_BRIDGE
(
relu6
,
kHWAscendNPU
);
USE_SUBGRAPH_BRIDGE
(
leaky_relu
,
kHWAscendNPU
);
USE_SUBGRAPH_BRIDGE
(
softsign
,
kHWAscendNPU
);
/// USE_SUBGRAPH_BRIDGE(hard_sigmoid, kHWAscendNPU);
USE_SUBGRAPH_BRIDGE
(
log
,
kHWAscendNPU
);
USE_SUBGRAPH_BRIDGE
(
sqrt
,
kHWAscendNPU
);
USE_SUBGRAPH_BRIDGE
(
square
,
kHWAscendNPU
);
// USE_SUBGRAPH_BRIDGE(batch_norm, kNPU);
// USE_SUBGRAPH_BRIDGE(less_than, kNPU);
// USE_SUBGRAPH_BRIDGE(concat, kNPU);
// USE_SUBGRAPH_BRIDGE(conv2d, kNPU);
// USE_SUBGRAPH_BRIDGE(depthwise_conv2d, kNPU);
// USE_SUBGRAPH_BRIDGE(conv2d_transpose, kNPU);
//
// USE_SUBGRAPH_BRIDGE(dropout, kNPU);
// USE_SUBGRAPH_BRIDGE(elementwise_add, kNPU);
// USE_SUBGRAPH_BRIDGE(elementwise_sub, kNPU);
// USE_SUBGRAPH_BRIDGE(elementwise_mul, kNPU);
// USE_SUBGRAPH_BRIDGE(elementwise_div, kNPU);
// USE_SUBGRAPH_BRIDGE(fusion_elementwise_add_activation, kNPU);
// USE_SUBGRAPH_BRIDGE(fusion_elementwise_sub_activation, kNPU);
// USE_SUBGRAPH_BRIDGE(fusion_elementwise_mul_activation, kNPU);
// USE_SUBGRAPH_BRIDGE(fusion_elementwise_div_activation, kNPU);
// USE_SUBGRAPH_BRIDGE(fill_constant, kNPU)
// USE_SUBGRAPH_BRIDGE(fill_constant_batch_size_like, kNPU)
//
// USE_SUBGRAPH_BRIDGE(increment, kNPU);
// USE_SUBGRAPH_BRIDGE(instance_norm, kNPU);
// USE_SUBGRAPH_BRIDGE(fc, kNPU);
// USE_SUBGRAPH_BRIDGE(bilinear_interp, kNPU);
// USE_SUBGRAPH_BRIDGE(nearest_interp, kNPU);
// USE_SUBGRAPH_BRIDGE(layer_norm, kNPU);
// USE_SUBGRAPH_BRIDGE(matmul, kNPU);
// USE_SUBGRAPH_BRIDGE(mul, kNPU);
// USE_SUBGRAPH_BRIDGE(pad2d, kNPU);
// USE_SUBGRAPH_BRIDGE(pool2d, kNPU);
// USE_SUBGRAPH_BRIDGE(reduce_mean, kNPU);
// USE_SUBGRAPH_BRIDGE(reshape, kNPU);
// USE_SUBGRAPH_BRIDGE(reshape2, kNPU);
// USE_SUBGRAPH_BRIDGE(scale, kNPU);
// USE_SUBGRAPH_BRIDGE(shuffle_channel, kNPU);
// USE_SUBGRAPH_BRIDGE(softmax, kNPU);
// USE_SUBGRAPH_BRIDGE(split, kNPU);
//// USE_SUBGRAPH_BRIDGE(top_k, kNPU);
// USE_SUBGRAPH_BRIDGE(transpose, kNPU);
// USE_SUBGRAPH_BRIDGE(transpose2, kNPU);
// USE_SUBGRAPH_BRIDGE(unsqueeze, kNPU);
// USE_SUBGRAPH_BRIDGE(unsqueeze2, kNPU);
lite/kernels/hw_ascend_npu/bridges/utility.cc
浏览文件 @
b4ec6c3b
...
@@ -82,8 +82,8 @@ ge::Format CvtDataLayoutType(DataLayoutType itype) {
...
@@ -82,8 +82,8 @@ ge::Format CvtDataLayoutType(DataLayoutType itype) {
break
;
break
;
// TODO(yanghongtian): support more data layout type
// TODO(yanghongtian): support more data layout type
default:
default:
LOG
(
FATAL
)
<<
"[HW
_ASCEND_
NPU] Can not convert data layout type("
LOG
(
FATAL
)
<<
"[HW
Ascend
NPU] Can not convert data layout type("
<<
DataLayoutToStr
(
itype
)
<<
") from Lite to HW
_ASCEND_
NPU"
;
<<
DataLayoutToStr
(
itype
)
<<
") from Lite to HW
Ascend
NPU"
;
break
;
break
;
}
}
return
otype
;
return
otype
;
...
@@ -91,7 +91,7 @@ ge::Format CvtDataLayoutType(DataLayoutType itype) {
...
@@ -91,7 +91,7 @@ ge::Format CvtDataLayoutType(DataLayoutType itype) {
std
::
vector
<
int64_t
>
CvtShape
(
const
std
::
vector
<
int64_t
>&
in_shape
)
{
std
::
vector
<
int64_t
>
CvtShape
(
const
std
::
vector
<
int64_t
>&
in_shape
)
{
CHECK
(
in_shape
.
size
()
<=
4
&&
in_shape
.
size
()
>
0
)
CHECK
(
in_shape
.
size
()
<=
4
&&
in_shape
.
size
()
>
0
)
<<
"[HW
_ASCEND_
NPU] The size of in_shape is invalid: "
<<
in_shape
.
size
();
<<
"[HW
Ascend
NPU] The size of in_shape is invalid: "
<<
in_shape
.
size
();
// Padding the shape to 4-dimensions(NCHW)
// Padding the shape to 4-dimensions(NCHW)
std
::
vector
<
int64_t
>
out_shape
(
4
,
1
);
std
::
vector
<
int64_t
>
out_shape
(
4
,
1
);
std
::
copy
(
in_shape
.
begin
(),
std
::
copy
(
in_shape
.
begin
(),
...
@@ -152,7 +152,7 @@ int CvtActMode(const std::string& act_type) {
...
@@ -152,7 +152,7 @@ int CvtActMode(const std::string& act_type) {
act_mode
=
9
;
act_mode
=
9
;
}
else
{
}
else
{
// TODO(yanghongtian): support more activation mode
// TODO(yanghongtian): support more activation mode
LOG
(
FATAL
)
<<
"[NPU] Unsupported activation type "
<<
act_type
;
LOG
(
FATAL
)
<<
"[
HWAscend
NPU] Unsupported activation type "
<<
act_type
;
}
}
return
act_mode
;
return
act_mode
;
}
}
...
...
lite/kernels/hw_ascend_npu/subgraph_compute.cc
浏览文件 @
b4ec6c3b
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
#include "lite/backends/hw_ascend_npu/device.h"
#include "lite/backends/hw_ascend_npu/device.h"
#include "lite/core/op_registry.h"
#include "lite/core/op_registry.h"
#include "lite/kernels/hw_ascend_npu/bridges/graph.h"
#include "lite/kernels/hw_ascend_npu/bridges/graph.h"
#include "lite/kernels/npu/bridges/paddle_use_bridges.h"
#include "lite/kernels/
hw_ascend_
npu/bridges/paddle_use_bridges.h"
namespace
paddle
{
namespace
paddle
{
namespace
lite
{
namespace
lite
{
...
...
lite/tests/kernels/CMakeLists.txt
浏览文件 @
b4ec6c3b
if
((
NOT LITE_WITH_OPENCL AND NOT LITE_WITH_FPGA AND NOT LITE_WITH_BM AND NOT LITE_WITH_MLU
)
AND
(
LITE_WITH_X86 OR LITE_WITH_ARM
))
lite_cc_test
(
test_kernel_conv_compute SRCS conv_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
set
(
kernels
lite_cc_test
(
test_kernel_conv_transpose_compute SRCS conv_transpose_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
${
xpu_kernels
}
lite_cc_test
(
test_kernel_scale_compute SRCS scale_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
${
npu_kernels
}
lite_cc_test
(
test_kernel_power_compute SRCS power_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
${
x86_kernels
}
lite_cc_test
(
test_kernel_shuffle_channel_compute SRCS shuffle_channel_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
${
cuda_kernels
}
lite_cc_test
(
test_kernel_yolo_box_compute SRCS yolo_box_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
${
arm_kernels
}
lite_cc_test
(
test_kernel_fc_compute SRCS fc_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
${
lite_ops
}
lite_cc_test
(
test_kernel_elementwise_compute SRCS elementwise_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
${
host_kernels
}
lite_cc_test
(
test_kernel_lrn_compute SRCS lrn_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_decode_bboxes_compute SRCS decode_bboxes_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_box_coder_compute SRCS box_coder_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
if
((
NOT LITE_WITH_OPENCL AND NOT LITE_WITH_FPGA AND NOT LITE_WITH_BM AND NOT LITE_WITH_MLU AND NOT LITE_WITH_HW_ASCEND_NPU
)
AND
(
LITE_WITH_X86 OR LITE_WITH_ARM
))
lite_cc_test
(
test_kernel_activation_compute SRCS activation_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_conv_compute SRCS conv_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_argmax_compute SRCS argmax_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_conv_transpose_compute SRCS conv_transpose_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_axpy_compute SRCS axpy_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_scale_compute SRCS scale_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_norm_compute SRCS norm_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_power_compute SRCS power_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_cast_compute SRCS cast_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_shuffle_channel_compute SRCS shuffle_channel_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_instance_norm_compute SRCS instance_norm_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_yolo_box_compute SRCS yolo_box_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_grid_sampler_compute SRCS grid_sampler_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_fc_compute SRCS fc_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_elementwise_compute SRCS elementwise_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_lrn_compute SRCS lrn_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_decode_bboxes_compute SRCS decode_bboxes_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_box_coder_compute SRCS box_coder_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_activation_compute SRCS activation_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_argmax_compute SRCS argmax_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_axpy_compute SRCS axpy_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_norm_compute SRCS norm_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_cast_compute SRCS cast_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_instance_norm_compute SRCS instance_norm_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_grid_sampler_compute SRCS grid_sampler_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
#lite_cc_test(test_kernel_sequence_softmax_compute SRCS sequence_softmax_compute_test.cc DEPS arena_framework ${x86_kernels} ${cuda_kernels} ${arm_kernels} ${lite_ops} ${host_kernels})
#lite_cc_test(test_kernel_sequence_softmax_compute SRCS sequence_softmax_compute_test.cc DEPS arena_framework ${x86_kernels} ${cuda_kernels} ${arm_kernels} ${lite_ops} ${host_kernels})
#lite_cc_test(test_kernel_im2sequence_compute SRCS im2sequence_compute_test.cc DEPS arena_framework ${x86_kernels} ${cuda_kernels} ${arm_kernels} ${lite_ops} ${host_kernels})
#lite_cc_test(test_kernel_im2sequence_compute SRCS im2sequence_compute_test.cc DEPS arena_framework ${x86_kernels} ${cuda_kernels} ${arm_kernels} ${lite_ops} ${host_kernels})
lite_cc_test
(
test_kernel_compare_compute SRCS compare_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_compare_compute SRCS compare_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
#lite_cc_test(test_kernel_logical_xor_compute SRCS logical_compute_test.cc DEPS arena_framework ${x86_kernels} ${cuda_kernels} ${arm_kernels} ${lite_ops} ${host_kernels})
#lite_cc_test(test_kernel_logical_xor_compute SRCS logical_compute_test.cc DEPS arena_framework ${x86_kernels} ${cuda_kernels} ${arm_kernels} ${lite_ops} ${host_kernels})
lite_cc_test
(
test_kernel_topk_compute SRCS topk_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_topk_compute SRCS topk_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_increment_compute SRCS increment_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_increment_compute SRCS increment_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_write_to_array_compute SRCS write_to_array_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_write_to_array_compute SRCS write_to_array_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_read_from_array_compute SRCS read_from_array_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_read_from_array_compute SRCS read_from_array_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_concat_compute SRCS concat_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_concat_compute SRCS concat_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_transpose_compute SRCS transpose_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_transpose_compute SRCS transpose_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_reshape_compute SRCS reshape_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_reshape_compute SRCS reshape_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_layer_norm_compute SRCS layer_norm_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_layer_norm_compute SRCS layer_norm_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_dropout_compute SRCS dropout_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_dropout_compute SRCS dropout_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_softmax_compute SRCS softmax_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_softmax_compute SRCS softmax_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_mul_compute SRCS mul_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_mul_compute SRCS mul_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_multiclass_nms_compute SRCS multiclass_nms_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_multiclass_nms_compute SRCS multiclass_nms_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_batch_norm_compute SRCS batch_norm_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_batch_norm_compute SRCS batch_norm_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_pool_compute SRCS pool_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_pool_compute SRCS pool_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_fill_constant_compute SRCS fill_constant_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_fill_constant_compute SRCS fill_constant_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_fill_constant_batch_size_like_compute SRCS fill_constant_batch_size_like_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_fill_constant_batch_size_like_compute SRCS fill_constant_batch_size_like_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
if
(
LITE_BUILD_EXTRA
)
if
(
LITE_BUILD_EXTRA
)
lite_cc_test
(
test_gru_unit SRCS gru_unit_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
bm_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_gru_unit SRCS gru_unit_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
bm_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
...
@@ -73,16 +84,16 @@ if(LITE_BUILD_EXTRA)
...
@@ -73,16 +84,16 @@ if(LITE_BUILD_EXTRA)
endif
()
endif
()
endif
()
endif
()
lite_cc_test
(
test_kernel_pad2d_compute SRCS pad2d_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
bm_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_pad2d_compute SRCS pad2d_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
bm_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_prior_box_compute SRCS prior_box_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
bm_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_prior_box_compute SRCS prior_box_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
bm_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_negative_compute SRCS negative_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
bm_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_negative_compute SRCS negative_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
bm_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_interp_compute SRCS interp_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
bm_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_interp_compute SRCS interp_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
bm_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_shape_compute SRCS shape_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
bm_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_shape_compute SRCS shape_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
bm_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_crop_compute SRCS crop_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
bm_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_crop_compute SRCS crop_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
bm_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_sequence_expand_compute SRCS sequence_expand_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
bm_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_sequence_expand_compute SRCS sequence_expand_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
bm_kernels
}
${
npu_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_squeeze_compute SRCS squeeze_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
bm_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_squeeze_compute SRCS squeeze_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
bm_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_slice_compute SRCS slice_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
bm_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_slice_compute SRCS slice_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
bm_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_expand_compute SRCS expand_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
bm_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_expand_compute SRCS expand_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
bm_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
lite_cc_test
(
test_kernel_matmul_compute SRCS matmul_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
bm_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
)
lite_cc_test
(
test_kernel_matmul_compute SRCS matmul_compute_test.cc DEPS arena_framework
${
xpu_kernels
}
${
npu_kernels
}
${
bm_kernels
}
${
x86_kernels
}
${
cuda_kernels
}
${
arm_kernels
}
${
lite_ops
}
${
host_kernels
}
${
hw_ascend_npu_kernels
}
)
#lite_cc_test(test_kernel_crf_decoding_compute SRCS crf_decoding_compute_test.cc DEPS arena_framework ${xpu_kernels} ${npu_kernels} ${bm_kernels} ${x86_kernels} ${cuda_kernels} ${arm_kernels} ${lite_ops} ${host_kernels})
#lite_cc_test(test_kernel_crf_decoding_compute SRCS crf_decoding_compute_test.cc DEPS arena_framework ${xpu_kernels} ${npu_kernels} ${bm_kernels} ${x86_kernels} ${cuda_kernels} ${arm_kernels} ${lite_ops} ${host_kernels})
endif
()
endif
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录