Q:

How to send this kind of data structure into CUDA efficiently?

I have a data structure like this:
std::vector< float > mystruct[100];
Each vector of mystruct[100] has different size. For example, the size of mystruct[0] is 10, the size of mystruct[1] is 5, the size of mystruct[2] is 12 and so on.
So how can I sent this kind of data structure to CUDA efficiently?

A:

If the host datastructure has to be the way you described, I don't think you can do better than just download each vector individually. 
If you can change the datastructure, you could consider storing all the vectors one after the other in a large piece of memory and download this large piece at once together with an offset table which tells you at what position to find which vector. Of course, in the latter approach resizing a vector can become costly, but maybe you don't need that operation often. Also, if you know a reasonable upper bound on the sizes of the vectors you can try allocating that much space for each vector irrespective of whether it is fully used or not. 

