 }
 
 template<typename T>
-__global__ void matrixTranspose( T* matrix, const std::size_t pitch, const std::size_t r, const std::size_t c ) {
-	const int x = blockIdx.x*blockDim.x+threadIdx.x; // row
-	const int y = blockIdx.y*blockDim.y+threadIdx.y; // column
-	if( x < r and y < c and x < y ) {
+__global__ void matrixTranspose( T* matrix, const std::size_t pitch, const std::size_t n ) {
+	const int x = blockIdx.x*blockDim.x+threadIdx.x; // row
+	const int y = blockIdx.y*blockDim.y+threadIdx.y; // column
+	if( x < n and y < n and x < y ) {
 		T& valXY = *(reinterpret_cast<T*>( reinterpret_cast<char*>(matrix)+(pitch*x) )+y);
 		T& valYX = *(reinterpret_cast<T*>( reinterpret_cast<char*>(matrix)+(pitch*y) )+x);
 		T tmp = valXY;

	cudaMallocPitch( &matrix, &pitch, n*sizeof(double), n );

	dim3 grid( (n+numThreads-1)/numThreads, (n+numThreads-1)/numThreads ), threads( numThreads, numThreads );
	matrixTranspose<<<grid,threads>>>( matrix, pitch, n, n );

	stop.record();
	stop.synchronize();

	T* AB,
	std::size_t pitchAB
);
template<typename T> __global__ void matrixMultiply( const ecuda::matrix<T> A, const ecuda::matrix<T> B, ecuda::matrix<T> AB );

template<typename T> __global__ void matrixTranspose( T* matrix, const std::size_t pitch, const std::size_t n );
template<typename T> __global__ void matrixTranspose( ecuda::matrix<T> matrix );


