Skip to content

Change funcs to cpdef #150

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 6 commits into from
Oct 23, 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
2 changes: 2 additions & 0 deletions dpctl/_sycl_core.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,5 @@ cdef class SyclQueue:


cpdef SyclQueue get_current_queue()
cpdef get_current_device_type ()
cpdef get_current_backend()
12 changes: 9 additions & 3 deletions dpctl/_sycl_core.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -676,12 +676,12 @@ cdef class _SyclRTManager:
"""
print(self._backend_str_ty_dict.keys())

def get_current_backend (self):
cpdef get_current_backend (self):
""" Returns the backend for the current queue as `backend_type` enum
"""
return self.get_current_queue().get_sycl_backend()

def get_current_device_type (self):
cpdef get_current_device_type (self):
''' Returns current device type as `device_type` enum
'''
return self.get_current_queue().get_sycl_device().get_device_type()
Expand Down Expand Up @@ -796,7 +796,6 @@ _mgr = _SyclRTManager()

# Global bound functions
dump = _mgr.dump
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
get_num_queues = _mgr.get_num_queues
Expand All @@ -810,6 +809,13 @@ cpdef SyclQueue get_current_queue():
''' Obtain current Sycl Queue from Data Parallel Control package '''
return _mgr.get_current_queue()

cpdef get_current_device_type():
''' Obtain current device type from Data Parallel Control package '''
return _mgr.get_current_device_type()

cpdef get_current_backend():
''' Obtain current backend type from Data Parallel Control package '''
return _mgr.get_current_backend()

def create_program_from_source (SyclQueue q, unicode source, unicode copts=""):
''' Creates a Sycl interoperability program from an OpenCL source string.
Expand Down