未验证 提交 c7fb4138 编写于 作者: H hong19860320 提交者: GitHub

[Core] Fix findar for Clang (#3160)

* [Core] Fix findar for Clang
test=develop

* [CORE] Fix the missing of feed and fetch kernel when using light API to loade the optimized model
test=develop
上级 b9273631
...@@ -23,7 +23,7 @@ endif() ...@@ -23,7 +23,7 @@ endif()
get_filename_component(AR_PATH ${CMAKE_CXX_COMPILER} PATH) get_filename_component(AR_PATH ${CMAKE_CXX_COMPILER} PATH)
find_file(AR_TOOL NAMES llvm-ar PATHS ${AR_PATH}) find_file(AR_TOOL NAMES llvm-ar PATHS ${AR_PATH} NO_DEFAULT_PATH)
if(NOT AR_TOOL) if(NOT AR_TOOL)
message(ERROR "Failed to find AR_TOOL in ${AR_PATH}") message(ERROR "Failed to find AR_TOOL in ${AR_PATH}")
......
...@@ -20,7 +20,8 @@ namespace lite { ...@@ -20,7 +20,8 @@ namespace lite {
namespace kernels { namespace kernels {
namespace host { namespace host {
class FeedCompute : public KernelLite<TARGET(kHost), PRECISION(kAny)> { class FeedCompute
: public KernelLite<TARGET(kHost), PRECISION(kAny), DATALAYOUT(kAny)> {
public: public:
using param_t = operators::FeedParam; using param_t = operators::FeedParam;
...@@ -39,7 +40,7 @@ class FeedCompute : public KernelLite<TARGET(kHost), PRECISION(kAny)> { ...@@ -39,7 +40,7 @@ class FeedCompute : public KernelLite<TARGET(kHost), PRECISION(kAny)> {
} // namespace paddle } // namespace paddle
REGISTER_LITE_KERNEL( REGISTER_LITE_KERNEL(
feed, kHost, kAny, kNCHW, paddle::lite::kernels::host::FeedCompute, def) feed, kHost, kAny, kAny, paddle::lite::kernels::host::FeedCompute, def)
.BindInput("X", {LiteType::GetTensorTy(TARGET(kHost), PRECISION(kAny))}) .BindInput("X", {LiteType::GetTensorTy(TARGET(kHost))})
.BindOutput("Out", {LiteType::GetTensorTy(TARGET(kHost), PRECISION(kAny))}) .BindOutput("Out", {LiteType::GetTensorTy(TARGET(kHost))})
.Finalize(); .Finalize();
...@@ -20,7 +20,8 @@ namespace lite { ...@@ -20,7 +20,8 @@ namespace lite {
namespace kernels { namespace kernels {
namespace host { namespace host {
class FetchCompute : public KernelLite<TARGET(kHost), PRECISION(kAny)> { class FetchCompute
: public KernelLite<TARGET(kHost), PRECISION(kAny), DATALAYOUT(kAny)> {
public: public:
using param_t = operators::FeedParam; using param_t = operators::FeedParam;
...@@ -42,7 +43,11 @@ class FetchCompute : public KernelLite<TARGET(kHost), PRECISION(kAny)> { ...@@ -42,7 +43,11 @@ class FetchCompute : public KernelLite<TARGET(kHost), PRECISION(kAny)> {
} // namespace paddle } // namespace paddle
REGISTER_LITE_KERNEL( REGISTER_LITE_KERNEL(
fetch, kHost, kAny, kNCHW, paddle::lite::kernels::host::FetchCompute, def) fetch, kHost, kAny, kAny, paddle::lite::kernels::host::FetchCompute, def)
.BindInput("X", {LiteType::GetTensorTy(TARGET(kHost), PRECISION(kAny))}) .BindInput("X",
.BindOutput("Out", {LiteType::GetTensorTy(TARGET(kHost), PRECISION(kAny))}) {LiteType::GetTensorTy(
TARGET(kHost), PRECISION(kAny), DATALAYOUT(kAny), -1)})
.BindOutput("Out",
{LiteType::GetTensorTy(
TARGET(kHost), PRECISION(kAny), DATALAYOUT(kAny), -1)})
.Finalize(); .Finalize();
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册