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

@@ -1002,7 +1002,7 @@ TEST_CASE("test arithmetic unary ops") {
CHECK_EQ(exp(x).item<float>(), 1.0);
x = array(2.0);
CHECK_EQ(exp(x).item<float>(), std::exp(2.0f));
CHECK_EQ(exp(x).item<float>(), doctest::Approx(std::exp(2.0f)));
CHECK(array_equal(exp(array({})), array({})).item<bool>());
@@ -1012,7 +1012,7 @@ TEST_CASE("test arithmetic unary ops") {
// Integer input type
x = array(2);
CHECK_EQ(x.dtype(), int32);
CHECK_EQ(exp(x).item<float>(), std::exp(2.0f));
CHECK_EQ(exp(x).item<float>(), doctest::Approx(std::exp(2.0f)));
// Input is irregularly strided
x = broadcast_to(array(1.0f), {2, 2, 2});
@@ -1020,7 +1020,7 @@ TEST_CASE("test arithmetic unary ops") {
x = split(array({0.0f, 1.0f, 2.0f, 3.0f}, {2, 2}), 2, 1)[0];
auto expected = array({std::exp(0.0f), std::exp(2.0f)}, {2, 1});
CHECK(array_equal(exp(x), expected).item<bool>());
CHECK(allclose(exp(x), expected).item<bool>());
}
// Test sine