 	cudaMallocPitch( &B, &pitchB, p*sizeof(double), m );
 	cudaMallocPitch( &AB, &pitchAB, p*sizeof(double), n );
 
+	cudaMemcpy2D( A, pitchA, pool, sizeof(double)*m, sizeof(double)*m, n, cudaMemcpyHostToDevice );
+	cudaMemcpy2D( B, pitchB, pool+(sizeof(double)*m*n), sizeof(double)*p, sizeof(double)*p, m, cudaMemcpyHostToDevice );
+	cudaMemset( AB, 0, n*p*sizeof(double) );
+
 	dim3 grid( n, (p+numThreads-1)/numThreads ), threads( 1, numThreads );
 	start.record();
 	matrixMultiply<<<grid,threads>>>( A, pitchA, B, pitchB, n, m, p, AB, pitchAB );


	CUDA_CHECK_ERRORS();
	stop.synchronize();

	return ( stop - start );



}

float ecudaMatrixMultiply( const int numThreads, const std::size_t n, const std::size_t m, const std::size_t p, const double* pool ) {

	ecuda::event start, stop;

	ecuda::matrix<double> A( n, m );
	ecuda::matrix<double> B( m, p );
	ecuda::matrix<double> AB( n, p );

	cudaMemcpy2D( A.data(), A.get_pitch(), pool, sizeof(double)*m, sizeof(double)*m, n, cudaMemcpyHostToDevice );
	cudaMemcpy2D( B.data(), B.get_pitch(), pool+(sizeof(double)*m*n), sizeof(double)*p, sizeof(double)*p, m, cudaMemcpyHostToDevice );
	cudaMemset( AB.data(), 0, n*p*sizeof(double) );

	dim3 grid( n, (p+numThreads-1)/numThreads ), threads( 1, numThreads );
	start.record();
