2
2
3
3
#my_poly = #polynomial.int_polynomial <1 + x **1024 >
4
4
#ring = #polynomial.ring <coefficientType =i16 , coefficientModulus =256 :i32 , polynomialModulus =#my_poly >
5
- !ty = !polynomial.polynomial <#ring >
5
+ !ty = !polynomial.polynomial <ring = #ring >
6
6
7
7
func.func @test_from_tensor_too_large_coeffs () {
8
8
%two = arith.constant 2 : i32
@@ -17,11 +17,11 @@ func.func @test_from_tensor_too_large_coeffs() {
17
17
18
18
#my_poly = #polynomial.int_polynomial <1 + x **4 >
19
19
#ring = #polynomial.ring <coefficientType =i32 , coefficientModulus =256 :i32 , polynomialModulus =#my_poly >
20
- !ty = !polynomial.polynomial <#ring >
20
+ !ty = !polynomial.polynomial <ring = #ring >
21
21
func.func @test_from_tensor_wrong_tensor_type () {
22
22
%two = arith.constant 2 : i32
23
23
%coeffs1 = tensor.from_elements %two , %two , %two , %two , %two : tensor <5 xi32 >
24
- // expected-error@below {{input type 'tensor<5xi32>' does not match output type '!polynomial.polynomial<#polynomial. ring<coefficientType = i32, coefficientModulus = 256 : i32, polynomialModulus = <1 + x**4>>>'}}
24
+ // expected-error@below {{input type 'tensor<5xi32>' does not match output type '!polynomial.polynomial<ring = <coefficientType = i32, coefficientModulus = 256 : i32, polynomialModulus = <1 + x**4>>>'}}
25
25
// expected-note@below {{at most the degree of the polynomialModulus of the output type's ring attribute}}
26
26
%poly = polynomial.from_tensor %coeffs1 : tensor <5 xi32 > -> !ty
27
27
return
@@ -31,9 +31,9 @@ func.func @test_from_tensor_wrong_tensor_type() {
31
31
32
32
#my_poly = #polynomial.int_polynomial <1 + x **4 >
33
33
#ring = #polynomial.ring <coefficientType =i32 , coefficientModulus =256 :i32 , polynomialModulus =#my_poly >
34
- !ty = !polynomial.polynomial <#ring >
34
+ !ty = !polynomial.polynomial <ring = #ring >
35
35
func.func @test_to_tensor_wrong_output_tensor_type (%arg0 : !ty ) {
36
- // expected-error@below {{input type '!polynomial.polynomial<#polynomial. ring<coefficientType = i32, coefficientModulus = 256 : i32, polynomialModulus = <1 + x**4>>>' does not match output type 'tensor<5xi32>'}}
36
+ // expected-error@below {{input type '!polynomial.polynomial<ring = <coefficientType = i32, coefficientModulus = 256 : i32, polynomialModulus = <1 + x**4>>>' does not match output type 'tensor<5xi32>'}}
37
37
// expected-note@below {{at most the degree of the polynomialModulus of the input type's ring attribute}}
38
38
%tensor = polynomial.to_tensor %arg0 : !ty -> tensor <5 xi32 >
39
39
return
@@ -43,7 +43,7 @@ func.func @test_to_tensor_wrong_output_tensor_type(%arg0 : !ty) {
43
43
44
44
#my_poly = #polynomial.int_polynomial <1 + x **1024 >
45
45
#ring = #polynomial.ring <coefficientType =i16 , coefficientModulus =256 :i32 , polynomialModulus =#my_poly >
46
- !ty = !polynomial.polynomial <#ring >
46
+ !ty = !polynomial.polynomial <ring = #ring >
47
47
48
48
func.func @test_mul_scalar_wrong_type (%arg0: !ty ) -> !ty {
49
49
%scalar = arith.constant 2 : i32 // should be i16
@@ -56,7 +56,7 @@ func.func @test_mul_scalar_wrong_type(%arg0: !ty) -> !ty {
56
56
57
57
#my_poly = #polynomial.int_polynomial <-1 + x **1024 >
58
58
#ring = #polynomial.ring <coefficientType =i16 , coefficientModulus =256 :i16 , polynomialModulus =#my_poly , primitiveRoot =31 :i16 >
59
- !poly_ty = !polynomial.polynomial <#ring >
59
+ !poly_ty = !polynomial.polynomial <ring = #ring >
60
60
61
61
// CHECK-NOT: @test_invalid_ntt
62
62
// CHECK-NOT: polynomial.ntt
@@ -70,7 +70,7 @@ func.func @test_invalid_ntt(%0 : !poly_ty) {
70
70
71
71
#my_poly = #polynomial.int_polynomial <-1 + x **1024 >
72
72
#ring = #polynomial.ring <coefficientType =i16 , coefficientModulus =256 :i16 , polynomialModulus =#my_poly , primitiveRoot =31 :i16 >
73
- !poly_ty = !polynomial.polynomial <#ring >
73
+ !poly_ty = !polynomial.polynomial <ring = #ring >
74
74
75
75
// CHECK-NOT: @test_invalid_ntt
76
76
// CHECK-NOT: polynomial.ntt
@@ -85,7 +85,7 @@ func.func @test_invalid_ntt(%0 : !poly_ty) {
85
85
#my_poly = #polynomial.int_polynomial <-1 + x **1024 >
86
86
#ring = #polynomial.ring <coefficientType =i16 , coefficientModulus =256 :i16 , polynomialModulus =#my_poly >
87
87
#ring1 = #polynomial.ring <coefficientType =i16 , coefficientModulus =257 :i16 , polynomialModulus =#my_poly , primitiveRoot =31 :i16 >
88
- !poly_ty = !polynomial.polynomial <#ring >
88
+ !poly_ty = !polynomial.polynomial <ring = #ring >
89
89
90
90
// CHECK-NOT: @test_invalid_intt
91
91
// CHECK-NOT: polynomial.intt
@@ -99,7 +99,7 @@ func.func @test_invalid_intt(%0 : tensor<1024xi32, #ring1>) {
99
99
100
100
#my_poly = #polynomial.int_polynomial <-1 + x **1024 >
101
101
#ring = #polynomial.ring <coefficientType =i16 , coefficientModulus =256 :i16 , polynomialModulus =#my_poly , primitiveRoot =31 :i16 >
102
- !poly_ty = !polynomial.polynomial <#ring >
102
+ !poly_ty = !polynomial.polynomial <ring = #ring >
103
103
104
104
// CHECK-NOT: @test_invalid_intt
105
105
// CHECK-NOT: polynomial.intt
@@ -114,7 +114,7 @@ func.func @test_invalid_intt(%0 : tensor<1025xi32, #ring>) {
114
114
115
115
#my_poly = #polynomial.int_polynomial <-1 + x **1024 >
116
116
#ring = #polynomial.ring <coefficientType =i16 , coefficientModulus =256 :i16 , polynomialModulus =#my_poly >
117
- !poly_ty = !polynomial.polynomial <#ring >
117
+ !poly_ty = !polynomial.polynomial <ring = #ring >
118
118
119
119
// CHECK-NOT: @test_invalid_ntt
120
120
// CHECK-NOT: polynomial.ntt
@@ -129,7 +129,7 @@ func.func @test_invalid_ntt(%0 : !poly_ty) {
129
129
#my_poly = #polynomial.int_polynomial <-1 + x **8 >
130
130
// A valid root is 31
131
131
#ring = #polynomial.ring <coefficientType =i16 , coefficientModulus =256 :i16 , polynomialModulus =#my_poly , primitiveRoot =32 :i16 >
132
- !poly_ty = !polynomial.polynomial <#ring >
132
+ !poly_ty = !polynomial.polynomial <ring = #ring >
133
133
134
134
// CHECK-NOT: @test_invalid_intt
135
135
// CHECK-NOT: polynomial.intt
0 commit comments