tqchen commented on code in PR #370:
URL: https://github.com/apache/tvm-ffi/pull/370#discussion_r2670160829


##########
src/ffi/extra/structural_hash.cc:
##########
@@ -150,15 +150,16 @@ class StructuralHashHandler {
                 std::swap(allow_free_var, map_free_vars_);
                 uint64_t hash_value = HashAny(val);
                 std::swap(allow_free_var, map_free_vars_);
-                return details::StableHashCombine(init_hash, hash_value);
+                return 
static_cast<int64_t>(details::StableHashCombine(init_hash, hash_value));

Review Comment:
   likely we need a bit cast here, although std::bit_cast is only available in 
c++20, maybe we can use an union based caster to implement details::BitCast, 
perhaps in 
https://github.com/apache/tvm-ffi/blob/main/include/tvm/ffi/base_details.h
   
   cc @junrushao 



##########
src/ffi/extra/structural_hash.cc:
##########
@@ -150,15 +150,16 @@ class StructuralHashHandler {
                 std::swap(allow_free_var, map_free_vars_);
                 uint64_t hash_value = HashAny(val);
                 std::swap(allow_free_var, map_free_vars_);
-                return details::StableHashCombine(init_hash, hash_value);
+                return 
static_cast<int64_t>(details::StableHashCombine(init_hash, hash_value));

Review Comment:
   likely we need a bit cast here. Static cast will have issues. although 
std::bit_cast is only available in c++20, maybe we can use an union based 
caster to implement details::BitCast, perhaps in 
https://github.com/apache/tvm-ffi/blob/main/include/tvm/ffi/base_details.h
   
   cc @junrushao 



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to