 	cudaFree( AB );
 
 	stop.record();
+	CUDA_CHECK_ERRORS();
 	stop.synchronize();
 
 	return ( stop - start );

__global__ void matrixTranspose( ecuda::matrix<T> matrix ) {
	const int x = blockIdx.x*blockDim.x+threadIdx.x; // row
	const int y = blockIdx.y*blockDim.y+threadIdx.y; // column
	if( x < matrix.number_rows() and y < matrix.number_columns() and x < y ) ecuda::swap( matrix[y][x], matrix[x][y] );
}

template<typename T>

	matrixTranspose<<<grid,threads>>>( matrix, pitch, n );

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

	cudaFree( matrix );
