I want to declare a shared matrix in the global address space but not to perform any calculations by the UPC threads, but the GPU using CUDA.
So is it possible to declare a UPC shared array in which the number elements in the array is NOT equal or a multiply of the number of threads (THREADS variable) ?
Assign the number of threads at the compile time using upcc flags. For more information on upcc flags check upcc man page.