Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[runtime][Fix] make adt tag signed #4605

Merged
merged 1 commit into from
Jan 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions include/tvm/runtime/container.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class InplaceArrayBase {
class ADTObj : public Object, public InplaceArrayBase<ADTObj, ObjectRef> {
public:
/*! \brief The tag representing the constructor used. */
uint32_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.
Expand Down Expand Up @@ -211,7 +211,7 @@ class ADT : public ObjectRef {
* \param fields The fields of the ADT object.
* \return The constructed ADT object reference.
*/
ADT(uint32_t tag, std::vector<ObjectRef> fields)
ADT(int32_t tag, std::vector<ObjectRef> fields)
: ADT(tag, fields.begin(), fields.end()){};

/*!
Expand All @@ -222,7 +222,7 @@ class ADT : public ObjectRef {
* \return The constructed ADT object reference.
*/
template <typename Iterator>
ADT(uint32_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;
Expand All @@ -236,7 +236,7 @@ class ADT : public ObjectRef {
* \param init The initializer list of fields.
* \return The constructed ADT object reference.
*/
ADT(uint32_t tag, std::initializer_list<ObjectRef> init)
ADT(int32_t tag, std::initializer_list<ObjectRef> init)
: ADT(tag, init.begin(), init.end()){};

/*!
Expand All @@ -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.
Expand Down