Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEV] Fix and rename op overrider #60

Open
wants to merge 2 commits into
base: keren/v2.0
Choose a base branch
from

Conversation

mark14wu
Copy link
Collaborator

  • Adapted to new return value (from 2-tuple to 3-tuple) of pre_store_callback and pre_load_callback in profiler, tracer and client.
  • Renamed from op_callback to op_overrider in patch.py and sanitizer.py.

@@ -43,11 +43,11 @@ def pre_store_callback(ptr, value, mask, cache_modifier, eviction_policy):
self._report_load_store_bytes("store", ptr, mask)

if isinstance(op, Load):
return pre_load_callback, None
return pre_load_callback, None, None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type hints also have to be modified.

Maybe we should add mypy checks for this.

def register_op_callback(self, op: Type[Op]) -> Tuple[Optional[Callable], Optional[Callable], Optional[Callable]]

A cleaner way is to define an explicit structure to store callbacks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants