mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-06-30 19:57:40 +00:00
Generalized version to StringLiteral.
With the change, the following can be used for the version parameter: "0.1.0" // string literal constexpr char API_VERSION[] = "0.1.0"; constexpr ckb::StringLiteral API_VERSION = "0.1.0";
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
#include <concepts>
|
||||
#include <type_traits>
|
||||
|
||||
#include "conv_builder_reference.hpp"
|
||||
#include <ck_tile/builder/conv_algorithm.hpp>
|
||||
#include <ck_tile/builder/conv_factory.hpp>
|
||||
#include <ck_tile/builder/conv_signature.hpp>
|
||||
@@ -23,7 +22,7 @@ namespace ck_tile::builder {
|
||||
* @tparam ALGORITHM The specific convolution algorithm to be used for the implementation.
|
||||
* @tparam VERSION The version of the builder implementation.
|
||||
*/
|
||||
template <ConvSignature auto SIGNATURE, ConvAlgorithm auto ALGORITHM, auto VERSION>
|
||||
template <ConvSignature auto SIGNATURE, ConvAlgorithm auto ALGORITHM, StringLiteral VERSION>
|
||||
requires SupportedVersion<VERSION>
|
||||
struct ConvBuilder
|
||||
{
|
||||
|
||||
@@ -3,13 +3,14 @@
|
||||
#include <concepts>
|
||||
#include <string_view>
|
||||
|
||||
#include <ck_tile/builder/builder_utils.hpp>
|
||||
|
||||
namespace ck_tile::builder {
|
||||
|
||||
static constexpr char V0_0_0[] = "0.0.0";
|
||||
static constexpr char V0_1_0[] = "0.1.0";
|
||||
static constexpr StringLiteral V0_0_0 = "0.0.0";
|
||||
static constexpr StringLiteral V0_1_0 = "0.1.0";
|
||||
|
||||
template <const char* V>
|
||||
concept SupportedVersion = (std::string_view{V} == std::string_view{V0_0_0}) ||
|
||||
(std::string_view{V} == std::string_view{V0_1_0});
|
||||
template <StringLiteral V>
|
||||
concept SupportedVersion = (V == V0_0_0) || (V == V0_1_0);
|
||||
|
||||
} // namespace ck_tile::builder
|
||||
|
||||
@@ -20,7 +20,8 @@ struct DefaultFwdConvAlgorithm
|
||||
};
|
||||
static_assert(ckb::ConvAlgorithm<DefaultFwdConvAlgorithm>);
|
||||
|
||||
static constexpr char API_VERSION[] = "0.1.0";
|
||||
constexpr char API_VERSION[] = "0.1.0";
|
||||
static_assert(ckb::SupportedVersion<API_VERSION>);
|
||||
|
||||
TEST(ConvBuilderTest, TestDefaultInstance)
|
||||
{
|
||||
|
||||
@@ -14,7 +14,8 @@ struct FwdConvSignature
|
||||
};
|
||||
static_assert(ckb::ConvSignature<FwdConvSignature>);
|
||||
|
||||
static constexpr char API_VERSION[] = "0.1.0";
|
||||
constexpr char API_VERSION[] = "0.1.0";
|
||||
static_assert(ckb::SupportedVersion<API_VERSION>);
|
||||
|
||||
struct FwdConvAlgorithm
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user