File tree Expand file tree Collapse file tree 2 files changed +5
-15
lines changed Expand file tree Collapse file tree 2 files changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -364,19 +364,6 @@ struct ArrayCreator<DataT, FlattenF> {
364
364
static constexpr auto Create () { return std::array<DataT, 0 >{}; }
365
365
};
366
366
367
- // Helper function for creating an arbitrary sized array with the same value
368
- // repeating.
369
- template <typename T, size_t ... Is>
370
- static constexpr std::array<T, sizeof ...(Is)>
371
- RepeatValueHelper (const T &Arg, std::index_sequence<Is...>) {
372
- auto ReturnArg = [&](size_t ) { return Arg; };
373
- return {ReturnArg (Is)...};
374
- }
375
- template <size_t N, typename T>
376
- static constexpr std::array<T, N> RepeatValue (const T &Arg) {
377
- return RepeatValueHelper (Arg, std::make_index_sequence<N>());
378
- }
379
-
380
367
// to output exceptions caught in ~destructors
381
368
#ifndef NDEBUG
382
369
#define __SYCL_REPORT_EXCEPTION_TO_STREAM (str, e ) \
Original file line number Diff line number Diff line change @@ -194,6 +194,10 @@ template <typename DataT, int NumElements> class vec_base {
194
194
static constexpr int alignment = (std::min)((size_t )64 , sizeof (DataType));
195
195
alignas (alignment) DataType m_Data;
196
196
197
+ template <size_t ... Is>
198
+ constexpr vec_base (const DataT &Val, std::index_sequence<Is...>)
199
+ : m_Data{((void )Is, Val)...} {}
200
+
197
201
template <size_t ... Is>
198
202
constexpr vec_base (const std::array<DataT, NumElements> &Arr,
199
203
std::index_sequence<Is...>)
@@ -262,8 +266,7 @@ template <typename DataT, int NumElements> class vec_base {
262
266
constexpr vec_base &operator =(vec_base &&) = default ;
263
267
264
268
explicit constexpr vec_base (const DataT &arg)
265
- : vec_base(RepeatValue<NumElements>(arg),
266
- std::make_index_sequence<NumElements>()) {}
269
+ : vec_base(arg, std::make_index_sequence<NumElements>()) {}
267
270
268
271
template <typename ... argTN,
269
272
typename = std::enable_if_t <
You can’t perform that action at this time.
0 commit comments