Skip to content

Used clang-format off, clang-format on to avoid include reordering #588

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

Merged
merged 2 commits into from
Sep 16, 2021

Conversation

oleksandr-pavlyk
Copy link
Contributor

Fixed clang-format induced issue with ordering of includes in the pybind11 example.

The "dpctl_sycl_types.h" must be included before dpctl's CPython API headers (e.g. _sycl_queue_api.h). Otherwise compilation errors with DPCTLSyclQueueRef is underfined.

Implemented two more functions, retrieving useful device properties, such as Global and local memory size in bytes. (see #587)

@oleksandr-pavlyk
Copy link
Contributor Author

cd examples/pybind11/use_dpctl_syclqueue
CXX=dpcpp CC=dpcpp python setup.py build_ext --inplace

then

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, pybind11_example as e

In [2]: d = dpctl.SyclDevice()

In [3]: (e.get_device_global_mem_size(d), e.get_device_local_mem_size(d))
Out[3]: (53718335488, 65536)

In [4]: d.print_device_info()
    Name            Intel(R) UHD Graphics [0x9bca]
    Driver version  1.1.20678
    Vendor          Intel(R) Corporation
    Profile         FULL_PROFILE
    Filter string   level_zero:gpu:0

In [5]: quit

@coveralls
Copy link
Collaborator

coveralls commented Sep 16, 2021

Coverage Status

Coverage remained the same at 72.733% when pulling 926dfaa on expand-pybind11-example into 225453f on master.

@reazulhoque
Copy link
Contributor

@oleksandr-pavlyk Can we add the code snippet you have pasted above as an example? That way we can refer back to it and it will be useful for users like me. Thank you!

@oleksandr-pavlyk
Copy link
Contributor Author

@oleksandr-pavlyk Can we add the code snippet you have pasted above as an example? That way we can refer back to it and it will be useful for users like me. Thank you!

Calls added to example.py.

@oleksandr-pavlyk oleksandr-pavlyk merged commit 8d704db into master Sep 16, 2021
@oleksandr-pavlyk oleksandr-pavlyk deleted the expand-pybind11-example branch September 16, 2021 22:22
oleksandr-pavlyk added a commit that referenced this pull request Sep 23, 2021
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