3 #include <cl_integer.h>
5 #include <cl_rational.h>
6 #include <cl_float_io.h>
10 #include <cl_timing.h>
12 int main (int argc, char * argv[])
15 if ((argc >= 3) && !strcmp(argv[1],"-r")) {
16 repetitions = atoi(argv[2]);
21 uintL m1 = atoi(argv[1]);
22 cl_I m2 = cl_I(argv[2]);
23 cl_I M2 = (cl_I)1 << (intDsize*m2);
24 cl_I m3 = cl_I(argv[3]);
25 cl_I M3 = (cl_I)1 << (intDsize*m3);
26 cl_float_format_t M1 = (cl_float_format_t)(m1*intDsize);
29 do { u = random_I(M2); } while (zerop(u));
30 do { v = random_I(M3); } while (zerop(v) || gcd(u,v) > 1);
34 for (int rep = repetitions; rep > 0; rep--)
35 { p = cl_float(u,M1)/cl_float(v,M1); }
39 for (int rep = repetitions; rep > 0; rep--)
40 { p = cl_float(y,M1); }