mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-04-20 06:49:15 +00:00
[CK_TILE] Tile loop persistent gemm kernel (#2191)
* Implement tile loop persistent gemm kernel * Enable timing * Add tests for persistent gemm * Fix formatting * Fix gemm_basic * Rename True/False to Persistent/NonPersistent * Use only one set of layouts for persistent tests * Fix gemm example persistent template parameter * Fix formatting
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "ck_tile/core/config.hpp"
|
||||
#include <tuple>
|
||||
#include <type_traits>
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -138,4 +139,33 @@ struct is_specialization_of<RefTemplate<Args...>, RefTemplate> : std::true_type
|
||||
{
|
||||
};
|
||||
|
||||
// Helper to get a tuple element or default type
|
||||
namespace detail {
|
||||
|
||||
template <bool IsWithinBounds, std::size_t Idx, typename Tuple, typename DefaultType>
|
||||
struct tuple_element_or_default_dispatch
|
||||
{
|
||||
using type = DefaultType;
|
||||
};
|
||||
|
||||
template <std::size_t Idx, typename Tuple, typename DefaultType>
|
||||
struct tuple_element_or_default_dispatch<true, Idx, Tuple, DefaultType>
|
||||
{
|
||||
using type = std::tuple_element_t<Idx, Tuple>;
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
|
||||
template <typename Tuple_, std::size_t Idx, typename DefaultType>
|
||||
struct tuple_element_or_default
|
||||
{
|
||||
using Tuple = remove_cvref_t<Tuple_>;
|
||||
static constexpr bool is_within_bounds = Idx < std::tuple_size_v<Tuple>;
|
||||
using type = typename detail::
|
||||
tuple_element_or_default_dispatch<is_within_bounds, Idx, Tuple, DefaultType>::type;
|
||||
};
|
||||
template <typename Tuple_, std::size_t Idx, typename DefaultType>
|
||||
using tuple_element_or_default_t =
|
||||
typename tuple_element_or_default<Tuple_, Idx, DefaultType>::type;
|
||||
|
||||
} // namespace ck_tile
|
||||
|
||||
Reference in New Issue
Block a user