12 template <
typename TData, index_t NSize>
20 __host__ __device__
static constexpr
index_t Size() {
return NSize; }
22 __host__ __device__ constexpr
const TData&
At(
index_t i)
const {
return mData[i]; }
33 static_assert(T::Size() ==
Size(),
"wrong! size not the same");
39 __host__ __device__ constexpr
const TData*
begin()
const {
return &
mData[0]; }
40 __host__ __device__ constexpr
const TData*
end()
const {
return &
mData[NSize]; }
41 __host__ __device__ constexpr TData*
begin() {
return &
mData[0]; }
42 __host__ __device__ constexpr TData*
end() {
return &
mData[NSize]; }
46 template <
typename TData>
52 __host__ __device__
static constexpr
index_t Size() {
return 0; }
55 template <
typename X,
typename... Xs>
56 __host__ __device__ constexpr
auto make_array(X&& x, Xs&&... xs)
59 return Array<data_type,
sizeof...(Xs) + 1>{ck::forward<X>(x), ck::forward<Xs>(xs)...};
__host__ constexpr __device__ auto make_array(X &&x, Xs &&... xs)
Definition: array.hpp:56
remove_cv_t< remove_reference_t< T > > remove_cvref_t
Definition: type.hpp:297
int32_t index_t
Definition: ck.hpp:298
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1249
TData data_type
Definition: array.hpp:50
__host__ static constexpr __device__ index_t Size()
Definition: array.hpp:52
__host__ constexpr __device__ TData * begin()
Definition: array.hpp:41
__host__ constexpr __device__ TData * end()
Definition: array.hpp:42
__host__ constexpr __device__ const TData & At(index_t i) const
Definition: array.hpp:22
__host__ constexpr __device__ TData & operator()(index_t i)
Definition: array.hpp:28
__host__ constexpr __device__ const TData * begin() const
Definition: array.hpp:39
TData mData[NSize]
Definition: array.hpp:18
__host__ constexpr __device__ TData & At(index_t i)
Definition: array.hpp:24
__host__ constexpr __device__ auto operator=(const T &a)
Definition: array.hpp:31
__host__ constexpr __device__ const TData * end() const
Definition: array.hpp:40
__host__ constexpr __device__ const TData & operator[](index_t i) const
Definition: array.hpp:26
TData data_type
Definition: array.hpp:16
__host__ static constexpr __device__ index_t Size()
Definition: array.hpp:20
Definition: functional2.hpp:33