-
Notifications
You must be signed in to change notification settings - Fork 787
[UR] Logger callback function sink #17095
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
Conversation
d941614
to
a26217f
Compare
Pre commit AMD job is failing with |
a26217f
to
731f829
Compare
@intel/dpcpp-nativecpu-reviewers @intel/llvm-reviewers-cuda need a review for this PR please |
731f829
to
02f73a1
Compare
02f73a1
to
892700e
Compare
892700e
to
a72a35e
Compare
0e668ea
to
ecc346c
Compare
ecc346c
to
24655c5
Compare
24655c5
to
537764f
Compare
… 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]>
…tialisation via urAdapterSetLoggerCallback.
…ssage and link up a logger callback from SYCL RT to simply print to stdout, this is setup during adapter initialisation in sycl/source/detail.cpp also remove setErrorMessage from OpenCL and Native CPU adapters where there was no usage
…erferes with some e2e tests
…or the callback param
537764f
to
cef6bb2
Compare
@intel/unified-runtime-reviewers-level-zero need a review for this please, this was a previously approved PR in the old UR repo but has had some new changes since then |
Change intel#17095 introduced a failure in the logger_validation test due to an incorrect merging of the default and "current" log level. This change reverts to the old behavior where an invalid `output` value causes the logger to use the default `level`.
Change #17095 introduced a failure in the logger_validation test due to an incorrect merging of the default and "current" log level. This change reverts to the old behavior where an invalid `output` value causes the logger to use the default `level`.
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
(which is called from the URurAdapterSetLoggerCallback
entry point), supplying their own callback function. They can set the minimum logging level throughurSetLoggerCallbackLevel
. 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 callback has been setup in the SYCL RT in
sycl/source/detail/ur.cpp
to print logs tostd::err
:A new test suite
LoggerWithCallbackSink
has been added to test this new functionality.