1#ifndef ATEN_CORE_TENSOR_ACCESSOR_H_
2#define ATEN_CORE_TENSOR_ACCESSOR_H_
15#if defined(__CUDACC__) || defined(__HIPCC__)
17struct RestrictPtrTraits {
18 using PtrType =
T* __restrict__;
22template <
typename T,
size_t N,
typename index_t = int64_t,
23 template <
typename U>
class PtrTraits = DefaultPtrTraits>
27 using PtrType =
typename PtrTraits<T>::PtrType;
70template <
typename T,
size_t N,
typename index_t = int64_t,
74 using PtrType =
typename PtrTraits<T>::PtrType;
88template <
typename T,
typename index_t,
89 template <
typename U>
class PtrTraits>
92 using PtrType =
typename PtrTraits<T>::PtrType;
AT_HOST_DEVICE PtrType data()
Definition tensor_accessor.h:56
AT_HOST_DEVICE const index_t * strides() const
Definition tensor_accessor.h:44
T * data_
Definition tensor_accessor.h:65
AT_HOST_DEVICE const PtrType data() const
Definition tensor_accessor.h:60
AT_HOST_DEVICE index_t size(index_t idx) const
Definition tensor_accessor.h:52
AT_HOST_DEVICE const index_t * sizes() const
Definition tensor_accessor.h:40
const index_t * strides_
Definition tensor_accessor.h:67
typename PtrTraits< T >::PtrType PtrType
Definition tensor_accessor.h:27
AT_HOST_DEVICE index_t stride(index_t idx) const
Definition tensor_accessor.h:48
AT_HOST_DEVICE TensorAccessorBase(PtrType data, const index_t *sizes, const index_t *strides)
Definition tensor_accessor.h:29
const index_t * sizes_
Definition tensor_accessor.h:66
typename PtrTraits< T >::PtrType PtrType
Definition tensor_accessor.h:92
AT_HOST_DEVICE const T & operator[](index_t idx) const
Definition tensor_accessor.h:100
AT_HOST_DEVICE TensorAccessor(T *data, const index_t *sizes, const index_t *strides)
Definition tensor_accessor.h:93
AT_HOST_DEVICE T & operator[](index_t idx)
Definition tensor_accessor.h:96
AT_HOST_DEVICE TensorAccessor< T, N - 1, index_t, PtrTraits > operator[](index_t idx)
Definition tensor_accessor.h:79
typename PtrTraits< T >::PtrType PtrType
Definition tensor_accessor.h:74
AT_HOST_DEVICE TensorAccessor(PtrType data, const index_t *sizes, const index_t *strides)
Definition tensor_accessor.h:76
AT_HOST_DEVICE const TensorAccessor< T, N - 1, index_t, PtrTraits > operator[](index_t idx) const
Definition tensor_accessor.h:83
#define N
Definition exp.cpp:24
#define T
Definition exp.cpp:237
#define AT_HOST_DEVICE
Definition macros.h:47
Definition tensor_accessor.h:11
T * PtrType
Definition tensor_accessor.h:12