Skip to content

Commit 800e4d0

Browse files
1e-toetotmeniPokhodenkoSA
authored
Change funcs to cpdef (#150)
* Change funcs to cpdef * Change funcs to cpdef Co-authored-by: etotmeni <elena.totmenina@intel.com> Co-authored-by: Sergey Pokhodenko <sergey.pokhodenko@intel.com>
1 parent 26bf594 commit 800e4d0

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

dpctl/_sycl_core.pxd

+2
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,5 @@ cdef class SyclQueue:
140140

141141

142142
cpdef SyclQueue get_current_queue()
143+
cpdef get_current_device_type ()
144+
cpdef get_current_backend()

dpctl/_sycl_core.pyx

+9-3
Original file line numberDiff line numberDiff line change
@@ -676,12 +676,12 @@ cdef class _SyclRTManager:
676676
"""
677677
print(self._backend_str_ty_dict.keys())
678678

679-
def get_current_backend (self):
679+
cpdef get_current_backend (self):
680680
""" Returns the backend for the current queue as `backend_type` enum
681681
"""
682682
return self.get_current_queue().get_sycl_backend()
683683

684-
def get_current_device_type (self):
684+
cpdef get_current_device_type (self):
685685
''' Returns current device type as `device_type` enum
686686
'''
687687
return self.get_current_queue().get_sycl_device().get_device_type()
@@ -796,7 +796,6 @@ _mgr = _SyclRTManager()
796796

797797
# Global bound functions
798798
dump = _mgr.dump
799-
get_current_device_type = _mgr.get_current_device_type
800799
get_num_platforms = _mgr.get_num_platforms
801800
get_num_activated_queues = _mgr.get_num_activated_queues
802801
get_num_queues = _mgr.get_num_queues
@@ -810,6 +809,13 @@ cpdef SyclQueue get_current_queue():
810809
''' Obtain current Sycl Queue from Data Parallel Control package '''
811810
return _mgr.get_current_queue()
812811

812+
cpdef get_current_device_type():
813+
''' Obtain current device type from Data Parallel Control package '''
814+
return _mgr.get_current_device_type()
815+
816+
cpdef get_current_backend():
817+
''' Obtain current backend type from Data Parallel Control package '''
818+
return _mgr.get_current_backend()
813819

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

0 commit comments

Comments
 (0)