#ifndef __CUARRAY_HPP__ #define __CUARRAY_HPP__ namespace amscuda { template class cuarray { public: int length; T* data; __device__ __host__ cuarray(); __device__ __host__ ~cuarray(); //Only call this on the device for thread/block local // dynamic arrays __device__ __host__ int resize(const int _length); __device__ __host__ int size() const; __device__ __host__ T& at(const int I); __device__ __host__ const T& at(const int I) const; __device__ __host__ T& operator[](const int I); __device__ __host__ const T& operator[](const int I) const; __host__ int device_send(cuarray **dptr); __host__ int _device_send_overwrite(cuarray **dptr); __host__ int _device_send_copy(cuarray *dptr); __host__ int device_pull(cuarray *dptr); __host__ int device_free(cuarray **dptr); __host__ int device_length(cuarray *dptr); __host__ T* device_data_ptr(cuarray *dptr); }; void test_cuarray(); }; #include #endif