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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,12 @@ _dpctl_bindings*

# generated C API coverage reports
dpctl-c-api-coverage

# generated header files
dpctl/_sycl_queue.h
dpctl/_sycl_context.h
dpctl/_sycl_device.h
dpctl/_sycl_event.h
dpctl/_sycl_queue.h
dpctl/_sycl_queue_manager.h
dpctl/memory/_memory.h
6 changes: 6 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
include versioneer.py
recursive-include dpctl/include *.h *.hpp
recursive-include dpctl *.pxd
include dpctl/_sycl_context.h
include dpctl/_sycl_device.h
include dpctl/_sycl_queue.h
include dpctl/_sycl_queue_manager.h
include dpctl/_sycl_event.h
include dpctl/memory/_memory.h
include dpctl/*DPCTL*Interface.*
include dpctl/tests/input_files/*
global-exclude *.cpp
2 changes: 1 addition & 1 deletion dpctl/_sycl_context.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ cdef class _SyclContext:
cdef DPCTLSyclContextRef _ctxt_ref


cdef class SyclContext(_SyclContext):
cdef public class SyclContext(_SyclContext) [object PySyclContextObject, type PySyclContextType]:
''' Wrapper class for a Sycl Context
'''

Expand Down
2 changes: 1 addition & 1 deletion dpctl/_sycl_device.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ cdef class _SyclDevice:
cdef size_t *_max_work_item_sizes


cdef class SyclDevice(_SyclDevice):
cdef public class SyclDevice(_SyclDevice) [object PySyclDeviceObject, type PySyclDeviceType]:
@staticmethod
cdef SyclDevice _create(DPCTLSyclDeviceRef dref)
@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion dpctl/_sycl_event.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from ._backend cimport DPCTLSyclEventRef


cdef class SyclEvent:
cdef public class SyclEvent [object PySyclEventObject, type PySyclEventType]:
''' Wrapper class for a Sycl Event
'''
cdef DPCTLSyclEventRef _event_ref
Expand Down
2 changes: 1 addition & 1 deletion dpctl/_sycl_queue.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ cdef class _SyclQueue:
cdef SyclDevice _device


cdef class SyclQueue (_SyclQueue):
cdef public class SyclQueue (_SyclQueue) [object PySyclQueueObject, type PySyclQueueType]:
""" Python wrapper class for a sycl::queue.
"""
cdef int _init_queue_default(self, int)
Expand Down
2 changes: 1 addition & 1 deletion dpctl/_sycl_queue_manager.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
from ._sycl_queue cimport SyclQueue


cpdef SyclQueue get_current_queue()
cpdef public SyclQueue get_current_queue()
cpdef get_current_device_type ()
cpdef get_current_backend()
12 changes: 6 additions & 6 deletions dpctl/memory/_memory.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -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.

cdef DPCTLSyclUSMRef memory_ptr
cdef Py_ssize_t nbytes
cdef SyclQueue queue
Expand All @@ -47,18 +47,18 @@ cdef class _Memory:
cpdef bytes tobytes(self)

@staticmethod
cdef SyclDevice get_pointer_device(DPCTLSyclUSMRef p, SyclContext ctx)
cdef public SyclDevice get_pointer_device(DPCTLSyclUSMRef p, SyclContext ctx)
@staticmethod
cdef bytes get_pointer_type(DPCTLSyclUSMRef p, SyclContext ctx)
cdef public bytes get_pointer_type(DPCTLSyclUSMRef p, SyclContext ctx)


cdef class MemoryUSMShared(_Memory):
cdef public class MemoryUSMShared(_Memory) [object PyMemoryUSMSharedObject, type PyMemoryUSMSharedType]:
pass


cdef class MemoryUSMHost(_Memory):
cdef public class MemoryUSMHost(_Memory) [object PyMemoryUSMHostObject, type PyMemoryUSMHostType]:
pass


cdef class MemoryUSMDevice(_Memory):
cdef public class MemoryUSMDevice(_Memory) [object PyMemoryUSMDeviceObject, type PyMemoryUSMDeviceType]:
pass