Skip to content

Commit e4e8c92

Browse files
Fix docstrings for functions in program/_program.pyx
1 parent ca59c3d commit e4e8c92

File tree

1 file changed

+32
-23
lines changed

1 file changed

+32
-23
lines changed

dpctl/program/_program.pyx

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ cdef class SyclProgram:
230230
return int(<size_t>self._program_ref)
231231

232232

233-
cpdef create_program_from_source(SyclQueue q, unicode src, unicode copts=""):
233+
cpdef create_program_from_source(SyclQueue q, str src, str copts=""):
234234
"""
235235
Creates a Sycl interoperability program from an OpenCL source string.
236236
@@ -240,20 +240,24 @@ cpdef create_program_from_source(SyclQueue q, unicode src, unicode copts=""):
240240
Note: This function is currently only supported for the OpenCL backend.
241241
242242
Parameters:
243-
q (SyclQueue) : The :class:`SyclQueue` for which the
244-
:class:`SyclProgram` is going to be built.
245-
src (unicode): Source string for an OpenCL program.
246-
copts (unicode) : Optional compilation flags that will be used
247-
when compiling the program.
243+
q (SyclQueue)
244+
The :class:`dpctl.SyclQueue` for which the
245+
:class:`.SyclProgram` is going to be built.
246+
src (str)
247+
Source string for an OpenCL program.
248+
copts (str, optional)
249+
Optional compilation flags that will be used
250+
when compiling the program. Default: ``""``.
248251
249252
Returns:
250-
program (SyclProgram): A :class:`SyclProgram` object wrapping the
251-
``sycl::kernel_bundle<sycl::bundle_state::executable>`` returned
252-
by the C API.
253+
program (SyclProgram)
254+
A :class:`.SyclProgram` object wrapping the
255+
``sycl::kernel_bundle<sycl::bundle_state::executable>``
256+
returned by the C API.
253257
254258
Raises:
255-
SyclProgramCompilationError: If a SYCL kernel bundle could not be
256-
created.
259+
SyclProgramCompilationError
260+
If a SYCL kernel bundle could not be created.
257261
"""
258262

259263
cdef DPCTLSyclKernelBundleRef KBref
@@ -272,7 +276,7 @@ cpdef create_program_from_source(SyclQueue q, unicode src, unicode copts=""):
272276

273277

274278
cpdef create_program_from_spirv(SyclQueue q, const unsigned char[:] IL,
275-
unicode copts=""):
279+
str copts=""):
276280
"""
277281
Creates a Sycl interoperability program from an SPIR-V binary.
278282
@@ -281,20 +285,24 @@ cpdef create_program_from_spirv(SyclQueue q, const unsigned char[:] IL,
281285
from an compiled SPIR-V binary file.
282286
283287
Parameters:
284-
q (SyclQueue): The :class:`SyclQueue` for which the
285-
:class:`SyclProgram` is going to be built.
286-
IL (bytes) : SPIR-V binary IL file for an OpenCL program.
287-
copts (str) : Optional compilation flags that will be used
288-
when compiling the program.
288+
q (SyclQueue)
289+
The :class:`dpctl.SyclQueue` for which the
290+
:class:`.SyclProgram` is going to be built.
291+
IL (bytes)
292+
SPIR-V binary IL file for an OpenCL program.
293+
copts (str, optional)
294+
Optional compilation flags that will be used
295+
when compiling the program. Default: ``""``.
289296
290297
Returns:
291-
program (SyclProgram): A :class:`SyclProgram` object wrapping the
292-
``sycl::kernel_bundle<sycl::bundle_state::executable>`` returned by
293-
the C API.
298+
program (SyclProgram)
299+
A :class:`SyclProgram` object wrapping the
300+
``sycl::kernel_bundle<sycl::bundle_state::executable>``
301+
returned by the C API.
294302
295303
Raises:
296-
SyclProgramCompilationError: If a SYCL kernel bundle could not be
297-
created.
304+
SyclProgramCompilationError
305+
If a SYCL kernel bundle could not be created.
298306
"""
299307

300308
cdef DPCTLSyclKernelBundleRef KBref
@@ -323,7 +331,8 @@ cdef api DPCTLSyclKernelBundleRef SyclProgram_GetKernelBundleRef(SyclProgram pro
323331
cdef api SyclProgram SyclProgram_Make(DPCTLSyclKernelBundleRef KBRef):
324332
"""
325333
C-API function to create :class:`dpctl.program.SyclProgram`
326-
instance from opaque sycl kernel bundle reference.
334+
instance from opaque ``sycl::kernel_bundle<sycl::bundle_state::executable>``
335+
reference.
327336
"""
328337
cdef DPCTLSyclKernelBundleRef copied_KBRef = DPCTLKernelBundle_Copy(KBRef)
329338
return SyclProgram._create(copied_KBRef)

0 commit comments

Comments
 (0)