refactoring ConstantTensorDescriptor

This commit is contained in:
Chao Liu
2019-03-17 03:22:41 -05:00
parent fd8de38417
commit a0584426ff
9 changed files with 452 additions and 340 deletions

18
src/include/Array.hip.hpp Normal file
View File

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