From eda6a92c6c7e4aa4ae7b78eca90e4869460d4c71 Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Thu, 8 Apr 2021 12:04:36 -0500 Subject: [PATCH 1/2] Added public keywords for PXD files --- MANIFEST.in | 6 ++++++ dpctl/_sycl_context.pxd | 2 +- dpctl/_sycl_device.pxd | 2 +- dpctl/_sycl_event.pxd | 2 +- dpctl/_sycl_queue.pxd | 2 +- dpctl/_sycl_queue_manager.pxd | 2 +- dpctl/memory/_memory.pxd | 12 ++++++------ 7 files changed, 17 insertions(+), 11 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 3a19898c99..9259b2c180 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -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 diff --git a/dpctl/_sycl_context.pxd b/dpctl/_sycl_context.pxd index f9c43c26f5..210ff9a7e6 100644 --- a/dpctl/_sycl_context.pxd +++ b/dpctl/_sycl_context.pxd @@ -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 ''' diff --git a/dpctl/_sycl_device.pxd b/dpctl/_sycl_device.pxd index 54070cbeef..f1d656896f 100644 --- a/dpctl/_sycl_device.pxd +++ b/dpctl/_sycl_device.pxd @@ -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 diff --git a/dpctl/_sycl_event.pxd b/dpctl/_sycl_event.pxd index 6ef8c1f14f..7f397cb716 100644 --- a/dpctl/_sycl_event.pxd +++ b/dpctl/_sycl_event.pxd @@ -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 diff --git a/dpctl/_sycl_queue.pxd b/dpctl/_sycl_queue.pxd index 1e9acb7062..a0536ccd75 100644 --- a/dpctl/_sycl_queue.pxd +++ b/dpctl/_sycl_queue.pxd @@ -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) diff --git a/dpctl/_sycl_queue_manager.pxd b/dpctl/_sycl_queue_manager.pxd index 30b24c1fad..2885daa54b 100644 --- a/dpctl/_sycl_queue_manager.pxd +++ b/dpctl/_sycl_queue_manager.pxd @@ -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() diff --git a/dpctl/memory/_memory.pxd b/dpctl/memory/_memory.pxd index 9aab4dcee3..bc8b9bc54a 100644 --- a/dpctl/memory/_memory.pxd +++ b/dpctl/memory/_memory.pxd @@ -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]: cdef DPCTLSyclUSMRef memory_ptr cdef Py_ssize_t nbytes cdef SyclQueue queue @@ -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 From 1bb212306c5f2dcc2d4f8445096cabbe8c170598 Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Thu, 8 Apr 2021 16:53:16 -0500 Subject: [PATCH 2/2] added generated dpctl/*.h files to .gitignore --- .gitignore | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitignore b/.gitignore index 367d6a754c..90b4d2faf4 100644 --- a/.gitignore +++ b/.gitignore @@ -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 \ No newline at end of file