diff --git a/include/ck_tile/core/container/sequence.hpp b/include/ck_tile/core/container/sequence.hpp index acb6359b28..ee4805234c 100644 --- a/include/ck_tile/core/container/sequence.hpp +++ b/include/ck_tile/core/container/sequence.hpp @@ -1143,13 +1143,16 @@ struct sorted_sequence_histogram, sequence> }; } // namespace detail +template +struct array; // declare for later use (array->seq utility) + // SeqSortedSamples: <0, 2, 3, 5, 7>, SeqRange: <0, 3, 6, 9> -> SeqHistogram : <2, 2, 1> template CK_TILE_HOST_DEVICE constexpr auto histogram_sorted_sequence(SeqSortedSamples, sequence) { constexpr auto bins = sizeof...(rs); // or categories constexpr auto histogram = [&]() { - trivial_array h{0}; // make sure this can clear all element to zero + array h{0}; // make sure this can clear all element to zero detail::sorted_sequence_histogram<0, SeqSortedSamples, sequence>{}(h); return h; }(); @@ -1162,7 +1165,7 @@ CK_TILE_HOST_DEVICE constexpr auto generate_array(F&& f, number) { using T = remove_cvref_t{}))>; - return unpack([&f](auto&&... is) { return trivial_array{f(is)...}; }, + return unpack([&f](auto&&... is) { return array{f(is)...}; }, typename arithmetic_sequence_gen<0, N, 1>::type{}); } diff --git a/include/ck_tile/core/container/trivial_array.hpp b/include/ck_tile/core/container/trivial_array.hpp index e1355a400b..0223b20145 100644 --- a/include/ck_tile/core/container/trivial_array.hpp +++ b/include/ck_tile/core/container/trivial_array.hpp @@ -16,6 +16,6 @@ struct trivial_array constexpr const T& operator[](index_t i) const { return data[i]; } constexpr T& operator[](index_t i) { return data[i]; } - constexpr index_t size() const { return N; } + constexpr static index_t size() { return N; } }; } // namespace ck_tile