Deep copy support for structs
Hi OCCA-ers,
For non-trivial (read big-ol-mess) codes, it is sometimes necessary to copy structs (which contain also structs or stl containers) to the GPU & back ... (well at least to the GPU :-)). This avoids costly API changes when more than a handful of functions need to "kernel-ized".
Not sure about the flexibility of the current parser but maybe a low-hanging fruit using source to source tricks could be employed?
Best,
Amik
Structs of structs with basic types (like int/double/nested structs in #141) is probably the next feature to be added, so stay tuned :)
I don't think we can handle pointers in structs easily though, but maybe we can build up another occa::X type that can translate between host <--> device
@amikstcyr Basic structs are now be available in beec0865857f5fbdf55554deb596396b40614357
Missing:
-
typedef-ing structstypedef struct { } foo; -
Expanding
@attributeson struct variablesstruct mat3 { int *values @dim(3, 3); } mat3 m; // Error since the parser right now doesn't "know" `values` is a @dim(3, 3) m.values(0, 0); -
Access level modifiers are not supported at the moment
struct foo { private: ... }