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

Use public keyword in _sycl_core.pxd on SyclContext/SyclQueue #218

Merged
merged 2 commits into from
Apr 9, 2021

Conversation

oleksandr-pavlyk
Copy link
Collaborator

This causes Cython to convert _sycl_core.pxd, _sycl_core.pyx
into _sycl_core.h and _sycl_core.cpp.

The header file can be used by external C++/C projects to be aware
of SyclContext and SyclQueue python objects defined by dpctl.

These are PySyclContextObject, PySyclQueueObject, which are instances
of PyObject, and PySyclContextType, PySyclQueueType which can be used
in PyObject_TypeCheck calls, validating that a Python object is
a valid syclobj entry in __sycl_usm_array_interface__.

@oleksandr-pavlyk
Copy link
Collaborator Author

Further decoration of cdef functions that allow to retrieve native backend entities as public may be needed as well.

Copy link
Contributor

@diptorupd diptorupd left a comment

Choose a reason for hiding this comment

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

LGTM barring the two comments I left on the PR.

dpctl/_sycl_event.pxd Outdated Show resolved Hide resolved
@@ -28,7 +28,7 @@ from .._sycl_device cimport SyclDevice
from .._sycl_queue cimport SyclQueue


cdef class _Memory:
cdef public class _Memory [object Py_MemoryObject, type Py_MemoryType]:
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to expose the _Memory class?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I thought yes. Mostly for type detection. Testing that an object obj is a USM memory buffer can be as simpler as using PyObject_TypeCheck with Py_MemoryType.

@diptorupd diptorupd added this to the 0.6.0 milestone Feb 20, 2021
@oleksandr-pavlyk oleksandr-pavlyk marked this pull request as ready for review April 8, 2021 17:06
@oleksandr-pavlyk
Copy link
Collaborator Author

I thought this change should make it into 0.7.0

@oleksandr-pavlyk oleksandr-pavlyk merged commit a8ea6ef into master Apr 9, 2021
@oleksandr-pavlyk oleksandr-pavlyk deleted the sycl_core-add-public branch April 9, 2021 01:57
@oleksandr-pavlyk oleksandr-pavlyk restored the sycl_core-add-public branch April 9, 2021 01:57
@oleksandr-pavlyk oleksandr-pavlyk deleted the sycl_core-add-public branch April 9, 2021 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants