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

Fixed dpctl_config, added dpctl_service.h, .cpp #539

Merged
merged 1 commit into from
Aug 20, 2021

Conversation

oleksandr-pavlyk
Copy link
Collaborator

Fixed Config/dpctl_config.h.in so that DPCTL_DPCPP_VERSION preprocessor
variable is now non-empty.

Created const char * DPCTLService_GetDPCPPVersion(void) service function
to get the version stored in that preprocessor variable.

This would allow Python to record minimum version requirement for the
DPC++ toolchain runtime.

Python 3.7.10 (default, Jun  4 2021, 06:52:02)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.25.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import dpctl, ctypes

In [2]: lib = ctypes.cdll.LoadLibrary('dpctl/libDPCTLSyclInterface.so')

In [3]: fn = lib.DPCTLService_GetDPCPPVersion

In [4]: fn.argtypes=[]

In [5]: fn.restype = ctypes.c_char_p

In [6]: fn()
Out[6]: b'2021.3.0'

@coveralls
Copy link
Collaborator

coveralls commented Aug 19, 2021

Coverage Status

Coverage increased (+0.04%) to 64.943% when pulling 97bc655 on cleanup/config into ab0faea on master.

Copy link
Contributor

@AndresGuzman-Ballen AndresGuzman-Ballen left a comment

Choose a reason for hiding this comment

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

Pretty cool!

Fixed Config/dpctl_config.h.in so that DPCTL_DPCPP_VERSION preprocessor
variable is now non-empty.

Created `const char * DPCTLService_GetDPCPPVersion(void)` service function
to get the version stored in that preprocessor variable.

This would allow Python to record minimum version requirement for the
DPC++ toolchain runtime.

```
Python 3.7.10 (default, Jun  4 2021, 06:52:02)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.25.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import dpctl, ctypes

In [2]: lib = ctypes.cdll.LoadLibrary('dpctl/libDPCTLSyclInterface.so')

In [3]: fn = lib.DPCTLService_GetDPCPPVersion

In [4]: fn.argtypes=[]

In [5]: fn.restype = ctypes.c_char_p

In [6]: fn()
Out[6]: b'2021.3.0'
```
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.

3 participants