d-smirnov commented on a change in pull request #10189:
URL: https://github.com/apache/tvm/pull/10189#discussion_r832298480
##########
File path: include/tvm/tir/usmp/utils.h
##########
@@ -44,6 +44,126 @@ constexpr const char* kUSMPAlgorithmOption =
"tir.usmp.algorithm";
namespace tir {
namespace usmp {
+/*
+ * \brief The ConstantInfoNode contains numeric literal in RO pool
+ */
+struct ConstantInfoNode : public Object {
+ String name_hint;
+ Integer byte_alignment;
+ Integer byte_offset;
+ runtime::NDArray data;
+
+ void VisitAttrs(tvm::AttrVisitor* v) {
+ v->Visit("constant_names", &name_hint);
+ v->Visit("constant_alignment", &byte_alignment);
+ v->Visit("constant_offsets", &byte_offset);
+ v->Visit("constant_data", &data);
+ }
+
+ bool SEqualReduce(const ConstantInfoNode* other, SEqualReducer equal) const {
+ return equal(name_hint, other->name_hint) && equal(byte_alignment,
other->byte_alignment) &&
+ equal(byte_offset, other->byte_offset) && equal(data, other->data);
+ }
+
+ void SHashReduce(SHashReducer hash_reduce) const {
+ hash_reduce(name_hint);
+ hash_reduce(byte_alignment);
+ hash_reduce(byte_offset);
+ hash_reduce(data);
+ }
+
+ static constexpr const char* _type_key = "tir.usmp.ConstantInfo";
+ static constexpr bool _type_has_method_sequal_reduce = true;
+ static constexpr bool _type_has_method_shash_reduce = true;
+ TVM_DECLARE_FINAL_OBJECT_INFO(ConstantInfoNode, Object);
+};
+
+class ConstantInfo : public ObjectRef {
+ public:
+ TVM_DLL ConstantInfo(String name, Integer byte_alignment, Integer
byte_offset,
+ runtime::NDArray data);
+ TVM_DEFINE_MUTABLE_OBJECT_REF_METHODS(ConstantInfo, ObjectRef,
ConstantInfoNode);
+};
+
+#if 0
Review comment:
removed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]