Passing structures from host to device

If I have structures residing on the CPU defined as:

typedef struct info {

std::vector var1;
std::vector var2;



typedef struct newComplex {

float *realp;
float *imagp;


Is it possible to allocate memory for these structures and their contents on the GPU and copy to that device?

If so, could someone please provide an example?

Was able to do this for a simple structure containing just doubles and floats, but encountered problems when trying to use the std::vector .

I’m using CUDA ver 3.0 on a Linux system.

AFAIK, there is no support for STL containers in device code. The Thrust library provides a mechanism for flattening host side STL containers and pushing them onto the device, but that is about as good as you can do at the moment, I think.