Files
composable_kernel/src/include/Array.hip.hpp
2019-03-24 12:09:57 -05:00

19 lines
375 B
C++

#pragma once
template <class TData, index_t NSize>
struct Array
{
using Type = Array<TData, NSize>;
static constexpr index_t nSize = NSize;
index_t mData[nSize];
template <class... Xs>
__host__ __device__ Array(Xs... xs) : mData{static_cast<TData>(xs)...}
{
}
__host__ __device__ TData operator[](index_t i) const { return mData[i]; }
};