Commit a289f7b2 authored by Chao Liu's avatar Chao Liu
Browse files

refactoring Array

parent 84bbb63e
...@@ -99,7 +99,7 @@ struct DummyStaticTransform ...@@ -99,7 +99,7 @@ struct DummyStaticTransform
#pragma unroll 1 #pragma unroll 1
for(index_t k = 0; k < 100; ++k) for(index_t k = 0; k < 100; ++k)
{ {
coord += Array<index_t, 2>{{8, 0}}; coord += make_multi_index(8, 0);
Float value = 1; Float value = 1;
transfer_data<Float, transfer_data<Float,
......
...@@ -10,7 +10,7 @@ template <index_t N> ...@@ -10,7 +10,7 @@ template <index_t N>
using MultiIndex = Array<index_t, N>; using MultiIndex = Array<index_t, N>;
template <typename... Xs> template <typename... Xs>
__host__ __device__ constexpr auto make_multi_index(Xs... xs) __host__ __device__ constexpr auto make_multi_index(const Xs&... xs)
{ {
return make_array<index_t>(xs...); return make_array<index_t>(xs...);
} }
......
...@@ -55,7 +55,7 @@ __host__ __device__ constexpr auto make_array(const X& x, const Xs&... xs) ...@@ -55,7 +55,7 @@ __host__ __device__ constexpr auto make_array(const X& x, const Xs&... xs)
template <typename X, typename... Xs> template <typename X, typename... Xs>
__host__ __device__ constexpr auto make_array(X&& x, Xs&&... xs) __host__ __device__ constexpr auto make_array(X&& x, Xs&&... xs)
{ {
return Array<remove_cv_t<remove_reference_t<X>>, sizeof...(Xs) + 1>(x, xs...); return Array<remove_cv_t<remove_reference_t<X>>, sizeof...(Xs) + 1>{{x, xs...}};
} }
#endif #endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment