 
   fprintf(stdout, "Matrix size is %d\n",size);
 
-  double *h_a, *h_b, *h_c, *h_c1;
-  double *d_a, *d_b, *d_c;
+  floatType_t *h_a, *h_b, *h_c, *h_c1;
+  floatType_t *d_a, *d_b, *d_c;
  
-  size_t numbytes = (size_t ) size * (size_t ) size * sizeof( double );
-
-  h_a = (double *) malloc( numbytes );
+  size_t numbytes = (size_t ) size * (size_t ) size * sizeof( floatType_t );
+
+  h_a = (floatType_t *) malloc( numbytes );
   if( h_a == NULL )
   {
     fprintf(stderr,"Error in host malloc\n");
     return 911;
   }
 
-  h_b = (double *) malloc( numbytes );
+  h_b = (floatType_t *) malloc( numbytes );
   if( h_b == NULL )
   {
     fprintf(stderr,"Error in host malloc\n");
     return 911;
   }
 
-  h_c = (double *) malloc( numbytes );
+  h_c = (floatType_t *) malloc( numbytes );
   if( h_c == NULL )
   {
     fprintf(stderr,"Error in host malloc\n");
     return 911;
   }
 
-  h_c1 = (double *) malloc( numbytes );
+  h_c1 = (floatType_t *) malloc( numbytes );
   if( h_c1 == NULL )
   {
     fprintf(stderr,"Error in host malloc\n");


/* naive GPU kernel where each element of C is computed by a single thread */

__global__ void GPU_naive( const int m, double const * const a, double const * const b, double * const c )
{

/* determine my threads's row and col indices in the global C matrix */


  for( int i = 0; i < size * size; i++ )
  {
     temp = max( temp, abs( (double)h_c[i] - (double)h_c1[i] )/
                      abs((double)h_c[i]) );
  } /* end for */
  printf("Maximum error is %e percent \n",temp*100.0);
  if( temp > 0.001 ) printf("FAIL\n");
  else printf("PASS\n");

/* cleanup */
