
OpenCl array inside a struct
Posted Tuesday, 3 January, 2012 - 23:06 by marcinkr inHello,
I have been having problem sending a relatively simple structure to GPU:
public struct Structure { /*some other Vectors, floats or integers*/ public float[] Array; }
Corresponding Cl code:
struct __attribute__ ((packed)) Structure { /*as before*/ float4 Transform[4]; };
And while I have no problem with converting Vectors to float4, I have no idea how to proceed with fixed-size arrays.
GCHandle.Alloc(data, GCHandleType.Pinned);
throws an exception, saying that object has wrong data.
Any help?


Comments
Re: OpenCl array inside a struct
You'll probably need this: http://blogs.msdn.com/b/ericgu/archive/2004/08/12/213676.aspx
Re: OpenCl array inside a struct
Great, that's working :)
Thanks