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
162ed02c
Commit
162ed02c
authored
Nov 02, 2016
by
tqchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new functor
parent
0153649e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
5 deletions
+33
-5
HalideIR
+1
-1
include/tvm/ir.h
+3
-3
src/lang/ir.cc
+1
-1
tests/cpp/ir_functor_test.cc
+28
-0
No files found.
HalideIR
@
7906ae1e
Subproject commit
bd94f8c8e41b46ae7ca69a3405aac7463a4e23d5
Subproject commit
7906ae1edea96e416e338ea21b8bc248d1d6411c
include/tvm/ir
_node
.h
→
include/tvm/ir.h
View file @
162ed02c
/*!
* Copyright (c) 2016 by Contributors
* \file ir
_node
.h
* \file ir.h
* \brief Additional high level nodes in the IR
*/
#ifndef TVM_IR_
NODE_
H_
#define TVM_IR_
NODE_
H_
#ifndef TVM_IR_H_
#define TVM_IR_H_
#include <ir/Expr.h>
#include <ir/IR.h>
...
...
src/lang/ir
_node
.cc
→
src/lang/ir.cc
View file @
162ed02c
...
...
@@ -4,7 +4,7 @@
*/
#include <tvm/base.h>
#include <tvm/expr.h>
#include <tvm/ir
_node
.h>
#include <tvm/ir.h>
#include <ir/IR.h>
#include <ir/IRPrinter.h>
#include <memory>
...
...
tests/cpp/ir_functor_test.cc
0 → 100644
View file @
162ed02c
#include <dmlc/logging.h>
#include <gtest/gtest.h>
#include <tvm/tvm.h>
#include <tvm/ir_node.h>
TEST
(
IRF
,
Basic
)
{
using
namespace
Halide
::
Internal
;
using
namespace
tvm
;
Var
x
(
"x"
);
auto
z
=
x
+
1
;
IRFunctor
<
int
(
const
IRNodeRef
&
n
,
int
b
)
>
f
;
LOG
(
INFO
)
<<
"x"
;
f
.
set_dispatch
<
Variable
>
([](
const
Variable
*
n
,
int
b
)
{
return
b
;
});
f
.
set_dispatch
<
Add
>
([](
const
Add
*
n
,
int
b
)
{
return
b
+
2
;
});
CHECK_EQ
(
f
(
x
,
2
),
2
);
CHECK_EQ
(
f
(
z
,
2
),
4
);
}
int
main
(
int
argc
,
char
**
argv
)
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
testing
::
FLAGS_gtest_death_test_style
=
"threadsafe"
;
return
RUN_ALL_TESTS
();
}
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