瀏覽代碼

revert cosh test tolerance value for float32 (#1119)

Young Kim 7 年之前
父節點
當前提交
fc2cbbd4ce
共有 2 個文件被更改,包括 10 次插入6 次删除
  1. 2 2
      tools/clang/unittests/HLSL/ShaderOpArithTable.xml
  2. 8 4
      utils/hct/hctdb_test.py

+ 2 - 2
tools/clang/unittests/HLSL/ShaderOpArithTable.xml

@@ -526,8 +526,8 @@
             </Parameter>
         </Row>
         <Row Name="Hcos">
-            <Parameter Name="Validation.Type">ulp</Parameter>
-            <Parameter Name="Validation.Tolerance">2</Parameter>
+            <Parameter Name="Validation.Type">Epsilon</Parameter>
+            <Parameter Name="Validation.Tolerance">0.0008</Parameter>
             <Parameter Name="ShaderOp.Text"> struct SUnaryFPOp {
                 float input;
                 float output;

+ 8 - 4
utils/hct/hctdb_test.py

@@ -91,14 +91,18 @@ def add_test_case_float_half(test_name, inst_names, validation_type, validation_
     add_test_case(test_name, inst_names, validation_type, validation_tolerance,
                   float_input_lists, float_output_lists, "cs_6_0", get_shader_text(shader_key, shader_op_name), **kwargs)
     # if half test cases are different from float input lists, use those lists instead for half testings
-    half_input_lists, half_output_lists = float_input_lists, float_output_lists
+    half_input_lists, half_output_lists, half_validation_type, half_validation_tolerance = float_input_lists, float_output_lists, validation_type, validation_tolerance
     if "half_inputs" in kwargs:
         half_input_lists = kwargs["half_inputs"]
     if "half_outputs" in kwargs:
         half_output_lists = kwargs["half_outputs"]
+    if "half_validation_type" in kwargs:
+        half_validation_type = kwargs["half_validation_type"]
+    if "half_validation_tolerance" in kwargs:
+        half_validation_tolerance = kwargs["half_validation_tolerance"]
     # skip relative error test check for half for now
     if validation_type != "Relative":
-        add_test_case(test_name + "Half", inst_names, validation_type, validation_tolerance,
+        add_test_case(test_name + "Half", inst_names, half_validation_type, half_validation_tolerance,
                     half_input_lists, half_output_lists, "cs_6_2",
                     get_shader_text(shader_key.replace("float","half"), shader_op_name), shader_arguments="-enable-16bit-types", **kwargs)
 
@@ -597,11 +601,11 @@ def add_test_cases():
         'NaN', 'NaN', '-0', '-0', '0', '0', 'NaN', '0.1606257',
         '-0.1606257'
     ]])
-    add_test_case_float_half('Hcos', ['Hcos'], 'ulp', 2,
+    add_test_case_float_half('Hcos', ['Hcos'], 'Epsilon', 0.0008,
         [['NaN', '-Inf', '-denorm', '-0', '0', 'denorm', 'Inf', '1', '-1']], [[
             'NaN', 'Inf', '1.0', '1.0', '1.0', '1.0', 'Inf', '1.543081',
             '1.543081'
-        ]], "unary float", "cosh")
+        ]], "unary float", "cosh", half_validation_type='ulp', half_validation_tolerance=2)
     add_test_case_float_half('Hsin', ['Hsin'], 'Epsilon', 0.0008,
         [['NaN', '-Inf', '-denorm', '-0', '0', 'denorm', 'Inf', '1', '-1']], [[
             'NaN', '-Inf', '0.0', '0.0', '0.0', '0.0', 'Inf', '1.175201',