From 55a1c82e1484b7546c19c316933109e6074d4565 Mon Sep 17 00:00:00 2001 From: Oleksandr Pavlyk Date: Tue, 13 Oct 2020 08:34:00 -0500 Subject: [PATCH] dpctl.get_current_queue is now cimportable --- dpctl/_sycl_core.pxd | 3 +++ dpctl/sycl_core.pyx | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/dpctl/_sycl_core.pxd b/dpctl/_sycl_core.pxd index a95e5f28c5..2d7fbc01fa 100644 --- a/dpctl/_sycl_core.pxd +++ b/dpctl/_sycl_core.pxd @@ -118,3 +118,6 @@ cdef class SyclQueue: cpdef void wait (self) cdef DPPLSyclQueueRef get_queue_ref (self) cpdef memcpy (self, dest, src, int count) + + +cpdef SyclQueue get_current_queue() diff --git a/dpctl/sycl_core.pyx b/dpctl/sycl_core.pyx index e22e8377fa..c9524a1d29 100644 --- a/dpctl/sycl_core.pyx +++ b/dpctl/sycl_core.pyx @@ -626,7 +626,7 @@ cdef class _SyclRTManager: ''' return self.get_current_queue().get_sycl_device().get_device_type() - def get_current_queue (self): + cpdef SyclQueue get_current_queue (self): ''' Returns the activated SYCL queue as a PyCapsule. ''' return SyclQueue._create(DPPLQueueMgr_GetCurrentQueue()) @@ -736,7 +736,6 @@ _mgr = _SyclRTManager() # Global bound functions dump = _mgr.dump -get_current_queue = _mgr.get_current_queue get_current_device_type = _mgr.get_current_device_type get_num_platforms = _mgr.get_num_platforms get_num_activated_queues = _mgr.get_num_activated_queues @@ -747,6 +746,10 @@ has_sycl_platforms = _mgr.has_sycl_platforms set_default_queue = _mgr.set_default_queue is_in_device_context = _mgr.is_in_device_context +cpdef SyclQueue get_current_queue(): + ''' Obtain current Sycl Queue from Data Parallel Control package ''' + return _mgr.get_current_queue() + def create_program_from_source (SyclQueue q, unicode source, unicode copts=""): ''' Creates a Sycl interoperability program from an OpenCL source string.