Skip to content

[IFRT] Define user_context() in Value and LoadedExecutable #29042

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

copybara-service[bot]
Copy link

[IFRT] Define user_context() in Value and LoadedExecutable

This change defines user_context() for IFRT Value and LoadedExecutable.
This method is expected to return UserContext that was supplied during the
value (including array) or loaded executable creation time.

IFRT implementations return {} (== nullptr) as a placeholder. Their actual
implementation will follow.

These two types are chosen as initial targets for tracking user contexts
because today's IFRT user code frequently attaches their own user context
(e.g., Python traceback) to these objects. Other runtimes objects (e.g.,
DeviceList) and state transitions (value deletion) can be future candidates
for additional user context tracking, but it is scoped out for now.

This change defines `user_context()` for IFRT `Value` and `LoadedExecutable`.
This method is expected to return `UserContext` that was supplied during the
value (including array) or loaded executable creation time.

IFRT implementations return `{}` (`== nullptr`) as a placeholder. Their actual
implementation will follow.

These two types are chosen as initial targets for tracking user contexts
because today's IFRT user code frequently attaches their own user context
(e.g., Python traceback) to these objects. Other runtimes objects (e.g.,
`DeviceList`) and state transitions (value deletion) can be future candidates
for additional user context tracking, but it is scoped out for now.

PiperOrigin-RevId: 784284821
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.

1 participant