Skip to content

Commit 39b31e6

Browse files
authored
Merge pull request #2290 from IntelPython/fix-errors-formatting-sycl-queue
Fix formatting of errors in `_sycl queue.pyx`
2 parents ad14818 + ae1286a commit 39b31e6

1 file changed

Lines changed: 33 additions & 25 deletions

File tree

dpctl/_sycl_queue.pyx

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,8 @@ cdef DPCTLSyclEventRef _memcpy_impl(
488488
src_is_buf = True
489489
else:
490490
raise TypeError(
491-
"Parameter `src` should have either type "
492-
"`dpctl.memory._Memory` or a type that "
493-
"supports Python buffer protocol"
491+
"Parameter `src` should have either type `dpctl.memory._Memory` "
492+
"or a type that supports Python buffer protocol"
494493
)
495494

496495
if isinstance(dst, _Memory):
@@ -508,9 +507,8 @@ cdef DPCTLSyclEventRef _memcpy_impl(
508507
dst_is_buf = True
509508
else:
510509
raise TypeError(
511-
"Parameter `dst` should have either type "
512-
"`dpctl.memory._Memory` or a type that "
513-
"supports Python buffer protocol"
510+
"Parameter `dst` should have either type `dpctl.memory._Memory` "
511+
"or a type that supports Python buffer protocol"
514512
)
515513

516514
if dep_events_count == 0 or dep_events is NULL:
@@ -1592,7 +1590,8 @@ cdef class SyclQueue(_SyclQueue):
15921590
else:
15931591
raise TypeError(
15941592
"dependent_events must either None, or a sequence of "
1595-
":class:`dpctl.SyclEvent` objects")
1593+
"`dpctl.SyclEvent` objects"
1594+
)
15961595
if nDE > 0:
15971596
depEvents = (
15981597
<DPCTLSyclEventRef*>malloc(nDE*sizeof(DPCTLSyclEventRef))
@@ -1703,25 +1702,28 @@ cdef class WorkGroupMemory:
17031702
raise RuntimeError("Workgroup memory extension not available")
17041703

17051704
if not (0 < len(args) < 3):
1706-
raise TypeError("WorkGroupMemory constructor takes 1 or 2 "
1707-
f"arguments, but {len(args)} were given")
1705+
raise TypeError(
1706+
"WorkGroupMemory constructor takes 1 or 2 arguments, but "
1707+
f"{len(args)} were given"
1708+
)
17081709

17091710
if len(args) == 1:
17101711
if not isinstance(args[0], numbers.Integral):
1711-
raise TypeError("WorkGroupMemory single argument constructor"
1712-
"expects first argument to be `int`",
1713-
f"but got {type(args[0])}")
1712+
raise TypeError(
1713+
"WorkGroupMemory single argument constructor expects "
1714+
f"first argument to be `int` but got {type(args[0])}"
1715+
)
17141716
nbytes = <size_t>(args[0])
17151717
else:
17161718
if not isinstance(args[0], str):
17171719
raise TypeError(
1718-
"WorkGroupMemory constructor expects first"
1719-
f"argument to be `str`, but got {type(args[0])}"
1720+
"WorkGroupMemory constructor expects first argument to be "
1721+
f"`str`, but got {type(args[0])}"
17201722
)
17211723
if not isinstance(args[1], numbers.Integral):
17221724
raise TypeError(
1723-
"WorkGroupMemory constructor expects second"
1724-
f"argument to be `int`, but got {type(args[1])}"
1725+
"WorkGroupMemory constructor expects second argument to "
1726+
f"be `int`, but got {type(args[1])}"
17251727
)
17261728
dtype = <str>(args[0])
17271729
count = <size_t>(args[1])
@@ -1800,14 +1802,16 @@ cdef class RawKernelArg:
18001802
raise RuntimeError("Raw kernel arg extension not available")
18011803

18021804
if not (0 < len(args) < 3):
1803-
raise TypeError("RawKernelArg constructor takes 1 or 2 "
1804-
f"arguments, but {len(args)} were given")
1805+
raise TypeError(
1806+
"RawKernelArg constructor takes 1 or 2 arguments, but "
1807+
f"{len(args)} were given"
1808+
)
18051809

18061810
if len(args) == 1:
18071811
if not _is_buffer(args[0]):
1808-
raise TypeError("RawKernelArg single argument constructor"
1809-
"expects argument to be buffer",
1810-
f"but got {type(args[0])}")
1812+
raise TypeError(
1813+
"RawKernelArg single argument constructor expects "
1814+
f"argument to be buffer but got {type(args[0])}")
18111815

18121816
ret_code = PyObject_GetBuffer(args[0], &(_buffer),
18131817
PyBUF_SIMPLE | PyBUF_ANY_CONTIGUOUS)
@@ -1819,11 +1823,15 @@ cdef class RawKernelArg:
18191823
_is_buf = True
18201824
else:
18211825
if not isinstance(args[0], numbers.Integral):
1822-
raise TypeError("RawKernelArg constructor expects first"
1823-
"argument to be `int`, but got {type(args[0])}")
1826+
raise TypeError(
1827+
"RawKernelArg constructor expects first argument to be "
1828+
f"`int`, but got {type(args[0])}"
1829+
)
18241830
if not isinstance(args[1], numbers.Integral):
1825-
raise TypeError("RawKernelArg constructor expects second"
1826-
"argument to be `int`, but got {type(args[1])}")
1831+
raise TypeError(
1832+
"RawKernelArg constructor expects second argument to be "
1833+
f"`int`, but got {type(args[1])}"
1834+
)
18271835

18281836
_is_buf = False
18291837
count = args[0]

0 commit comments

Comments
 (0)