 
 }
 
-
+// This function loads data and region into the memory of the gpu. After the data is loaded
+// it run a thread on the gpu for each pixel in the image. After all threads are done
+// the finished image is loaded from the gpu to the main memory.
 unsigned char* raycast_gpu(unsigned char* data, unsigned char* region){
   unsigned char* image = (unsigned char*)malloc(sizeof(unsigned char)*IMAGE_DIM*IMAGE_DIM);
 

  return c0;
}

__global__ void raycast_kernel_texture(unsigned char* image){
  // Camera/eye position, and direction of viewing. These can be changed to look
  // at the volume from different angles.

  unsigned char* data = create_data();
  unsigned char* region;
  unsigned char* image;
  int all = 1;
  if(all) {
    gettimeofday(&start, NULL);
    region = grow_region_gpu_shared(data);
    gettimeofday(&end, NULL);
    printf("grow_region_gpu_shared:\n");
    print_time(start, end);

    gettimeofday(&start, NULL);
    region = grow_region_gpu(data);
    gettimeofday(&end, NULL);
    printf("grow_region_gpu:\n");
    print_time(start, end);

    gettimeofday(&start, NULL);
    region = grow_region_serial(data);
    gettimeofday(&end, NULL);
    printf("grow_region_serial:\n");
    print_time(start, end);


    gettimeofday(&start, NULL);
    image = raycast_gpu_texture(data, region);
    gettimeofday(&end, NULL);
    printf("raycast_gpu_texture:\n");
    print_time(start, end);

    gettimeofday(&start, NULL);
    image = raycast_gpu(data, region);
