title: How to define variable inside the __global__ kernel shared between all threads in the grid in CUDA
body: <p>I want to define variable inside __ global __ kernel which will be the same for all threads. 
  I found in CUDA programming guide, that I can use __ device__ qualifier for this purpose. However, I got an error: __ device__  variable declaration is not allowed inside a function body.
  Thanks</p>