File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed
Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -167,9 +167,7 @@ class GreedySize : public GreedyBase {
167167 [](const BufferInfo& a, const BufferInfo& b) {
168168 if (a->size_bytes ->value == b->size_bytes ->value ) {
169169 if (a->conflicts .size () == b->conflicts .size ()) {
170- auto a_name_hash = std::hash<std::string>{}(a->name_hint ->data );
171- auto b_name_hash = std::hash<std::string>{}(b->name_hint ->data );
172- return a_name_hash > b_name_hash;
170+ return std::string (a->name_hint ->data ) > std::string (b->name_hint ->data );
173171 } else {
174172 return a->conflicts .size () > b->conflicts .size ();
175173 }
@@ -198,9 +196,7 @@ class GreedyConflicts : public GreedyBase {
198196 [](const BufferInfo& a, const BufferInfo& b) {
199197 if (a->conflicts .size () == b->conflicts .size ()) {
200198 if (a->size_bytes ->value == b->size_bytes ->value ) {
201- auto a_name_hash = std::hash<std::string>{}(a->name_hint ->data );
202- auto b_name_hash = std::hash<std::string>{}(b->name_hint ->data );
203- return a_name_hash > b_name_hash;
199+ return std::string (a->name_hint ->data ) > std::string (b->name_hint ->data );
204200 } else {
205201 return a->size_bytes ->value > b->size_bytes ->value ;
206202 }
Original file line number Diff line number Diff line change @@ -149,9 +149,9 @@ def _test():
149149 buffer_info_arr = [bi_a , bi_b , bi_c ]
150150 fusmp_algo = tvm .get_global_func (f"tir.usmp.algo.{ algorithm } " )
151151 buffer_pool_allocations = fusmp_algo (buffer_info_arr )
152- assert buffer_pool_allocations [bi_a ].byte_offset == 0
153- assert buffer_pool_allocations [bi_b ].byte_offset == 20
154- assert buffer_pool_allocations [bi_c ].byte_offset == 10
152+ assert buffer_pool_allocations [bi_a ].byte_offset == 20
153+ assert buffer_pool_allocations [bi_b ].byte_offset == 10
154+ assert buffer_pool_allocations [bi_c ].byte_offset == 0
155155
156156 # This is tested for several times to check stability
157157 for x in range (0 , 10 ):
You can’t perform that action at this time.
0 commit comments