Skip to content

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

Merged
oleksandr-pavlyk merged 1 commit intomasterfrom
cleanup/config
Aug 20, 2021
Merged

Fixed dpctl_config, added dpctl_service.h, .cpp#539
oleksandr-pavlyk merged 1 commit intomasterfrom
cleanup/config

Conversation

@oleksandr-pavlyk
Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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