                                       src_rows, src_column_size);
 
   // transfer results back to host
-  cudaMemcpy(l_result_array, l_result_array_d, num_bytes_result,
-             cudaMemcpyDeviceToHost);
+  gpuErrchk(cudaMemcpy(l_result_array, l_result_array_d, num_bytes_result,
+             cudaMemcpyDeviceToHost));
 
   // de-linearize result array
   for (row = 0; row < result_row_size; row++) {

    }
  }
  int *l_source_array_d = 0;
  cudaMalloc((void **)&l_source_array_d, num_bytes_source);
  cudaMemcpy(l_source_array, l_source_array_d, num_bytes_source,
             cudaMemcpyHostToDevice);

  int result_column_size = src_column_size - 2;
  int result_row_size = src_rows - 2;

  int *l_result_array = 0;
  int *l_result_array_d = 0;
  l_result_array = (int *)malloc(num_bytes_result);
  gpuErrchk(cudaMalloc((void **)&l_result_array_d, num_bytes_result));
  gpuErrchk(cudaMemcpy(l_result_array, l_result_array_d, num_bytes_result,
             cudaMemcpyHostToDevice));


  // block size should be adjusted to the problem size for performance
