dotprod_crcf/autotest: running explicit test for struct, run, run4
/*
- * Copyright (c) 2007 - 2015 Joseph Gaeddert
+ * Copyright (c) 2007 - 2021 Joseph Gaeddert
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -139,21 +139,38 @@ void runtest_dotprod_crcf(unsigned int _n)
y_test += h[i] * x[i];
// create and run dot product object
- float complex y;
+ float complex y_struct;
dotprod_crcf dp;
dp = dotprod_crcf_create(h,_n);
- dotprod_crcf_execute(dp, x, &y);
+ dotprod_crcf_execute(dp, x, &y_struct);
dotprod_crcf_destroy(dp);
+ // run unstructured
+ float complex y_run, y_run4;
+ dotprod_crcf_run (h,x,_n,&y_run );
+ dotprod_crcf_run4(h,x,_n,&y_run4);
+
// print results
if (liquid_autotest_verbose) {
- printf(" dotprod-crcf-%-4u : %12.8f + j%12.8f (expected %12.8f + j%12.8f)\n",
- _n, crealf(y), cimagf(y), crealf(y_test), cimagf(y_test));
+ printf(" dotprod-crcf-%-4u(struct) : %12.8f + j%12.8f (expected %12.8f + j%12.8f)\n",
+ _n, crealf(y_struct), cimagf(y_struct), crealf(y_test), cimagf(y_test));
+ printf(" dotprod-crcf-%-4u(run ) : %12.8f + j%12.8f (expected %12.8f + j%12.8f)\n",
+ _n, crealf(y_run ), cimagf(y_run ), crealf(y_test), cimagf(y_test));
+ printf(" dotprod-crcf-%-4u(run4 ) : %12.8f + j%12.8f (expected %12.8f + j%12.8f)\n",
+ _n, crealf(y_run4 ), cimagf(y_run4 ), crealf(y_test), cimagf(y_test));
}
- // validate result
- CONTEND_DELTA(crealf(y), crealf(y_test), tol);
- CONTEND_DELTA(cimagf(y), cimagf(y_test), tol);
+ // validate result (structured object)
+ CONTEND_DELTA(crealf(y_struct), crealf(y_test), tol);
+ CONTEND_DELTA(cimagf(y_struct), cimagf(y_test), tol);
+
+ // validate result (unstructured, run)
+ CONTEND_DELTA(crealf(y_run ), crealf(y_test), tol);
+ CONTEND_DELTA(cimagf(y_run ), cimagf(y_test), tol);
+
+ // validate result (unstructured, run4)
+ CONTEND_DELTA(crealf(y_run4 ), crealf(y_test), tol);
+ CONTEND_DELTA(cimagf(y_run4 ), cimagf(y_test), tol);
}
// compare structured object to ordinal computation
