|
3 | 3 | !PF1 = !field.pf<7:i255> |
4 | 4 | !poly_ty1 = !poly.polynomial<!PF1, 3> |
5 | 5 | !poly_ty2 = !poly.polynomial<!PF1, 4> |
6 | | -#elem = #field.pf_elem<2:i255> : !PF1 |
7 | | -#root = #poly.primitive_root<root=#elem, degree=4> |
| 6 | +#elem = #field.pf_elem<6:i255> : !PF1 |
| 7 | +#root_of_unity = #field.root_of_unity<#elem, 2:i255> |
| 8 | +#root = #poly.primitive_root<root_of_unity=#root_of_unity> |
8 | 9 |
|
9 | 10 | // FIXME(batzor): without this line, the test will fail with the following error: |
10 | 11 | // LLVM ERROR: can't create Attribute 'mlir::polynomial::IntPolynomialAttr' because storage uniquer isn't initialized: the dialect was likely not loaded, or the attribute wasn't added with addAttributes<...>() in the Dialect::initialize() method. |
@@ -68,16 +69,16 @@ func.func @test_lower_from_tensor(%t : tensor<4x!PF1>) -> !poly_ty1 { |
68 | 69 |
|
69 | 70 | // CHECK-LABEL: @test_lower_ntt |
70 | 71 | // CHECK-SAME: (%[[INPUT:.*]]: [[T:.*]]) -> [[T]] { |
71 | | -func.func @test_lower_ntt(%input : tensor<4x!PF1>) -> tensor<4x!PF1> { |
| 72 | +func.func @test_lower_ntt(%input : tensor<2x!PF1>) -> tensor<2x!PF1> { |
72 | 73 | // CHECK-NOT: poly.ntt |
73 | | - %res = poly.ntt %input {root=#root} : tensor<4x!PF1> |
74 | | - return %res: tensor<4x!PF1> |
| 74 | + %res = poly.ntt %input {root=#root} : tensor<2x!PF1> |
| 75 | + return %res: tensor<2x!PF1> |
75 | 76 | } |
76 | 77 |
|
77 | 78 | // CHECK-LABEL: @test_lower_intt |
78 | 79 | // CHECK-SAME: (%[[INPUT:.*]]: [[T:.*]]) -> [[P:.*]] { |
79 | | -func.func @test_lower_intt(%input : tensor<4x!PF1>) -> tensor<4x!PF1> { |
| 80 | +func.func @test_lower_intt(%input : tensor<2x!PF1>) -> tensor<2x!PF1> { |
80 | 81 | // CHECK-NOT: poly.intt |
81 | | - %res = poly.intt %input {root=#root} : tensor<4x!PF1> |
82 | | - return %res: tensor<4x!PF1> |
| 82 | + %res = poly.intt %input {root=#root} : tensor<2x!PF1> |
| 83 | + return %res: tensor<2x!PF1> |
83 | 84 | } |
0 commit comments