mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-03-28 19:17:39 +00:00
We only want to import enums and types into the builder reflection code. But, some of the enums are included in much larger files or even big trees of include files. This leads to unintended mixing of code and very confusing interactions and symbol conflicts. We organize the includes and extract two new enum-only headers to help with decoupling in CK. This refactoring is critical if we want to include reflection in a device-operator "describe" method. * Remove a few unnecessary includes from headers in builder/reflect/. * Extract enums scheduler and pipeline to their own headers so they can be used without importing other code. * Order includes alphabetically for better organization. The immediate goal is to unblock reflection integration, and this type of cleanup helps the flexibility and robustness of the CK header library.
41 lines
1.3 KiB
C++
41 lines
1.3 KiB
C++
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
#pragma once
|
|
|
|
#if !defined(__HIPCC_RTC__) || !defined(CK_CODE_GEN_RTC)
|
|
#include <ostream>
|
|
#endif
|
|
|
|
namespace ck {
|
|
|
|
/// @brief Pipeline version enumeration for GEMM kernels
|
|
/// @details Defines different pipeline strategies for data movement and computation overlap
|
|
/// in GEMM kernels. This is a lightweight header containing only the enum definition,
|
|
/// extracted from gridwise_gemm_pipeline_selector.hpp to minimize dependencies.
|
|
enum struct PipelineVersion
|
|
{
|
|
v1, ///< Version 1 pipeline
|
|
v2, ///< Version 2 pipeline
|
|
// v3 is only used in the Stream-K implementation.
|
|
v4, ///< Version 4 pipeline
|
|
weight_only, ///< Weight-only specialized pipeline
|
|
};
|
|
|
|
} // namespace ck
|
|
|
|
#if !defined(__HIPCC_RTC__) || !defined(CK_CODE_GEN_RTC)
|
|
inline std::ostream& operator<<(std::ostream& os, const ck::PipelineVersion& p)
|
|
{
|
|
switch(p)
|
|
{
|
|
case ck::PipelineVersion::v1: os << "PipelineVersion::v1"; break;
|
|
case ck::PipelineVersion::v2: os << "PipelineVersion::v2"; break;
|
|
case ck::PipelineVersion::v4: os << "PipelineVersion::v4"; break;
|
|
case ck::PipelineVersion::weight_only: os << "PipelineVersion::weight_only"; break;
|
|
default: os << "";
|
|
}
|
|
return os;
|
|
}
|
|
#endif
|