 		return MatrixRow(*this, x);
 	}
 	
+	__device__ __host__ unsigned int getWidth() const { return width_; }
+	__device__ __host__ unsigned int getHeight() const { return height_; }
+	__device__ __host__ bool isCPU() const { return isCPU_; }
+	
 	void print() {
 		std::cout << "[" << std::endl;
-		for (unsigned int i(0) ; i != HEIGHT ; i++) {
-			for (unsigned int j(0) ; j != WIDTH ; j++) {
+		for (unsigned int i(0) ; i != height_ ; i++) {
+			for (unsigned int j(0) ; j != width_ ; j++) {
 				std::cout << " " << (*this)[i][j];
 			}
 			std::cout << std::endl;

#define HEIGHT 256
#define NUM_TESTS 1000

#define CHECKBOARD_BLOCK_MAX_WIDTH  16
#define CHECKBOARD_BLOCK_MAX_HEIGHT 16

struct Matrix {
	unsigned int width;
	unsigned int height;
	float *data;
	
	class MatrixRow { // cf. http://stackoverflow.com/questions/3755111/how-do-i-define-a-double-brackets-double-iterator-operator-similar-to-vector-of
		const Matrix &m_;

	int i = blockIdx.x * blockDim.x + threadIdx.x;
	int j = blockIdx.y * blockDim.y + threadIdx.y;
	
	if (i >= d_m.getHeight() || j >= d_m.getWidth())
		return;
	
	atomicAdd(&d_r[i], d_m[i][j] * d_v[j]);
}

