shared memory alignment

Dear All,

I am dynamically allocating shared memory as shown in the code. From the programming guide, arrays has to be aligned. I tried this code but get the following error:

error: expression must have integral or enum type

[codebox]#define ALIGN(ADDRESS, OFFSET) (((ADDRESS) + (OFFSET) - 1) & (~((OFFSET) - 1)))

extern shared char array;

global void decoderKernel( …) {

char syndrome_buffer = (char) ALIGN(array, sizeof(char));

float soft_output = (float) ALIGN(&syndrome_buffer[n], sizeof(float));



Shared memory must reside within the kernel.