         fflush(stdout);
     } while (!grid_equ);
     // } while (0);
+
+    // // TODO : remove
+    // for (unsigned int i = 0; i < pixel_equ_size; i++) {
+    //     if (pixel_equ[i] != 1) {
+    //         printf("pixel_equ[%u] = %u\n", i, pixel_equ[i]);
+    //         fflush(stdout);
+    //     }
+    // }
 
     // bring data back from device
     cudaMemcpy((*dst_bitmap)->data, d_dst_data, data_size, cudaMemcpyDeviceToHost);

        //     fflush(stdout);
        // }

        and_reduction<<<1, block_dim.x * block_dim.y, block_dim.x * block_dim.y * sizeof(uint8_t)>>>(d_block_equ, d_grid_equ, block_equ_size);

        // bring d_grid_equ back from device
        cudaMemcpy(&grid_equ, d_grid_equ, grid_equ_size, cudaMemcpyDeviceToHost);

        printf("grid_equ = %u\n", grid_equ);
        fflush(stdout);

        swap_bitmaps((void**) &d_src_data, (void**) &d_dst_data);


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

#define MAX_THREADS_PER_BLOCK 1024

#define PAD_TOP 2
#define PAD_LEFT 2
