Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
dac6b528
Commit
dac6b528
authored
Oct 22, 2016
by
tqchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
checkin stmt
parent
cf0fc361
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
39 deletions
+78
-39
include/tvm/base.h
+5
-0
include/tvm/codegen.h
+0
-39
include/tvm/stmt_node.h
+73
-0
No files found.
include/tvm/base.h
View file @
dac6b528
...
@@ -37,6 +37,7 @@ enum DataType : int {
...
@@ -37,6 +37,7 @@ enum DataType : int {
* \note kOtherNodes could mean more than one node type.
* \note kOtherNodes could mean more than one node type.
*/
*/
enum
NodeType
{
enum
NodeType
{
// expr nodes
kVarNode
,
kVarNode
,
kIntNode
,
kIntNode
,
kFloatNode
,
kFloatNode
,
...
@@ -44,6 +45,10 @@ enum NodeType {
...
@@ -44,6 +45,10 @@ enum NodeType {
kBinaryOpNode
,
kBinaryOpNode
,
kReduceNode
,
kReduceNode
,
kTensorReadNode
,
kTensorReadNode
,
// stmt nodes
kStoreNode
,
kForRangeNode
,
kIfThenElseNode
,
kOtherNodes
kOtherNodes
};
};
...
...
include/tvm/codegen.h
deleted
100644 → 0
View file @
cf0fc361
/*!
* Copyright (c) 2016 by Contributors
* \file codegen.h
* \brief Common data structure for codegen
*/
#ifndef TVM_CODEGEN_H_
#define TVM_CODEGEN_H_
namespace
tvm
{
// incomplete spec.
struct
Assign
:
public
Node
{
Expr
src
;
Expr
offset
;
Var
ptr
;
};
struct
Assign
:
public
Node
{
Expr
src
;
Expr
offset
;
Var
ptr
;
};
struct
Loop
:
public
Node
{
Expr
init
;
Expr
cond
;
Stmt
body
;
};
struct
IfThenElse
:
public
Node
{
Expr
cond
;
Expr
then_
;
Stmt
else_
;
};
}
// namespace tvm
#endif // TVM_CODEGEN_H_
include/tvm/stmt_node.h
0 → 100644
View file @
dac6b528
/*!
* Copyright (c) 2016 by Contributors
* \file stmt.h
* \brief Common data structure for codegen
*/
#ifndef TVM_STMT_NODE_H_
#define TVM_STMT_NODE_H_
namespace
tvm
{
struct
StmtNode
:
public
Node
{
};
/*! \brief Store data into buffer */
struct
StoreNode
:
public
StmtNode
{
/*! \brief the variable representing the buffer */
Var
buffer
;
/*! \brief the buffer offset */
Expr
offset
;
/*! \brief The source expression*/
Expr
src
;
/*! \brief constructor */
StoreNode
()
{
node_type_
=
kStoreNode
;
}
void
VisitNodeRefFields
(
FNodeRefVisit
fvisit
)
override
{
fvisit
(
"buffer"
,
&
buffer
);
fvisit
(
"offset"
,
&
offset
);
fvisit
(
"src"
,
&
src
);
}
};
/*! \brief for loop in range */
struct
ForRangeNode
:
public
StmtNode
{
/*! \brief loop variable */
Var
loop_var
;
/*! \brief The loop range */
Range
range
;
/*! \brief body of the loop */
Stmt
body
;
/*! \brief constructor */
ForRangeNode
()
{
node_type_
=
kForRangeNode
;
}
void
VisitNodeRefFields
(
FNodeRefVisit
fvisit
)
override
{
fvisit
(
"loop_var"
,
&
loop_var
);
fvisit
(
"range"
,
&
range
);
fvisit
(
"body"
,
&
body
);
}
};
/*! \brief conditional expression */
struct
IfThenElseNode
:
public
StmtNode
{
/*! \brief The condition */
Expr
cond
;
/*! \brief The statement in then */
Stmt
then_body
;
/*! \brief The statement in else */
Stmt
else_body
;
/*! \brief constructor */
IfThenElseNode
()
{
node_type_
=
kIfThenElseNode
;
}
void
VisitNodeRefFields
(
FNodeRefVisit
fvisit
)
override
{
fvisit
(
"cond"
,
&
cond
);
fvisit
(
"then_body"
,
&
then_body
);
fvisit
(
"else_body"
,
&
else_body
);
}
};
}
// namespace tvm
#endif // TVM_CODEGEN_H_
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment