Best Method of squeezing multi-dimensional stl vector to one-d stl/thrust vector

Hey all,

I have a toy code I wrote that uses up to 7-dimensional STL vectors of int and double types. Before I get chastized to no end for doing this, let me explain that this was simply a code I wrote for my own scientific curiousness and these 7 dims actually made sense - so why trying to be elegant!

Anyways, now I want to throw some parts of the code in to a CUDA kernel, and before I blindly go about brute-forcing these vectors into c-style array (with all the pointer mayhem that will follow) or write some function to flatten this beast to a 1-D STL vector so I can use thrust, is there some better way? Specfically, I see in older posts people saying that Thrust does not accept multi-dim vectors, does thrust 1.4 though? I see nothing in the documentation. Are there any other tools that may help me out?

Thanks all

Ok, here is really the crux of my problem (flattening 7-d matrices and accessing them later: no biggie): i have a few 3-d matrices which are actually non-uniform. That is, for a 3d matrix, matrix[0].size()!=matrix[1].size() and also matrix[0][0].size(); != matrix[0][1].size(); (and so on, so forth).

that is actually a complete pain in the butt. anybody have a good reference for me to look at for that?