Template Class FullTensorWrap< const T, N >
Defined in File FullTensorWrap.hpp
Class Documentation
-
template<typename T, int N>
class FullTensorWrap<const T, N> -
Public Functions
-
FullTensorWrap() = default
- template<typename DataType> inline explicit __host__ __device__ FullTensorWrap (const DataType *data, const int(&strides)[N], const int(&shapes)[N])
Constructs a constant FullTensorWrap by wrapping a const
data
pointer argument.- Parameters:
- Template Parameters:
DataType – Type of (inferred from) the data pointer argument.
-
inline __host__ FullTensorWrap(const TensorDataStridedCuda &tensor)
Constructs a constant FullTensorWrap by wrapping a
tensor
argument.- Parameters:
tensor – [in] Tensor reference to the tensor that will be wrapped.
- inline __host__ __device__ const int * strides () const
Get strides in bytes for read-only access.
- Returns:
The const array (as a pointer) containing the strides in bytes.
- inline __host__ __device__ const int * shapes () const
Get shapes for read-only access.
- Returns:
The const array (as a pointer) containing the shapes.
- template<typename DimType> inline const __host__ __device__ T & operator[] (DimType c) const
Subscript operator for read-only access.
- Parameters:
c – [in] N-D coordinate (from last to first dimension) to be accessed.
- Returns:
Accessed const reference.
- template<typename... Args> inline const __host__ __device__ T * ptr (Args... c) const
Get a read-only proxy (as pointer) at the Dth dimension.
- Parameters:
c0..D – [in] Each coordinate from first to last dimension.
- Returns:
The const pointer to the beginning of the Dth dimension.
Public Static Attributes
-
static constexpr int kConstantStrides = 0
Protected Functions
- template<typename... Args> inline const __host__ __device__ T * doGetPtr (Args... c) const
-
FullTensorWrap() = default