1 #include <gtest/gtest.h> 4 #include <ATen/DLConvertor.h> 5 #include <ATen/Parallel.h> 13 TEST(TestParallel, TestParallel) {
25 ASSERT_TRUE(a.sum(0).equal(as));
28 TEST(TestParallel, NestedParallel) {
29 Tensor a = ones({1024, 1024});
30 auto expected = a.sum();
32 at::parallel_for(0, 10, 1, [&](int64_t begin, int64_t end) {
34 ASSERT_TRUE(a.sum().equal(expected));
39 TEST(TestParallel, Exceptions) {
42 at::parallel_for(0, 10, 1, [&](int64_t begin, int64_t end) {
43 throw std::runtime_error(
"exception");
49 at::parallel_for(0, 1, 1000, [&](int64_t begin, int64_t end) {
50 throw std::runtime_error(
"exception");
Flush-To-Zero and Denormals-Are-Zero mode.