Adding default constructors to support legacy code.
@@ -262,6 +262,12 @@ public:
}
#endif
+ __device__ CArray() : data_(NULL), size_(1)
+ {
+ memset(this->shape_, 0, sizeof(this->shape_));
+ memset(this->strides_, 0, sizeof(this->strides_));
+ }
+
__device__ ptrdiff_t size() const {
return size_;
}
@@ -361,6 +367,8 @@ private:
public:
static const int ndim = 0;
+ __device__ CArray() : data_(NULL), size_(1) { }
+
__device__ explicit CArray(T* data) : data_(data), size_(1) { }
template <typename Int>
@@ -382,6 +390,7 @@ public:
}
#endif
+
__device__ ptrdiff_t size() const {
return size_;
}
@@ -461,6 +470,12 @@ public:
}
#endif
+ __device__ CIndexer() : size_(1)
+ {
+ memset(this->shape_, 0, sizeof(this->shape_));
+ memset(this->index_, 0, sizeof(this->index_));
+ }
+
__device__ ptrdiff_t size() const {
return size_;
}
