   }
 };
 
-template <int ndim>
+template <int _ndim>
 class CIndexer {
+public:
+  static const int ndim = _ndim;
 private:
   ptrdiff_t size_;
   ptrdiff_t shape_[ndim];

  ptrdiff_t size_;

public:
  __device__ int size() const {
    return size_;
  }

         i < (n); \
         i += blockDim.x * gridDim.x)

template <typename T, int _ndim>
class CArray {
public:
  static const int ndim = _ndim;
private:
  T* data_;
  ptrdiff_t size_;
