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
f096c06f
Commit
f096c06f
authored
Dec 31, 2019
by
Zhi
Committed by
Tianqi Chen
Dec 31, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make adt tag signed (#4605)
parent
6b11ffb9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
include/tvm/runtime/container.h
+5
-5
No files found.
include/tvm/runtime/container.h
View file @
f096c06f
...
...
@@ -164,7 +164,7 @@ class InplaceArrayBase {
class
ADTObj
:
public
Object
,
public
InplaceArrayBase
<
ADTObj
,
ObjectRef
>
{
public
:
/*! \brief The tag representing the constructor used. */
u
int32_t
tag
;
int32_t
tag
;
/*! \brief Number of fields in the ADT object. */
uint32_t
size
;
// The fields of the structure follows directly in memory.
...
...
@@ -211,7 +211,7 @@ class ADT : public ObjectRef {
* \param fields The fields of the ADT object.
* \return The constructed ADT object reference.
*/
ADT
(
u
int32_t
tag
,
std
::
vector
<
ObjectRef
>
fields
)
ADT
(
int32_t
tag
,
std
::
vector
<
ObjectRef
>
fields
)
:
ADT
(
tag
,
fields
.
begin
(),
fields
.
end
()){};
/*!
...
...
@@ -222,7 +222,7 @@ class ADT : public ObjectRef {
* \return The constructed ADT object reference.
*/
template
<
typename
Iterator
>
ADT
(
u
int32_t
tag
,
Iterator
begin
,
Iterator
end
)
{
ADT
(
int32_t
tag
,
Iterator
begin
,
Iterator
end
)
{
size_t
num_elems
=
std
::
distance
(
begin
,
end
);
auto
ptr
=
make_inplace_array_object
<
ADTObj
,
ObjectRef
>
(
num_elems
);
ptr
->
tag
=
tag
;
...
...
@@ -236,7 +236,7 @@ class ADT : public ObjectRef {
* \param init The initializer list of fields.
* \return The constructed ADT object reference.
*/
ADT
(
u
int32_t
tag
,
std
::
initializer_list
<
ObjectRef
>
init
)
ADT
(
int32_t
tag
,
std
::
initializer_list
<
ObjectRef
>
init
)
:
ADT
(
tag
,
init
.
begin
(),
init
.
end
()){};
/*!
...
...
@@ -252,7 +252,7 @@ class ADT : public ObjectRef {
/*!
* \brief Return the ADT tag.
*/
size
_t
tag
()
const
{
return
operator
->
()
->
tag
;
}
int32
_t
tag
()
const
{
return
operator
->
()
->
tag
;
}
/*!
* \brief Return the number of fields.
...
...
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