mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-04-19 22:39:03 +00:00
[CK_BUILDER] old ck build fixes (#3075)
* Disable c++20-compat warnings when building old CK in C++20 mode Turns out that this creates some warnings for no good reason. * ck-builder: add missing layouts and element-wise op names For layouts, we can directly use the ::name attribute, which should cover all layouts. For element-wise ops, I just added the ones which are currently missing when compiling CK with -DMIOPEN_REQ_LIBS_ONLY.
This commit is contained in:
@@ -99,6 +99,9 @@ else()
|
||||
-Wno-unused-lambda-capture
|
||||
-Wno-nvcc-compat
|
||||
)
|
||||
if(CK_CXX_STANDARD GREATER_EQUAL 20)
|
||||
list(APPEND CMAKE_COMPILER_WARNINGS -Wno-c++20-compat)
|
||||
endif()
|
||||
else()
|
||||
if (CMAKE_${COMPILER}_COMPILER_ID MATCHES "GNU" AND ${COMPILER} MATCHES "CXX")
|
||||
# cmake 3.5.2 does not support >=.
|
||||
|
||||
@@ -60,45 +60,38 @@ consteval std::string_view type_name()
|
||||
template <typename T>
|
||||
constexpr std::string_view layout_name()
|
||||
{
|
||||
// Convolution layouts
|
||||
if constexpr(std::is_same_v<T, ck::tensor_layout::convolution::GNHWC>)
|
||||
return "GNHWC";
|
||||
else if constexpr(std::is_same_v<T, ck::tensor_layout::convolution::GKYXC>)
|
||||
return "GKYXC";
|
||||
else if constexpr(std::is_same_v<T, ck::tensor_layout::convolution::GNHWK>)
|
||||
return "GNHWK";
|
||||
else if constexpr(std::is_same_v<T, ck::tensor_layout::convolution::GKZYXC>)
|
||||
return "GKZYXC";
|
||||
else if constexpr(std::is_same_v<T, ck::tensor_layout::convolution::GNDHWC>)
|
||||
return "GNDHWC";
|
||||
else if constexpr(std::is_same_v<T, ck::tensor_layout::convolution::GNDHWK>)
|
||||
return "GNDHWK";
|
||||
else if constexpr(std::is_same_v<T, ck::tensor_layout::convolution::NHWGC>)
|
||||
return "NHWGC";
|
||||
else if constexpr(std::is_same_v<T, ck::tensor_layout::convolution::KYXGC>)
|
||||
return "KYXGC";
|
||||
else if constexpr(std::is_same_v<T, ck::tensor_layout::convolution::NHWGK>)
|
||||
return "NHWGK";
|
||||
if constexpr(requires {
|
||||
{ T::name } -> std::convertible_to<std::string_view>;
|
||||
})
|
||||
return T::name;
|
||||
else
|
||||
static_assert(false, "unknown_layout");
|
||||
static_assert(false, "layout type is missing name attribute");
|
||||
}
|
||||
|
||||
// Convert element-wise operation types to string names
|
||||
template <typename T>
|
||||
constexpr std::string_view elementwise_op_name()
|
||||
{
|
||||
if constexpr(std::is_same_v<T, ck::tensor_operation::element_wise::PassThrough>)
|
||||
namespace element_wise = ck::tensor_operation::element_wise;
|
||||
|
||||
if constexpr(std::is_same_v<T, element_wise::PassThrough>)
|
||||
return "PassThrough";
|
||||
else if constexpr(std::is_same_v<T, ck::tensor_operation::element_wise::Scale>)
|
||||
else if constexpr(std::is_same_v<T, element_wise::Scale>)
|
||||
return "Scale";
|
||||
else if constexpr(std::is_same_v<T, ck::tensor_operation::element_wise::Bilinear>)
|
||||
else if constexpr(std::is_same_v<T, element_wise::Bilinear>)
|
||||
return "Bilinear";
|
||||
else if constexpr(std::is_same_v<T, ck::tensor_operation::element_wise::Add>)
|
||||
else if constexpr(std::is_same_v<T, element_wise::Add>)
|
||||
return "Add";
|
||||
else if constexpr(std::is_same_v<T, ck::tensor_operation::element_wise::AddRelu>)
|
||||
else if constexpr(std::is_same_v<T, element_wise::AddRelu>)
|
||||
return "AddRelu";
|
||||
else if constexpr(std::is_same_v<T, ck::tensor_operation::element_wise::Relu>)
|
||||
else if constexpr(std::is_same_v<T, element_wise::Relu>)
|
||||
return "Relu";
|
||||
else if constexpr(std::is_same_v<T, element_wise::BiasNormalizeInInferClamp>)
|
||||
return "BiasNormalizeInInferClamp";
|
||||
else if constexpr(std::is_same_v<T, element_wise::Clamp>)
|
||||
return "Clamp";
|
||||
else if constexpr(std::is_same_v<T, element_wise::AddClamp>)
|
||||
return "AddClamp";
|
||||
else
|
||||
static_assert(false, "unknown_op");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user