Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #571 from OP2/wence/fix/configure-flop-log
Browse files Browse the repository at this point in the history
kernel: Add configuration parameter to control kernel.num_flops
  • Loading branch information
wence- authored Oct 23, 2019
2 parents 070367e + ba54157 commit a213238
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pyop2/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3371,6 +3371,8 @@ def code(self):

@cached_property
def num_flops(self):
if not configuration["compute_kernel_flops"]:
return 0
if isinstance(self.code, Node):
v = EstimateFlops()
return v.visit(self.code)
Expand Down
1 change: 1 addition & 0 deletions pyop2/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class Configuration(dict):
"debug": ("PYOP2_DEBUG", bool, False),
"cflags": ("PYOP2_CFLAGS", str, ""),
"ldflags": ("PYOP2_LDFLAGS", str, ""),
"compute_kernel_flops": ("PYOP2_COMPUTE_KERNEL_FLOPS", bool, False),
"type_check": ("PYOP2_TYPE_CHECK", bool, True),
"check_src_hashes": ("PYOP2_CHECK_SRC_HASHES", bool, True),
"log_level": ("PYOP2_LOG_LEVEL", (str, int), "WARNING"),
Expand Down

0 comments on commit a213238

Please sign in to comment.