 #define CPU 1
 #define GPU 0
 
-#define MINI_NUM_TESTS 16
+#define NUM_TESTS 16
 
 #define CHECKBOARD_BLOCK_MAX_WIDTH  1
 #define CHECKBOARD_BLOCK_MAX_HEIGHT 256

	
	checkResultsProductMatrixVector(productMatrixVectorCPU, productMatrixVectorGPU_naive);
	checkResultsProductMatrixVector(productMatrixVectorCPU, productMatrixVectorGPU_shared);
	
	measureProductMatrixVector(productMatrixVectorCPU);
	measureProductMatrixVector(productMatrixVectorGPU_naive);
	measureProductMatrixVector(productMatrixVectorGPU_shared);
	
	return 0;
}

void measureProductMatrixVector(Vector(*func)(const Matrix &, const Vector &)) {
	std::cout << "NEW MEASUREMENTS for Matrix-Vector product: " << std::endl;
	
	for (unsigned int size(2) ; size < 10000 ; size <<= 1) {
		Matrix h_m(size, size, CPU);
		randMatrix(h_m);
		
		Vector h_v(size, CPU);
		randVector(h_v);
			
		float time_required(0);
		
		for (unsigned long int i(0) ; i != NUM_TESTS ; i++) {
			float time(0);
			cudaEvent_t start, stop;
			cudaEventCreate(&start);
			cudaEventCreate(&stop);
			cudaEventRecord(start, 0);
			try {		
				func(h_m, h_v);
			} catch(cudaError_t &e) {
				return;
			}
			cudaEventRecord(stop, 0);
			cudaEventSynchronize(stop);
			cudaEventElapsedTime(&time, start, stop);
			time_required += time;
		}
		time_required /= NUM_TESTS;
		std::cout << "Size: " << size << "\tTests: " << NUM_TESTS << "\tTime: " << time_required << "ms" << std::endl;
	}
}

