Is this Code is correct ?

Hi All,

[codebox]typedef struct align(16)

{

unsigned char x[8][8];

unsigned char y[8][8];

unsigned char z[8][8];

unsigned char w[8][8];

}TEMP;

device

getValue( unsigned char temp, unsigned char inArray,int i )

{

for (int l = 0; l < 8; l++)

{

	int dl = i<<2;

	temp[0][l] = inArray[dl+0]; 

	temp[1][l] = inArray[dl+1]; 

	temp[2][l] = inArray[dl+2]; 

	temp[3][l] = inArray[dl+3]; 

	temp[4][l] = inArray[dl+4]; 

	temp[5][l] = inArray[dl+5];

	temp[6][l] = inArray[dl+6]; 

	temp[7][l] = inArray[dl+7];

}

}

global

void kernell_fun( unsigned char inArray, unsigned char outArray )

{

TEMP temp;

int iteration = 0;

getValue(temp.x, inArray, iteration );

iteration = 1;

getValue(temp.y, inArray, iteration );

iteration = 2;

getValue(temp.z, inArray, iteration );

iteration = 3;

getValue(temp.w, inArray, iteration );

}[/codebox]

can I declare TEMP structure variable in kernell_fun() function? Is it valid?

There is nothing invalid about the structure, but the rest of the code is nonsense.