Refactor CPU compile preamble (#708)

* refactor cpu preamble

* fix include order

* fix some issues'

* fixes for linux

* try to fix includes

* add back warning suppression

* more linux fixes
This commit is contained in:
Awni Hannun
2024-02-19 06:12:53 -08:00
committed by GitHub
parent 0925af43b0
commit 1a4f4c5ea6
12 changed files with 732 additions and 1355 deletions

View File

@@ -38,9 +38,9 @@ inline bool operator>(const complex64_t& a, const complex64_t& b) {
inline complex64_t operator%(complex64_t a, complex64_t b) {
auto real = a.real() - (b.real() * static_cast<int64_t>(a.real() / b.real()));
auto imag = a.imag() - (b.imag() * static_cast<int64_t>(a.imag() / b.imag()));
if (real != 0 && (real < 0 != b.real() < 0))
if (real != 0 && ((real < 0) != (b.real() < 0)))
real += b.real();
if (imag != 0 && (imag < 0 != b.imag() < 0))
if (imag != 0 && ((imag < 0) != (b.imag() < 0)))
imag += b.imag();
return {real, imag};
}