How can I use my custom struct in OpenCL? Because there are no array of objects in OpenCL, or 2D array beside image.
struct Block {
char item[4][4];
};
I would like to use array of these structs in OpenCL and access its elements by indices like in C/C++. For example
Block *keys = new Block[11];
keys[3].item[2][2];
Let me explane. I am working on implementing AES-128 ECB in OpenCL. Here is AES description. These structs(blocks) I used for dividing plaintext into blocks 4x4 bytes. This array of 11 blocks is 11 keys for each round. I did same thing with plaintext. For example, plaintext of 67bytes is divided into 5 blocks. In C this is working very well in sequential execution (key scheduling, subbytes, shift rows, mixcolumns, addround) encryption and decryption. But problem now is that is not simple like that in OpenCL. How can I use array of these blocks in OpenCL? Or do I need to transform everything into 1D array of char (for example)?