@@ -739,12 +739,12 @@ cdef class SyclDevice(_SyclDevice):
739
739
cdef DPCTLDeviceVectorRef DVRef = NULL
740
740
if count > 0 :
741
741
DVRef = DPCTLDevice_CreateSubDevicesEqually(self ._device_ref, count)
742
- else :
743
- raise ValueError (
744
- " Creating sub-devices with zero compute units is requested"
745
- )
746
742
if DVRef is NULL :
747
- raise SubDeviceCreationError(" Sub-devices were not created." )
743
+ raise SubDeviceCreationError(
744
+ " Sub-devices were not created." if (count > 0 ) else
745
+ " Sub-devices were not created, "
746
+ " requested compute units count was zero."
747
+ )
748
748
return _get_devices(DVRef)
749
749
750
750
cdef list create_sub_devices_by_counts(self , object counts):
@@ -778,12 +778,12 @@ cdef class SyclDevice(_SyclDevice):
778
778
self ._device_ref, counts_buff, ncounts
779
779
)
780
780
free(counts_buff)
781
- if min_count == 0 :
782
- raise ValueError (
783
- " Targeted sub-device execution units must positive"
784
- )
785
781
if DVRef is NULL :
786
- raise SubDeviceCreationError(" Sub-devices were not created." )
782
+ raise SubDeviceCreationError(
783
+ " Sub-devices were not created." if (min_count > 0 ) else
784
+ " Sub-devices were not created, "
785
+ " sub-device execution units counts must be positive."
786
+ )
787
787
return _get_devices(DVRef)
788
788
789
789
cdef list create_sub_devices_by_affinity(
0 commit comments