Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tvm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cld
ml
tvm
Commits
162ed02c
Commit
162ed02c
authored
8 years ago
by
tqchen
Browse files
Options
Downloads
Patches
Plain Diff
Add new functor
parent
0153649e
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
HalideIR
+1
-1
1 addition, 1 deletion
HalideIR
include/tvm/ir.h
+3
-3
3 additions, 3 deletions
include/tvm/ir.h
src/lang/ir.cc
+1
-1
1 addition, 1 deletion
src/lang/ir.cc
tests/cpp/ir_functor_test.cc
+28
-0
28 additions, 0 deletions
tests/cpp/ir_functor_test.cc
with
33 additions
and
5 deletions
HalideIR
@
7906ae1e
Compare
bd94f8c8
...
7906ae1e
Subproject commit
bd94f8c8e41b46ae7ca69a3405aac7463a4e23d5
Subproject commit
7906ae1edea96e416e338ea21b8bc248d1d6411c
This diff is collapsed.
Click to expand it.
include/tvm/ir
_node
.h
→
include/tvm/ir.h
+
3
−
3
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>
...
...
This diff is collapsed.
Click to expand it.
src/lang/ir
_node
.cc
→
src/lang/ir.cc
+
1
−
1
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>
...
...
This diff is collapsed.
Click to expand it.
tests/cpp/ir_functor_test.cc
0 → 100644
+
28
−
0
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
();
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment