MasterJH5574 opened a new pull request, #18221:
URL: https://github.com/apache/tvm/pull/18221
This PR fixes the JSON parser and writer for the support of the fast-math
flag.
Prior to this PR, there would be the following error when compiling TVM with
fast-math. This PR fixes this issue.
```
/home/ruihangl/Workspace/tvm/ffi/src/ffi/extra/json_writer.cc: In static
member function ‘static bool
tvm::ffi::json::JSONWriter::FastMathSafeIsNaN(double)’:
/home/ruihangl/Workspace/tvm/ffi/src/ffi/extra/json_writer.cc:69:22: error:
dereferencing type-punned pointer will break strict-aliasing rules
[-Werror=strict-aliasing]
69 | uint64_t bits = *reinterpret_cast<const uint64_t*>(&x);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ruihangl/Workspace/tvm/ffi/src/ffi/extra/json_writer.cc: In static
member function ‘static bool
tvm::ffi::json::JSONWriter::FastMathSafeIsInf(double)’:
/home/ruihangl/Workspace/tvm/ffi/src/ffi/extra/json_writer.cc:84:22: error:
dereferencing type-punned pointer will break strict-aliasing rules
[-Werror=strict-aliasing]
84 | uint64_t bits = *reinterpret_cast<const uint64_t*>(&x);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
--
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]