/* cupbmio
 * 
 * Routines for allocating, freeing, and moving the standard PBM image
 * format to and from CUDA devices
 *
 * Jerod Weinman
 * 13 August 2012
 */
#ifndef __CUPBMIO_H__
#define __CUPBMIO_H__

#include "pbmio.h"

/* Allocate memory for a pbm_t on the CUDA device.
 * Returns a pointer to device global memory (or NULL upon failure) */
bit* cu_pbmalloc (int rows, int cols);

/* Copy the data from host pbm_t to device memory.
 * Assumes the buffers are the same size.
 * Returns 0 upon success. */
int hd_pbmcopy( bit *dst, const pbm_t *src);

/* Copy the data from device memory to host pbm_t.
 * Assumes the buffers are the same size.
 * Returns 0 upon success. */
int dh_pbmcopy( pbm_t *dst,  bit *src);

/* Copy the data across device memory.
 * Assumes the buffers are the same size.
 * Returns 0 upon success. */
int dd_pbmcopy( bit *dst,  bit *src, int numRows, int numCols);


#endif
