pointers inside arbb space?

pointers inside arbb space?

Portrait de t.mueller
Hello all I'm just figuring out how to implement a multi-column, multi-type data structure. There are about five types (known at compile-time) and each column can have a different one.  The number of columns and the type for each column is available at runtime only.  2-dim dense containers or a combination of dense containers inside nested containers doesn't fit well. There will be added sophisticated operations on these data structures later.  Is any "pointering" inside arbb space/custom types possible? I already tried to, but something like "new dense" doesn't compile.  Thanks in advance Tobias Mueller
4 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.
Portrait de Noah Clemons (Intel)

Why not create a multidimentional dense container of structs? Check out the section in the User's Guide on custom types. You can create dense containers around those, assuming that each of the individual items are arbb types like i32, etc. There should be some initial examples in there that you can get to compile/run and then modify as you see fit.

Portrait de t.mueller
Thanks for your response.  Structs are something I haven't considered yet - but I see a big issue: The column count/types of a vector are unknown at compile-time.  Let's look at this example vector:  ( 1, 1.0, true) ( 2, 2.0, false) ( 3, 3.0, true) ( 4, 4.0, false) ( ... With a struct I can model single rows:  struct my_row { i64 value1; f64 value2; bool value3; }; And then put these into a variable-sized dense container:  dense my_vector = dense(size); The problem I have is: struct types can't be declared at runtime. Maybe there is another vector which has only two columns. Or another which has 200 columns. This information is available at runtime only.  You also mentioned multidimensional containers (two-dimensional would be enough here). I don't think they help. I do need different types for different columns. Multi-dim containers offer only one type for all elements. Right?  Greetings Tobias Mueller
Portrait de Noah Clemons (Intel)

I found the perfect explanation for your questions here. 

http://redfort-software.intel.com/sites/products/documentation/arbb/arbb...

My best recommendation would be to read through the User-Defined types section and model your code based on the sample. They have an entire struct-based user-defined type written out that you can modify to suit your needs. Also make sure to read on how to declare a function on the type so that it is processed in parallel. It's easy to mess up the function declaration and then it ends up running serial or incur a runtime error.

Connectez-vous pour laisser un commentaire.