"git@developer.sourcefind.cn:modelzoo/qwen_lmdeploy.git" did not exist on "b21239a8a3a5a33f3aed98cec7f22e73c0cb9ac9"
Array.hip.hpp 381 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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]; }
};