|
@@ -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,
|
|
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)
|
|
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
|
|
# 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:
|
|
if "half_inputs" in kwargs:
|
|
half_input_lists = kwargs["half_inputs"]
|
|
half_input_lists = kwargs["half_inputs"]
|
|
if "half_outputs" in kwargs:
|
|
if "half_outputs" in kwargs:
|
|
half_output_lists = kwargs["half_outputs"]
|
|
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
|
|
# skip relative error test check for half for now
|
|
if validation_type != "Relative":
|
|
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",
|
|
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)
|
|
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',
|
|
'NaN', 'NaN', '-0', '-0', '0', '0', 'NaN', '0.1606257',
|
|
'-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', '-denorm', '-0', '0', 'denorm', 'Inf', '1', '-1']], [[
|
|
'NaN', 'Inf', '1.0', '1.0', '1.0', '1.0', 'Inf', '1.543081',
|
|
'NaN', 'Inf', '1.0', '1.0', '1.0', '1.0', 'Inf', '1.543081',
|
|
'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,
|
|
add_test_case_float_half('Hsin', ['Hsin'], 'Epsilon', 0.0008,
|
|
[['NaN', '-Inf', '-denorm', '-0', '0', 'denorm', 'Inf', '1', '-1']], [[
|
|
[['NaN', '-Inf', '-denorm', '-0', '0', 'denorm', 'Inf', '1', '-1']], [[
|
|
'NaN', '-Inf', '0.0', '0.0', '0.0', '0.0', 'Inf', '1.175201',
|
|
'NaN', '-Inf', '0.0', '0.0', '0.0', '0.0', 'Inf', '1.175201',
|