Skip to content

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

Merged
oleksandr-pavlyk merged 2 commits intomasterfrom
sycl_core-add-public
Apr 9, 2021
Merged

Use public keyword in _sycl_core.pxd on SyclContext/SyclQueue#218
oleksandr-pavlyk merged 2 commits intomasterfrom
sycl_core-add-public

Conversation

@oleksandr-pavlyk
Copy link
Copy Markdown
Contributor

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

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

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

Comment thread dpctl/_sycl_event.pxd Outdated
Comment thread dpctl/memory/_memory.pxd


cdef class _Memory:
cdef public class _Memory [object Py_MemoryObject, type Py_MemoryType]:
Copy link
Copy Markdown
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
Copy Markdown
Contributor 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
Copy Markdown
Contributor 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