experimenting

This commit is contained in:
Chao Liu
2019-03-24 12:09:57 -05:00
parent f35c64eb78
commit 766b0a9eaf
33 changed files with 1886 additions and 1822 deletions

View File

@@ -1,18 +1,18 @@
#pragma once
template <class TData, unsigned NSize>
template <class TData, index_t NSize>
struct Array
{
using Type = Array<TData, NSize>;
static constexpr unsigned nSize = NSize;
static constexpr index_t nSize = NSize;
unsigned mData[nSize];
index_t 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]; }
__host__ __device__ TData operator[](index_t i) const { return mData[i]; }
};