Skip to content

dpctl.get_current_queue is now cimportable #125

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

Merged
merged 1 commit into from
Oct 15, 2020
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
3 changes: 3 additions & 0 deletions dpctl/_sycl_core.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -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()
7 changes: 5 additions & 2 deletions dpctl/sycl_core.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down