@@ -4187,7 +4187,7 @@ def nbytes(arg, self):
4187
4187
return DataVolume (loads = loads , stores = stores , bytes = total_bytes )
4188
4188
4189
4189
@property
4190
- def total_flops (self ):
4190
+ def flops_per_cell (self ):
4191
4191
"""Return an estimate of the total flops executed by this
4192
4192
:class:`ParLoop`
4193
4193
@@ -4202,16 +4202,6 @@ def total_flops(self):
4202
4202
"""
4203
4203
if (not self ._measure_flops ):
4204
4204
return 0
4205
- iterset = self .iterset
4206
- size = iterset .size
4207
- if self .needs_exec_halo :
4208
- size = iterset .exec_size
4209
- if self .is_indirect and iterset ._extruded :
4210
- region = self .iteration_region
4211
- if region is ON_INTERIOR_FACETS :
4212
- size *= iterset .layers - 2
4213
- elif region not in [ON_TOP , ON_BOTTOM ]:
4214
- size *= iterset .layers - 1
4215
4205
parameters = ''
4216
4206
definitions = ''
4217
4207
deallocations = ''
@@ -4273,7 +4263,24 @@ def total_flops(self):
4273
4263
func = compilation .load (s ,'cpp' ,'count_flops' ,restype = np .int32 ,
4274
4264
cppargs = cppargs )
4275
4265
flops = func ()
4276
- return flops * size
4266
+ return flops
4267
+
4268
+ @property
4269
+ def total_flops (self ):
4270
+ """Return an estimate for the total number of FLOPs executed
4271
+ (i.e. flops_per_cell x mesh size)
4272
+ """
4273
+ iterset = self .iterset
4274
+ size = iterset .size
4275
+ if self .needs_exec_halo :
4276
+ size = iterset .exec_size
4277
+ if self .is_indirect and iterset ._extruded :
4278
+ region = self .iteration_region
4279
+ if region is ON_INTERIOR_FACETS :
4280
+ size *= iterset .layers - 2
4281
+ elif region not in [ON_TOP , ON_BOTTOM ]:
4282
+ size *= iterset .layers - 1
4283
+ return self .flops_per_cell * size
4277
4284
4278
4285
@property
4279
4286
def arithmetic_intensity (self ):
0 commit comments