35 for (i = 0; i <
N; i++)
36 for (j = 0; j <
M; j++)
53 for (i = 0; i < m; i++)
54 for (j = 0; j < m; j++) {
66 void kernel_correlation(
int m,
int n,
79 for (j = 0; j <
_PB_M; j++)
82 for (i = 0; i <
_PB_N; i++)
83 mean[j] += data[i][j];
88 for (j = 0; j <
_PB_M; j++)
91 for (i = 0; i <
_PB_N; i++)
92 stddev[j] += (data[i][j] - mean[j]) * (data[i][j] - mean[j]);
98 stddev[j] = stddev[j] <= eps ?
SCALAR_VAL(1.0) : stddev[j];
102 for (i = 0; i <
_PB_N; i++)
103 for (j = 0; j <
_PB_M; j++)
105 data[i][j] -= mean[j];
106 data[i][j] /=
SQRT_FUN(float_n) * stddev[j];
110 for (i = 0; i < _PB_M-1; i++)
113 for (j = i+1; j <
_PB_M; j++)
116 for (k = 0; k <
_PB_N; k++)
117 corr[i][j] += (data[k][i] * data[k][j]);
118 corr[j][i] = corr[i][j];
127 int main(
int argc,
char** argv)
147 kernel_correlation (m, n, float_n,
#define POLYBENCH_ARRAY(x)
#define POLYBENCH_DUMP_BEGIN(s)
static void print_array(int m, DATA_TYPE POLYBENCH_2D(corr, M, M, m, m))
static void init_array(int m, int n, DATA_TYPE *float_n, DATA_TYPE POLYBENCH_2D(data, N, M, n, m))
This version is stamped on May 10, 2016.
#define POLYBENCH_FREE_ARRAY(x)
#define POLYBENCH_2D(var, dim1, dim2, ddim1, ddim2)
static const uint32_t k[]
#define POLYBENCH_DUMP_START
#define POLYBENCH_2D_ARRAY_DECL(var, type, dim1, dim2, ddim1, ddim2)
#define DATA_PRINTF_MODIFIER
#define polybench_prevent_dce(func)
#define POLYBENCH_DUMP_TARGET
#define POLYBENCH_DUMP_END(s)
int main(int argc, char **argv)
__attribute__((noinline))
Convert the given fixedpt number to a decimal string.
#define POLYBENCH_1D(var, dim1, ddim1)
#define POLYBENCH_DUMP_FINISH
#define POLYBENCH_1D_ARRAY_DECL(var, type, dim1, ddim1)
#define polybench_stop_instruments
#define polybench_print_instruments
#define polybench_start_instruments