| 35 | // ============================================================================ |
| 36 | |
| 37 | TEST(ExpressionTemplates, FunctorComposition2Way) { |
| 38 | // Test 2-way functor composition: g(f(x)) |
| 39 | ops::exp_op f; |
| 40 | ops::neg_op g; |
| 41 | |
| 42 | auto composed = ops::compose(f, g); |
| 43 | |
| 44 | // Test on CPU |
| 45 | float x = 2.0f; |
| 46 | float result = composed(x); |
| 47 | float expected = -std::exp(x); |
| 48 | |
| 49 | EXPECT_NEAR(result, expected, 1e-5f); |
| 50 | } |
| 51 | |
| 52 | TEST(ExpressionTemplates, FunctorComposition3Way) { |
| 53 | // Test 3-way functor composition: h(g(f(x))) |
nothing calls this directly
no test coverage detected