CUDA version of histogram (d_h) allocated and released only once