Shared variable in GPU

This should be doable, see the example code in this post: