10 const float diff = fabsf(
x1 -
x2);
14 if (diff <= l * scalar * FLT_EPSILON)
25 const float max = 1000.0;
29 X[
r][c] = ((float)rand() / (float)(RAND_MAX)) * max;
40#pragma omp ordered simd
41 X[
r][k] = X[
r][k - 2] + sinf((
float)(
r / c));
49 int totalErrors_simd = 0;
50 const float scalar = 1.0;
54 Y[
r][k] = Y[
r][k - 2] + sinf((
float)(
r / c));
64 return totalErrors_simd;
71 initialization_loop(X, Y);
73 const int totalErrors_simd = comparison_loop(X, Y);
75 if (totalErrors_simd) {
76 fprintf(stdout,
"totalErrors_simd: %d \n", totalErrors_simd);
77 fprintf(stdout,
"%s : %d - FAIL: error in ordered simd computation.\n",
80 fprintf(stdout,
"Success!\n");
83 return totalErrors_simd;
__attribute__((noinline))
int compare_float(float x1, float x2, float scalar)