#include "mydefs.h"
+bool verbose;
+
int main (int argc, char **argv)
{
- bool verbose = false;
thread_data *thread_data_arguments;
pthread_t *pthread_ids;
&number_of_rows,
&number_of_columns,
&repeat_count,
- &number_of_threads,
- &verbose);
+ &number_of_threads);
if (verbose) printf ("Verbose mode enabled\n");
* Release the allocated memory and end execution.
* -----------------------------------------------------------------------------
*/
+ for (int64_t i=0; i<number_of_rows; i++)
+ {
+ free (A[i]);
+ }
free (A);
free (b);
free (c);
free (ref);
free (pthread_ids);
+ free (thread_data_arguments);
return (0);
}
int64_t *number_of_rows,
int64_t *number_of_columns,
int64_t *repeat_count,
- int64_t *number_of_threads,
- bool *verbose)
+ int64_t *number_of_threads)
{
int opt;
int errors = 0;
*number_of_columns = default_columns;
*number_of_threads = default_number_of_threads;
*repeat_count = default_repeat_count;
- *verbose = default_verbose;
+ verbose = default_verbose;
while ((opt = getopt (argc, argv, "m:n:r:t:vh")) != -1)
{
*number_of_threads = atol (optarg);
break;
case 'v':
- *verbose = true;
+ verbose = true;
break;
case 'h':
default:
printf (" %c c[%ld] = %f ref[%ld] = %f\n",marker[i],i,c[i],i,ref[i]);
}
+ free (marker);
+
return (errors);
}
#include "mydefs.h"
-bool verbose;
-
/*
* -----------------------------------------------------------------------------
* This function allocates the data and sets up the data structures to be used
perror ("vector ref");
exit (-1);
}
+ else
+ {
+ if (verbose) printf ("Vector ref allocated\n");
+ }
if ((*A = (double **) malloc (number_of_rows * sizeof (double))) == NULL)
{
int64_t *number_of_rows,
int64_t *number_of_columns,
int64_t *repeat_count,
- int64_t *number_of_threads,
- bool *verbose);
+ int64_t *number_of_threads);
void init_data (int64_t m,
int64_t n,