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

[UR] Logger callback function sink #17095

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

Conversation

martygrant
Copy link
Contributor

@martygrant martygrant commented Feb 20, 2025

Migrated from oneapi-src/unified-runtime#1748

This PR implements oneapi-src/unified-runtime#1330 through a new logger sink: a user configurable callback. It introduces some spec additions:

  • typedef void (*ur_logger_output_callback_t)(ur_logger_level_t level, const char *pLoggerMsg, void *pUserData)
  • urSetLoggerCallback(ur_adapter_handle_t hAdapter, ur_logger_output_callback_t pfnLoggerCallback, void *pUserData, ur_logger_level_t level
    )`
  • urSetLoggerCallbackLevel(ur_adapter_handle_t hAdapter, ur_logger_level_t level)
  • typedef enum ur_logger_level_t (moved the logger::level enum into the spec)

This new logger sink will only be constructed once a user makes a call to urSetLoggerCallback, supplying their own callback function. They can set the minimum logging level through urSetLoggerCallbackLevel. Any subsequent logging calls will additionally make a call to the supplied callback where the log level, message and user data will be sent.

A new test suite LoggerWithCallbackSink has been added to test this new functionality.

@martygrant
Copy link
Contributor Author

Pre commit AMD job is failing with Memory access fault by GPU node-1 (Agent handle: 0x10478090) on address 0x7b62a0014000. Reason: Page not present or supervisor privilege. this is being tracked here #10460

… callback function. Configurable through two new entry points with adapter implementations: urAdapterSetLoggerCallback() and urAdapterSetLoggerCallbackLevel(). Moved logger::level enum to the spec, named ur_logger_level_t. Added new unit test suite for these entry points.

Co-authored-by: Kenneth Benzie (Benie) <[email protected]>
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