@@ -292,7 +292,7 @@ cdef class SyclDevice(_SyclDevice):
292292 temporary memory.
293293 SyclDeviceCreationError:
294294 If the :class:`dpctl.SyclDevice` object creation failed.
295- TypeError :
295+ ValueError :
296296 If the list of :class:`dpctl.SyclDevice` objects was empty,
297297 or the input capsule contained a null pointer or could not
298298 be renamed.
@@ -363,7 +363,7 @@ cdef class SyclDevice(_SyclDevice):
363363 " Could not create a SyclDevice from default selector"
364364 )
365365 else :
366- raise ValueError (
366+ raise TypeError (
367367 " Invalid argument. Argument should be a str object specifying "
368368 " a SYCL filter selector string."
369369 )
@@ -1557,7 +1557,7 @@ cdef class SyclDevice(_SyclDevice):
15571557 cdef int i
15581558
15591559 if ncounts == 0 :
1560- raise TypeError (
1560+ raise ValueError (
15611561 " Non-empty object representing list of counts is expected."
15621562 )
15631563 counts_buff = < size_t * > malloc((< size_t> ncounts) * sizeof(size_t))
@@ -1659,7 +1659,7 @@ cdef class SyclDevice(_SyclDevice):
16591659 Created sub-devices.
16601660
16611661 Raises:
1662- TypeError :
1662+ ValueError :
16631663 If the ``partition`` keyword argument is not specified or
16641664 the affinity domain string is not legal or is not one of the
16651665 three supported options.
@@ -1695,7 +1695,7 @@ cdef class SyclDevice(_SyclDevice):
16951695 _partition_affinity_domain_type._next_partitionable
16961696 )
16971697 else :
1698- raise TypeError (
1698+ raise ValueError (
16991699 " Partition affinity domain {} is not understood." .format(
17001700 partition
17011701 )
@@ -1708,11 +1708,11 @@ cdef class SyclDevice(_SyclDevice):
17081708 else :
17091709 try :
17101710 partition = int (partition)
1711- return self .create_sub_devices_equally(partition)
17121711 except Exception as e:
17131712 raise TypeError (
17141713 " Unsupported type of sub-device argument"
17151714 ) from e
1715+ return self .create_sub_devices_equally(partition)
17161716
17171717 @property
17181718 def parent_device (self ):
@@ -1877,7 +1877,7 @@ cdef class SyclDevice(_SyclDevice):
18771877 A Python string representing a filter selector string.
18781878
18791879 Raises:
1880- TypeError :
1880+ ValueError :
18811881 If the device is a sub-device.
18821882
18831883 :Example:
@@ -1902,7 +1902,7 @@ cdef class SyclDevice(_SyclDevice):
19021902 else :
19031903 # this a sub-device, free it, and raise an exception
19041904 DPCTLDevice_Delete(pDRef)
1905- raise TypeError (" This SyclDevice is not a root device" )
1905+ raise ValueError (" This SyclDevice is not a root device" )
19061906
19071907 cdef int get_backend_and_device_type_ordinal(self ):
19081908 """ If this device is a root ``sycl::device``, returns the ordinal
@@ -1983,9 +1983,9 @@ cdef class SyclDevice(_SyclDevice):
19831983 A Python string representing a filter selector string.
19841984
19851985 Raises:
1986- TypeError:
1987- If the device is a sub-device.
19881986 ValueError:
1987+ If the device is a sub-device.
1988+
19891989 If no match for the device was found in the vector
19901990 returned by ``sycl::device::get_devices()``
19911991
@@ -2024,7 +2024,7 @@ cdef class SyclDevice(_SyclDevice):
20242024 else :
20252025 # this a sub-device, free it, and raise an exception
20262026 DPCTLDevice_Delete(pDRef)
2027- raise TypeError (" This SyclDevice is not a root device" )
2027+ raise ValueError (" This SyclDevice is not a root device" )
20282028 else :
20292029 if include_backend:
20302030 BTy = DPCTLDevice_GetBackend(self ._device_ref)
@@ -2047,7 +2047,7 @@ cdef class SyclDevice(_SyclDevice):
20472047 cdef int dev_id = - 1
20482048
20492049 if self .parent_device:
2050- raise TypeError (" This SyclDevice is not a root device" )
2050+ raise ValueError (" This SyclDevice is not a root device" )
20512051
20522052 dev_id = self .get_overall_ordinal()
20532053 if dev_id < 0 :
0 commit comments