diff --git a/include/ck_tile/core/container/array.hpp b/include/ck_tile/core/container/array.hpp index fa63597db4..94aa40e278 100644 --- a/include/ck_tile/core/container/array.hpp +++ b/include/ck_tile/core/container/array.hpp @@ -19,6 +19,25 @@ namespace ck_tile { // array buf {3, 2}; => {3, 2, 2, 2} (not {3,2,0,0}) // use make_array_with({...}) to construct an array with compatible behavior as old ck // TODO: manually added constructor same as old ck +/** + * @brief A fixed-size array container similar to std::array with additional utilities. + * + * This template class provides a lightweight fixed-size array with value semantics, + * supporting both host and device functionality for GPU programming. It includes + * specialized initialization methods and type punning capabilities. + * + * @tparam T_ The type of elements in the array + * @tparam N_ The fixed number of elements in the array + * + * @note This implementation provides additional features beyond std::array: + * - GPU compatibility via CK_TILE_HOST_DEVICE macros + * - Type punning via get_as() and set_as() methods + * - Various specialized access methods + * - Specialized initialization behaviors + * + * The initializer_list constructor fills remaining elements with the last value + * provided if the list size is smaller than N, which is different than std::array. + */ template struct array { @@ -142,6 +161,14 @@ struct array // empty Array +/// @brief Specialization of array container for zero elements. +/// +/// This is a specialization of the array container template for the case where the number of +/// elements is 0. It provides the same interface as the general array template, but with operations +/// appropriate for an empty array. +/// +/// @tparam T The type of elements stored in the array (not used in this specialization but +/// maintained for API consistency). template struct array {