@@ -65,6 +65,14 @@ cdef class _SyclPlatform:
65
65
DPCTLCString_Delete(self ._version)
66
66
67
67
68
+ cdef void _init_helper(_SyclPlatform platform, DPCTLSyclPlatformRef PRef):
69
+ " Populate attributes of class from opaque reference PRef"
70
+ platform._platform_ref = PRef
71
+ platform._name = DPCTLPlatform_GetName(PRef)
72
+ platform._version = DPCTLPlatform_GetVersion(PRef)
73
+ platform._vendor = DPCTLPlatform_GetVendor(PRef)
74
+
75
+
68
76
cdef class SyclPlatform(_SyclPlatform):
69
77
""" SyclPlatform(self, arg=None)
70
78
Python class representing ``cl::sycl::platform`` class.
@@ -73,13 +81,6 @@ cdef class SyclPlatform(_SyclPlatform):
73
81
SyclPlatform(filter_selector) - create platform selected by filter
74
82
selector
75
83
"""
76
- @staticmethod
77
- cdef void _init_helper(_SyclPlatform platform, DPCTLSyclPlatformRef PRef):
78
- platform._platform_ref = PRef
79
- platform._name = DPCTLPlatform_GetName(PRef)
80
- platform._version = DPCTLPlatform_GetVersion(PRef)
81
- platform._vendor = DPCTLPlatform_GetVendor(PRef)
82
-
83
84
@staticmethod
84
85
cdef SyclPlatform _create(DPCTLSyclPlatformRef pref):
85
86
"""
@@ -90,7 +91,7 @@ cdef class SyclPlatform(_SyclPlatform):
90
91
"""
91
92
cdef _SyclPlatform p = _SyclPlatform.__new__ (_SyclPlatform)
92
93
# Initialize the attributes of the SyclPlatform object
93
- SyclPlatform. _init_helper(< _SyclPlatform> p, pref)
94
+ _init_helper(< _SyclPlatform> p, pref)
94
95
return SyclPlatform(p)
95
96
96
97
cdef int _init_from__SyclPlatform(self , _SyclPlatform other):
@@ -114,7 +115,7 @@ cdef class SyclPlatform(_SyclPlatform):
114
115
if PRef is NULL :
115
116
return - 1
116
117
else :
117
- SyclPlatform. _init_helper(self , PRef)
118
+ _init_helper(self , PRef)
118
119
return 0
119
120
120
121
cdef DPCTLSyclPlatformRef get_platform_ref(self ):
@@ -169,7 +170,7 @@ cdef class SyclPlatform(_SyclPlatform):
169
170
" Could not create a SyclPlatform from default selector"
170
171
)
171
172
else :
172
- SyclPlatform. _init_helper(self , PRef)
173
+ _init_helper(self , PRef)
173
174
else :
174
175
raise ValueError (
175
176
" Invalid argument. Argument should be a str object specifying "
0 commit comments