3232 get_integer_float_dtypes ,
3333 has_support_aspect16 ,
3434 has_support_aspect64 ,
35+ is_gpu_device ,
3536 numpy_version ,
3637)
3738from .third_party .cupy import testing
@@ -2177,7 +2178,12 @@ def test_out(self, func, dt_in, dt_out):
21772178 if dt_in != dt_out :
21782179 if numpy .can_cast (dt_in , dt_out , casting = "same_kind" ):
21792180 # NumPy allows "same_kind" casting, dpnp does not
2180- if func != "fix" and dt_in == dpnp .bool and dt_out == dpnp .int8 :
2181+ if (
2182+ func != "fix"
2183+ and dt_in == dpnp .bool
2184+ and dt_out == dpnp .int8
2185+ and is_gpu_device ()
2186+ ):
21812187 # TODO: get rid of w/a when dpctl#2030 is fixed
21822188 pass
21832189 else :
@@ -2186,7 +2192,7 @@ def test_out(self, func, dt_in, dt_out):
21862192 assert_raises (ValueError , getattr (dpnp , func ), ia , out = iout )
21872193 assert_raises (TypeError , getattr (numpy , func ), a , out = out )
21882194 else :
2189- if func != "fix" and dt_in == dpnp .bool :
2195+ if func != "fix" and dt_in == dpnp .bool and is_gpu_device () :
21902196 # TODO: get rid of w/a when dpctl#2030 is fixed
21912197 out = out .astype (numpy .int8 )
21922198 iout = iout .astype (dpnp .int8 )
@@ -2216,7 +2222,7 @@ def test_out_usm_ndarray(self, func, dt):
22162222 out = numpy .empty (a .shape , dtype = dt )
22172223 ia , usm_out = dpnp .array (a ), dpt .asarray (out )
22182224
2219- if func != "fix" and dt == dpnp .bool :
2225+ if func != "fix" and dt == dpnp .bool and is_gpu_device () :
22202226 # TODO: get rid of w/a when dpctl#2030 is fixed
22212227 out = out .astype (numpy .int8 )
22222228 usm_out = dpt .asarray (usm_out , dtype = dpnp .int8 )
0 commit comments