Implementation of GLog#718
Merged
oleksandr-pavlyk merged 8 commits intoIntelPython:masterfrom Feb 1, 2022
Merged
Conversation
ae328c7 to
11371db
Compare
diptorupd
reviewed
Dec 10, 2021
diptorupd
reviewed
Dec 10, 2021
Contributor
|
@vlad-perevezentsev @oleksandr-pavlyk IMO glog usage in dpctl is a debugging feature intended for developers of dpctl or library writers who want to investigate some problem by turning on logging. I propose the following design:
Few unknowns:
|
Collaborator
Author
|
@diptorupd Glog has little information in the documentation so I can't answer using it.
|
Contributor
Another important aspect is whether |
Collaborator
0ebf25e to
420d8c5
Compare
8daf2e3 to
a1ced1a
Compare
Contributor
a1ced1a to
6a4d00f
Compare
Contributor
|
Note for posterity: glog=0.5 is required. The 0.4 does not declare |
oleksandr-pavlyk
previously approved these changes
Jan 27, 2022
diptorupd
reviewed
Jan 28, 2022
diptorupd
reviewed
Jan 28, 2022
diptorupd
reviewed
Jan 28, 2022
diptorupd
reviewed
Jan 28, 2022
diptorupd
reviewed
Jan 28, 2022
diptorupd
reviewed
Jan 28, 2022
62cb7e3 to
94ffffd
Compare
diptorupd
reviewed
Jan 31, 2022
diptorupd
reviewed
Jan 31, 2022
94ffffd to
860afcd
Compare
Replaced use of `stat` function with use of `filesystem::is_directory`. Stat was always erroring out even for path to existing directory. Created `dpctl._dev` module for developers. It adds ```python dpctl._dev.init_logger(log_dir=None) ``` Function to initialize the logger. It uses `"dpctl"` for application name, and supplied log directory. `log_dir=None` is interpreted as use the current working directory. ```pyton dpctl._dev.fini_logger() ``` Call ShutdownLogger. ```python dpctl._dev.verbose(verbostiy="warning", log_dir=None) ``` Context manager which initializes the logger, and sets the verbosity level for a given block of Python code: Example: ``` In [1]: import dpctl, dpctl._dev as dd In [2]: with dd.verbose(): dpctl.SyclDevice().parent_device No parent for device because it is not a subdevice -33 (CL_INVALID_DEVICE) in DPCTLDevice_GetParentDevice at /localdisk/work/opavlyk/repos/dpctl/libsyclinterface/source/dpctl_sycl_device_interface.cpp:540 In [3]: dpctl.SyclDevice().parent_device # no message In [4]: with dd.verbose(): dpctl.SyclDevice().parent_device No parent for device because it is not a subdevice -33 (CL_INVALID_DEVICE) in DPCTLDevice_GetParentDevice at /localdisk/work/opavlyk/repos/dpctl/libsyclinterface/source/dpctl_sycl_device_interface.cpp:540 In [5]: dpctl.SyclDevice().parent_device # no message In [6]: quit ``` Export DPCTLService_InitLogger and DPCTLService_FiniLogger
1. GLOG defaults (log_dir=None) to outputing to color-enhanced std::cerr 2. Specifying valid log_dir changes the mode to logging 3. Context manager renamed from verbose to syclinterface_diagnostic Test updated.
6f174bd to
84e7dc5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the primary implementation of using GLog in dpctl.
The implementation used Glog 5.0
conda install glogAdded the
--glogflag for setup in development modepython setup.py develop --glog=TrueImplemented 2 functions for initialization and deinitialization of GLog
void DPCTLService_InitLoggerandvoid DPCTLService_ShutdownLogger