P
Pushkar Pradhan
I want a function to execute another function, which I pass to it,
sometimes it may be mm_6r6c_6r6c, mm_2r2c_2r2c, ... etc. thus this style.
double exec_basecase(void (*func)(double *a, double *b, double *c),
double *a, double *b, double *c, int numRowsA, int numColsA, int numColsB)
{
...../*other code*/
func(a, b, c);
.....
}
This is the call in main():
double *a = NULL;
double *b = NULL;
double *c = NULL;
/* allocate memory and initialize matrix */
a = gen_matrix(10, 10, 0);
b = gen_matrix(10, 10, 0);
c = gen_matrix(10, 10, 0);
mflops1[12] = exec_basecase(mm_6r6c_6r6c_bc(a, b, c), a, b, c, 6, 6, 6);
During compile it gives following warning (in the above call) and then
during execution crashes inside this function with message: Illegal
Instruction (core dumped).
exec_basecases.c: In function `main':
exec_basecases.c:46: warning: passing arg 1 of `exec_basecase' makes
pointer from integer without a cast
Can anyone tell what's wrong with my function call?
Pushkar Pradhan
sometimes it may be mm_6r6c_6r6c, mm_2r2c_2r2c, ... etc. thus this style.
double exec_basecase(void (*func)(double *a, double *b, double *c),
double *a, double *b, double *c, int numRowsA, int numColsA, int numColsB)
{
...../*other code*/
func(a, b, c);
.....
}
This is the call in main():
double *a = NULL;
double *b = NULL;
double *c = NULL;
/* allocate memory and initialize matrix */
a = gen_matrix(10, 10, 0);
b = gen_matrix(10, 10, 0);
c = gen_matrix(10, 10, 0);
mflops1[12] = exec_basecase(mm_6r6c_6r6c_bc(a, b, c), a, b, c, 6, 6, 6);
During compile it gives following warning (in the above call) and then
during execution crashes inside this function with message: Illegal
Instruction (core dumped).
exec_basecases.c: In function `main':
exec_basecases.c:46: warning: passing arg 1 of `exec_basecase' makes
pointer from integer without a cast
Can anyone tell what's wrong with my function call?
Pushkar Pradhan