Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | mjames | 1 | #include "jtest.h" |
2 | #include "support_test_data.h" |
||
3 | #include "arr_desc.h" |
||
4 | #include "arm_math.h" /* FUTs */ |
||
5 | #include "ref.h" /* Reference Functions */ |
||
6 | #include "test_templates.h" |
||
7 | #include "support_templates.h" |
||
8 | #include "type_abbrev.h" |
||
9 | |||
10 | /* Aliases to play nicely with templates. */ |
||
11 | #define arm_f32_to_q31 arm_float_to_q31 |
||
12 | #define arm_f32_to_q15 arm_float_to_q15 |
||
13 | #define arm_f32_to_q7 arm_float_to_q7 |
||
14 | #define arm_q31_to_f32 arm_q31_to_float |
||
15 | #define arm_q15_to_f32 arm_q15_to_float |
||
16 | #define arm_q7_to_f32 arm_q7_to_float |
||
17 | #define ref_f32_to_q31 ref_float_to_q31 |
||
18 | #define ref_f32_to_q15 ref_float_to_q15 |
||
19 | #define ref_f32_to_q7 ref_float_to_q7 |
||
20 | #define ref_q31_to_f32 ref_q31_to_float |
||
21 | #define ref_q15_to_f32 ref_q15_to_float |
||
22 | #define ref_q7_to_f32 ref_q7_to_float |
||
23 | |||
24 | #define JTEST_ARM_X_TO_Y_TEST(prefix, suffix) \ |
||
25 | JTEST_DEFINE_TEST(arm_##prefix##_to_##suffix##_test, \ |
||
26 | arm_##prefix##_to_##suffix) \ |
||
27 | { \ |
||
28 | TEST_TEMPLATE_BUF1_BLK( \ |
||
29 | support_f_all, \ |
||
30 | support_block_sizes, \ |
||
31 | TYPE_FROM_ABBREV(prefix), \ |
||
32 | TYPE_FROM_ABBREV(suffix), \ |
||
33 | arm_##prefix##_to_##suffix, \ |
||
34 | ARM_x_to_y_INPUT_INTERFACE, \ |
||
35 | ref_##prefix##_to_##suffix, \ |
||
36 | REF_x_to_y_INPUT_INTERFACE, \ |
||
37 | SUPPORT_COMPARE_INTERFACE); \ |
||
38 | } |
||
39 | |||
40 | JTEST_ARM_X_TO_Y_TEST(f32, q31); |
||
41 | JTEST_ARM_X_TO_Y_TEST(f32, q15); |
||
42 | JTEST_ARM_X_TO_Y_TEST(f32, q7); |
||
43 | |||
44 | JTEST_ARM_X_TO_Y_TEST(q31, f32); |
||
45 | JTEST_ARM_X_TO_Y_TEST(q31, q15); |
||
46 | JTEST_ARM_X_TO_Y_TEST(q31, q7); |
||
47 | |||
48 | JTEST_ARM_X_TO_Y_TEST(q15, f32); |
||
49 | JTEST_ARM_X_TO_Y_TEST(q15, q31); |
||
50 | JTEST_ARM_X_TO_Y_TEST(q15, q7); |
||
51 | |||
52 | JTEST_ARM_X_TO_Y_TEST(q7, f32); |
||
53 | JTEST_ARM_X_TO_Y_TEST(q7, q31); |
||
54 | JTEST_ARM_X_TO_Y_TEST(q7, q15); |
||
55 | |||
56 | /*--------------------------------------------------------------------------------*/ |
||
57 | /* Collect all tests in a group. */ |
||
58 | /*--------------------------------------------------------------------------------*/ |
||
59 | |||
60 | JTEST_DEFINE_GROUP(x_to_y_tests) |
||
61 | { |
||
62 | /* |
||
63 | To skip a test, comment it out. |
||
64 | */ |
||
65 | JTEST_TEST_CALL(arm_f32_to_q31_test); |
||
66 | JTEST_TEST_CALL(arm_f32_to_q15_test); |
||
67 | JTEST_TEST_CALL(arm_f32_to_q7_test); |
||
68 | |||
69 | JTEST_TEST_CALL(arm_q31_to_f32_test); |
||
70 | JTEST_TEST_CALL(arm_q31_to_q15_test); |
||
71 | JTEST_TEST_CALL(arm_q31_to_q7_test); |
||
72 | |||
73 | JTEST_TEST_CALL(arm_q15_to_f32_test); |
||
74 | JTEST_TEST_CALL(arm_q15_to_q31_test); |
||
75 | JTEST_TEST_CALL(arm_q15_to_q7_test); |
||
76 | |||
77 | JTEST_TEST_CALL(arm_q7_to_f32_test); |
||
78 | JTEST_TEST_CALL(arm_q7_to_q31_test); |
||
79 | JTEST_TEST_CALL(arm_q7_to_q15_test); |
||
80 | } |