int main(int argc, char *argv[]) { // Stack variables float test_out[500]; int testFail = 0; int i; printf("Running test program p_xcorr_test...\n"); // Execution setup // Run test 1 on Arm p_xcorr_f32(in11, in12, test_out, in11_size, in12_size); // Check data for ( i = 0; i < out_size1; i++ ) { if (check_data(test_out[i],out1[i], MAX_REL_DIFF) == NOK ) { testFail = 1; printf("Test 1: Large diff for index %d, ref:%f test: %f rel:%f \n",i,out1[i],test_out[i], test_out[i]/out1[i]); } } // Run test 2 on Arm p_xcorr_f32(in21, in22, test_out, in21_size, in22_size); // Check data for ( i = 0; i < out_size2; i++ ) { if (check_data(test_out[i],out2[i], MAX_REL_DIFF) == NOK ) { testFail = 1; printf("Test 2: Large diff for index %d, ref:%f test: %f rel:%f \n",i,out2[i],test_out[i], test_out[i]/out2[i]); } } /* // This test is not used, since the code today requires nx >= ny // Run test 3 on Arm p_xcorr_f32(in31, in32, test_out, in31_size, in32_size, 1, team0); // Check data for ( i = 0; i < out_size3; i++ ) { if (check_data(test_out[i],out3[i], MAX_REL_DIFF) == NOK ) { testOK = 0; printf("Test 3: Large diff for index %d, ref:%f test: %f rel:%f \n",i,out3[i],test_out[i], test_out[i]/out3[i]); } } */ if (testFail) { printf("Xcorr ARM test FAILED!!\n"); } else { printf("Xcorr ARM test OK\n"); } return testFail; }
int tc_against_gold_e(struct ut_suite *suite, struct ut_tcase *tcase) { // Run test 1 p_xcorr_f32(in11, in12, test_out1, in11_size, in12_size); // Run test 2 p_xcorr_f32(in21, in22, test_out2, in21_size, in22_size); #if 0 // This test is not used, since the code today requires nx >= ny // Run test 3 p_xcorr_f32(in31, in32, test_out3, in31_size, in32_size); #endif return 0; }