Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
极客李华
Paddle
提交
4149cabe
P
Paddle
项目概览
极客李华
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
4149cabe
编写于
3月 01, 2022
作者:
王
王明冬
提交者:
GitHub
3月 01, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add type constrait for DenseTensor (#39967)
上级
d17961ed
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
40 addition
and
32 deletion
+40
-32
paddle/infrt/dialect/infrt/infrt_ops_base.td
paddle/infrt/dialect/infrt/infrt_ops_base.td
+6
-0
paddle/infrt/dialect/init_infrt_dialects.cc
paddle/infrt/dialect/init_infrt_dialects.cc
+2
-2
paddle/infrt/dialect/phi/CMakeLists.txt
paddle/infrt/dialect/phi/CMakeLists.txt
+1
-10
paddle/infrt/dialect/phi/ir/CMakeLists.txt
paddle/infrt/dialect/phi/ir/CMakeLists.txt
+9
-0
paddle/infrt/dialect/phi/ir/infrt_phi_base.td
paddle/infrt/dialect/phi/ir/infrt_phi_base.td
+0
-0
paddle/infrt/dialect/phi/ir/infrt_phi_kernel.td
paddle/infrt/dialect/phi/ir/infrt_phi_kernel.td
+1
-1
paddle/infrt/dialect/phi/ir/infrt_phi_tensor.cc
paddle/infrt/dialect/phi/ir/infrt_phi_tensor.cc
+5
-5
paddle/infrt/dialect/phi/ir/infrt_phi_tensor.h
paddle/infrt/dialect/phi/ir/infrt_phi_tensor.h
+4
-4
paddle/infrt/dialect/phi/ir/infrt_phi_tensor.td
paddle/infrt/dialect/phi/ir/infrt_phi_tensor.td
+1
-1
paddle/infrt/dialect/phi/ir/phi_base.cc
paddle/infrt/dialect/phi/ir/phi_base.cc
+6
-6
paddle/infrt/dialect/phi/ir/phi_base.h
paddle/infrt/dialect/phi/ir/phi_base.h
+5
-3
未找到文件。
paddle/infrt/dialect/infrt/infrt_ops_base.td
浏览文件 @
4149cabe
...
...
@@ -40,6 +40,12 @@ def DenseTensor : Infrt_Type<"DenseTensor"> {
);
}
// Type Constrait for concrete DenseTensor type.
class DenseTensor<string target, string precision, string layout> :
Type<CPred<"$_self == ::infrt::DenseTensorType::get($_self.getContext(), ::infrt::TargetType::"#target#",::infrt::PrecisionType::"#precision#",::infrt::LayoutType::"#layout#")">,
"!infrt.DenseTensor<"#target#","#precision#","#layout#">",
"::infrt::DenseTensorType">;
// Base class for infrt dialect attributes.
class Infrt_Attr<string name, list<Trait> traits = [],
string baseCppClass = "::mlir::Attribute">
...
...
paddle/infrt/dialect/init_infrt_dialects.cc
浏览文件 @
4149cabe
...
...
@@ -21,8 +21,8 @@
#include "paddle/infrt/dialect/infrt/infrt_dialect.h"
#include "paddle/infrt/dialect/infrt_base.h"
#include "paddle/infrt/dialect/pd_ops.h"
#include "paddle/infrt/dialect/phi/infrt_phi_tensor.h"
#include "paddle/infrt/dialect/phi/phi_base.h"
#include "paddle/infrt/dialect/phi/i
r/i
nfrt_phi_tensor.h"
#include "paddle/infrt/dialect/phi/
ir/
phi_base.h"
#include "paddle/infrt/dialect/tensor_shape.h"
namespace
infrt
{
...
...
paddle/infrt/dialect/phi/CMakeLists.txt
浏览文件 @
4149cabe
...
...
@@ -2,16 +2,7 @@ if (NOT INFRT_WITH_PHI)
return
()
endif
()
#mlir_tablegen_on(infrt_phi_base DIALECT phi)
add_mlir_dialect
(
infrt_phi_base phi
)
add_mlir_dialect
(
infrt_phi_tensor phi_dt
)
add_mlir_dialect
(
infrt_phi_kernel phi_kernel
)
#mlir_tablegen_on(infrt_phi_tensor)
gather_srcs
(
infrt_src SRCS
phi_base.cc infrt_phi_tensor.cc
infrt_phi_tensor.cc
)
add_subdirectory
(
ir
)
add_subdirectory
(
pass
)
add_executable
(
phi-exec phi_exec.cc
)
...
...
paddle/infrt/dialect/phi/ir/CMakeLists.txt
0 → 100644
浏览文件 @
4149cabe
#mlir_tablegen_on(infrt_phi_base DIALECT phi)
add_mlir_dialect
(
infrt_phi_base phi
)
add_mlir_dialect
(
infrt_phi_tensor phi_dt
)
add_mlir_dialect
(
infrt_phi_kernel phi_kernel
)
#mlir_tablegen_on(infrt_phi_tensor)
gather_srcs
(
infrt_src SRCS
phi_base.cc
infrt_phi_tensor.cc
)
paddle/infrt/dialect/phi/infrt_phi_base.td
→
paddle/infrt/dialect/phi/i
r/i
nfrt_phi_base.td
浏览文件 @
4149cabe
文件已移动
paddle/infrt/dialect/phi/infrt_phi_kernel.td
→
paddle/infrt/dialect/phi/i
r/i
nfrt_phi_kernel.td
浏览文件 @
4149cabe
...
...
@@ -4,7 +4,7 @@
include "mlir/Interfaces/SideEffectInterfaces.td"
include "mlir/IR/OpBase.td"
include "paddle/infrt/dialect/infrt_base.td"
include "paddle/infrt/dialect/phi/infrt_phi_base.td"
include "paddle/infrt/dialect/phi/i
r/i
nfrt_phi_base.td"
def PHI_KernelDialect : Dialect {
let name = "phi_kernel";
...
...
paddle/infrt/dialect/phi/infrt_phi_tensor.cc
→
paddle/infrt/dialect/phi/i
r/i
nfrt_phi_tensor.cc
浏览文件 @
4149cabe
...
...
@@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/infrt/dialect/phi/infrt_phi_tensor.h"
#include "paddle/infrt/dialect/phi/i
r/i
nfrt_phi_tensor.h"
#include <mlir/IR/BuiltinTypes.h>
#include "paddle/infrt/dialect/phi/infrt_phi_tensorDialect.cpp.inc"
#include "paddle/infrt/dialect/phi/infrt_phi_tensorTypes.cpp.inc"
#include "paddle/infrt/dialect/phi/i
r/i
nfrt_phi_tensorDialect.cpp.inc"
#include "paddle/infrt/dialect/phi/i
r/i
nfrt_phi_tensorTypes.cpp.inc"
namespace
infrt
{
namespace
phi
{
...
...
@@ -25,7 +25,7 @@ namespace phi {
void
PHIDenseTensorDialect
::
initialize
()
{
#define GET_OP_LIST
addOperations
<
#include "paddle/infrt/dialect/phi/infrt_phi_tensor.cpp.inc"
#include "paddle/infrt/dialect/phi/i
r/i
nfrt_phi_tensor.cpp.inc"
>
();
}
...
...
@@ -33,4 +33,4 @@ void PHIDenseTensorDialect::initialize() {
}
// namespace infrt
#define GET_OP_CLASSES
#include "paddle/infrt/dialect/phi/infrt_phi_tensor.cpp.inc" // NOLINT
#include "paddle/infrt/dialect/phi/i
r/i
nfrt_phi_tensor.cpp.inc" // NOLINT
paddle/infrt/dialect/phi/infrt_phi_tensor.h
→
paddle/infrt/dialect/phi/i
r/i
nfrt_phi_tensor.h
浏览文件 @
4149cabe
...
...
@@ -29,11 +29,11 @@
#include <mlir/Interfaces/LoopLikeInterface.h>
#include <mlir/Interfaces/SideEffectInterfaces.h>
#include "paddle/infrt/dialect/phi/infrt_phi_tensorDialect.h.inc"
#include "paddle/infrt/dialect/phi/infrt_phi_tensorTypes.h.inc"
#include "paddle/infrt/dialect/phi/i
r/i
nfrt_phi_tensorDialect.h.inc"
#include "paddle/infrt/dialect/phi/i
r/i
nfrt_phi_tensorTypes.h.inc"
#include "paddle/infrt/dialect/dense_tensor.h"
#include "paddle/infrt/dialect/phi/phi_base.h"
#include "paddle/infrt/dialect/phi/
ir/
phi_base.h"
// NOLINT
#define GET_OP_CLASSES
#include "paddle/infrt/dialect/phi/infrt_phi_tensor.h.inc"
#include "paddle/infrt/dialect/phi/i
r/i
nfrt_phi_tensor.h.inc"
paddle/infrt/dialect/phi/infrt_phi_tensor.td
→
paddle/infrt/dialect/phi/i
r/i
nfrt_phi_tensor.td
浏览文件 @
4149cabe
...
...
@@ -2,7 +2,7 @@
#else
#define PHI_TENSOR
include "paddle/infrt/dialect/phi/infrt_phi_base.td"
include "paddle/infrt/dialect/phi/i
r/i
nfrt_phi_base.td"
include "mlir/Interfaces/SideEffectInterfaces.td"
include "mlir/IR/OpBase.td"
include "paddle/infrt/dialect/infrt_base.td"
...
...
paddle/infrt/dialect/phi/phi_base.cc
→
paddle/infrt/dialect/phi/
ir/
phi_base.cc
浏览文件 @
4149cabe
...
...
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "paddle/infrt/dialect/phi/phi_base.h"
#include "paddle/infrt/dialect/phi/
ir/
phi_base.h"
#include <mlir/IR/Builders.h>
#include <mlir/IR/Dialect.h>
...
...
@@ -21,8 +21,8 @@
#include <mlir/IR/TypeUtilities.h>
#include <mlir/IR/Types.h>
#include "paddle/infrt/common/global.h"
#include "paddle/infrt/dialect/phi/infrt_phi_base.cpp.inc"
#include "paddle/infrt/dialect/phi/infrt_phi_baseDialect.cpp.inc"
#include "paddle/infrt/dialect/phi/i
r/i
nfrt_phi_base.cpp.inc"
#include "paddle/infrt/dialect/phi/i
r/i
nfrt_phi_baseDialect.cpp.inc"
namespace
infrt
{
namespace
phi
{
...
...
@@ -51,11 +51,11 @@ void PHIDialect::printType(::mlir::Type type,
void
PHIDialect
::
initialize
()
{
addOperations
<
#define GET_OP_LIST
#include "paddle/infrt/dialect/phi/infrt_phi_base.cpp.inc" // NOLINT
#include "paddle/infrt/dialect/phi/i
r/i
nfrt_phi_base.cpp.inc" // NOLINT
>
();
addTypes
<
#define GET_TYPEDEF_LIST
#include "paddle/infrt/dialect/phi/infrt_phi_baseTypes.cpp.inc" // NOLINT
#include "paddle/infrt/dialect/phi/i
r/i
nfrt_phi_baseTypes.cpp.inc" // NOLINT
>
();
}
...
...
@@ -81,4 +81,4 @@ mlir::Type PHIDialect::parseType(mlir::DialectAsmParser& parser) const {
}
// namespace infrt
#define GET_TYPEDEF_CLASSES
#include "paddle/infrt/dialect/phi/infrt_phi_baseTypes.cpp.inc" // NOLINT
#include "paddle/infrt/dialect/phi/i
r/i
nfrt_phi_baseTypes.cpp.inc" // NOLINT
paddle/infrt/dialect/phi/phi_base.h
→
paddle/infrt/dialect/phi/
ir/
phi_base.h
浏览文件 @
4149cabe
...
...
@@ -19,11 +19,13 @@
#include <string>
#include "paddle/infrt/dialect/phi/infrt_phi_base.h.inc"
#include "paddle/infrt/dialect/phi/infrt_phi_baseDialect.h.inc"
#include "paddle/infrt/dialect/phi/ir/infrt_phi_baseDialect.h.inc"
#define GET_TYPEDEF_CLASSES
#include "paddle/infrt/dialect/phi/infrt_phi_baseTypes.h.inc"
#include "paddle/infrt/dialect/phi/ir/infrt_phi_baseTypes.h.inc"
#define GET_OP_CLASSES
#include "paddle/infrt/dialect/phi/ir/infrt_phi_base.h.inc"
namespace
mlir
{
namespace
OpTrait
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录