     // Computing the grid dimensions depends on PAD_TOP and PAD_LEFT.
     unsigned int block_dim_x = strtol(block_dim_x_string, NULL, 10);
     unsigned int block_dim_y = strtol(block_dim_y_string, NULL, 10);
+    assert((block_dim_x * block_dim_y) <= MAX_THREADS_PER_BLOCK);
+
     unsigned int grid_dim_x = (unsigned int) ceil((src_bitmap->width) / ((double) block_dim_x));
     unsigned int grid_dim_y = (unsigned int) ceil((src_bitmap->height)/ ((double) block_dim_y));
     dim3 block_dim(block_dim_x, block_dim_y);
     dim3 grid_dim(grid_dim_x, grid_dim_y);
+
+    printf("orig img width = %u\n", src_bitmap->width);
+    printf("orig img height = %u\n", src_bitmap->height);
 
     // Pad the binary images with pixels on each side. This will be useful when
     // implementing the skeletonization algorithm, because the mask we use


    printf("src_fname   = %s\n", src_fname);
    printf("dst_fname   = %s\n", dst_fname);
    printf("block dim X = %s\n", block_dim_x_string);
    printf("block dim Y = %s\n", block_dim_y_string);

    // load src image
    Bitmap* src_bitmap = loadBitmap(src_fname);

#include <stdlib.h>
#include "gpu1.cuh"
#include "../common/utils.hpp"

#define MAX_THREADS_PER_BLOCK 1024

#define PAD_TOP 2
#define PAD_LEFT 2
