@@ -117,11 +117,11 @@ def setup(self, dtype):
117
117
self .two_dim = np .arange (240000 , dtype = dtype ).reshape (400 , 600 )
118
118
self .three_dim_small = np .arange (10000 , dtype = dtype ).reshape (10 ,100 ,10 )
119
119
self .three_dim = np .arange (24000 , dtype = dtype ).reshape (20 , 30 , 40 )
120
- # non_contigous arrays
121
- self .non_contigous_dim1_small = np .arange (1 , 80 , 2 , dtype = dtype )
122
- self .non_contigous_dim1 = np .arange (1 , 4000 , 2 , dtype = dtype )
123
- self .non_contigous_dim2 = np .arange (1 , 2400 , 2 , dtype = dtype ).reshape (30 , 40 )
124
- self .non_contigous_dim3 = np .arange (1 , 48000 , 2 , dtype = dtype ).reshape (20 , 30 , 40 )
120
+ # non_contiguous arrays
121
+ self .non_contiguous_dim1_small = np .arange (1 , 80 , 2 , dtype = dtype )
122
+ self .non_contiguous_dim1 = np .arange (1 , 4000 , 2 , dtype = dtype )
123
+ self .non_contiguous_dim2 = np .arange (1 , 2400 , 2 , dtype = dtype ).reshape (30 , 40 )
124
+ self .non_contiguous_dim3 = np .arange (1 , 48000 , 2 , dtype = dtype ).reshape (20 , 30 , 40 )
125
125
126
126
# outer(a,b): trigger sum_of_products_contig_stride0_outcontig_two
127
127
def time_einsum_outer (self , dtype ):
@@ -130,19 +130,19 @@ def time_einsum_outer(self, dtype):
130
130
# multiply(a, b):trigger sum_of_products_contig_two
131
131
def time_einsum_multiply (self , dtype ):
132
132
np .einsum ("..., ..." , self .two_dim_small , self .three_dim , optimize = True )
133
-
133
+
134
134
# sum and multiply:trigger sum_of_products_contig_stride0_outstride0_two
135
135
def time_einsum_sum_mul (self , dtype ):
136
136
np .einsum (",i...->" , 300 , self .three_dim_small , optimize = True )
137
137
138
138
# sum and multiply:trigger sum_of_products_stride0_contig_outstride0_two
139
139
def time_einsum_sum_mul2 (self , dtype ):
140
140
np .einsum ("i...,->" , self .three_dim_small , 300 , optimize = True )
141
-
141
+
142
142
# scalar mul: trigger sum_of_products_stride0_contig_outcontig_two
143
143
def time_einsum_mul (self , dtype ):
144
144
np .einsum ("i,->i" , self .one_dim_big , 300 , optimize = True )
145
-
145
+
146
146
# trigger contig_contig_outstride0_two
147
147
def time_einsum_contig_contig (self , dtype ):
148
148
np .einsum ("ji,i->" , self .two_dim , self .one_dim_small , optimize = True )
@@ -151,30 +151,30 @@ def time_einsum_contig_contig(self, dtype):
151
151
def time_einsum_contig_outstride0 (self , dtype ):
152
152
np .einsum ("i->" , self .one_dim_big , optimize = True )
153
153
154
- # outer(a,b): non_contigous arrays
154
+ # outer(a,b): non_contiguous arrays
155
155
def time_einsum_noncon_outer (self , dtype ):
156
- np .einsum ("i,j" , self .non_contigous_dim1 , self .non_contigous_dim1 , optimize = True )
156
+ np .einsum ("i,j" , self .non_contiguous_dim1 , self .non_contiguous_dim1 , optimize = True )
157
157
158
- # multiply(a, b):non_contigous arrays
158
+ # multiply(a, b):non_contiguous arrays
159
159
def time_einsum_noncon_multiply (self , dtype ):
160
- np .einsum ("..., ..." , self .non_contigous_dim2 , self .non_contigous_dim3 , optimize = True )
161
-
162
- # sum and multiply:non_contigous arrays
160
+ np .einsum ("..., ..." , self .non_contiguous_dim2 , self .non_contiguous_dim3 , optimize = True )
161
+
162
+ # sum and multiply:non_contiguous arrays
163
163
def time_einsum_noncon_sum_mul (self , dtype ):
164
- np .einsum (",i...->" , 300 , self .non_contigous_dim3 , optimize = True )
164
+ np .einsum (",i...->" , 300 , self .non_contiguous_dim3 , optimize = True )
165
165
166
- # sum and multiply:non_contigous arrays
166
+ # sum and multiply:non_contiguous arrays
167
167
def time_einsum_noncon_sum_mul2 (self , dtype ):
168
- np .einsum ("i...,->" , self .non_contigous_dim3 , 300 , optimize = True )
169
-
170
- # scalar mul: non_contigous arrays
168
+ np .einsum ("i...,->" , self .non_contiguous_dim3 , 300 , optimize = True )
169
+
170
+ # scalar mul: non_contiguous arrays
171
171
def time_einsum_noncon_mul (self , dtype ):
172
- np .einsum ("i,->i" , self .non_contigous_dim1 , 300 , optimize = True )
173
-
174
- # contig_contig_outstride0_two: non_contigous arrays
172
+ np .einsum ("i,->i" , self .non_contiguous_dim1 , 300 , optimize = True )
173
+
174
+ # contig_contig_outstride0_two: non_contiguous arrays
175
175
def time_einsum_noncon_contig_contig (self , dtype ):
176
- np .einsum ("ji,i->" , self .non_contigous_dim2 , self .non_contigous_dim1_small , optimize = True )
176
+ np .einsum ("ji,i->" , self .non_contiguous_dim2 , self .non_contiguous_dim1_small , optimize = True )
177
177
178
- # sum_of_products_contig_outstride0_one:non_contigous arrays
178
+ # sum_of_products_contig_outstride0_one:non_contiguous arrays
179
179
def time_einsum_noncon_contig_outstride0 (self , dtype ):
180
- np .einsum ("i->" , self .non_contigous_dim1 , optimize = True )
180
+ np .einsum ("i->" , self .non_contiguous_dim1 , optimize = True )
0 commit comments