2121IS_AVX = __cpu_features__ .get ('AVX512F' , False ) or \
2222 (__cpu_features__ .get ('FMA3' , False ) and __cpu_features__ .get ('AVX2' , False ))
2323
24- IS_AVX512FP16 = __cpu_features__ .get ('AVX512FP16' , False )
25-
2624# only run on linux with AVX, also avoid old glibc (numpy/numpy#20448).
2725runtest = (sys .platform .startswith ('linux' )
2826 and IS_AVX and not _glibc_older_than ("2.17" ))
@@ -84,8 +82,6 @@ def test_validate_transcendentals(self):
8482 maxulperr = data_subset ['ulperr' ].max ()
8583 assert_array_max_ulp (npfunc (inval ), outval , maxulperr )
8684
87- @pytest .mark .skipif (IS_AVX512FP16 ,
88- reason = "SVML FP16 have slightly higher ULP errors" )
8985 @pytest .mark .parametrize ("ufunc" , UNARY_OBJECT_UFUNCS )
9086 def test_validate_fp16_transcendentals (self , ufunc ):
9187 with np .errstate (all = 'ignore' ):
@@ -94,39 +90,3 @@ def test_validate_fp16_transcendentals(self, ufunc):
9490 datafp32 = datafp16 .astype (np .float32 )
9591 assert_array_max_ulp (ufunc (datafp16 ), ufunc (datafp32 ),
9692 maxulp = 1 , dtype = np .float16 )
97-
98- @pytest .mark .skipif (not IS_AVX512FP16 ,
99- reason = "lower ULP only apply for SVML FP16" )
100- def test_validate_svml_fp16 (self ):
101- max_ulp_err = {
102- "arccos" : 2.54 ,
103- "arccosh" : 2.09 ,
104- "arcsin" : 3.06 ,
105- "arcsinh" : 1.51 ,
106- "arctan" : 2.61 ,
107- "arctanh" : 1.88 ,
108- "cbrt" : 1.57 ,
109- "cos" : 1.43 ,
110- "cosh" : 1.33 ,
111- "exp2" : 1.33 ,
112- "exp" : 1.27 ,
113- "expm1" : 0.53 ,
114- "log" : 1.80 ,
115- "log10" : 1.27 ,
116- "log1p" : 1.88 ,
117- "log2" : 1.80 ,
118- "sin" : 1.88 ,
119- "sinh" : 2.05 ,
120- "tan" : 2.26 ,
121- "tanh" : 3.00 ,
122- }
123-
124- with np .errstate (all = 'ignore' ):
125- arr = np .arange (65536 , dtype = np .int16 )
126- datafp16 = np .frombuffer (arr .tobytes (), dtype = np .float16 )
127- datafp32 = datafp16 .astype (np .float32 )
128- for func in max_ulp_err :
129- ufunc = getattr (np , func )
130- ulp = np .ceil (max_ulp_err [func ])
131- assert_array_max_ulp (ufunc (datafp16 ), ufunc (datafp32 ),
132- maxulp = ulp , dtype = np .float16 )
0 commit comments