mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-05-03 21:21:22 +00:00
* Separate layouts into separate entities for input, weight, and output tensors. * Add test for handling bias tensor layouts. * Use instance string in builder tests. * Add handling of output bias data types and layouts. * Generalize handling of the elementwise ops. * Test fix. * Create builder for layouts. * Layout builder improvements. * Improve layout builder. * Simplify bias layout handling. * Code clean-up. * Move layout utils into separate file. * Remove hard-coded layout combinations. * Small code clean-up. * Move data type utils into a separate file. * Add data types, layouts, and elementwise ops per conv tensor. * Builder bug fixes after refactoring. * Working baseline. * Make signature definition look nice in the test code. * Move TensorConfig into test implementations. * Fix all fwd conv builder tests. * Fix conv traits and descriptors tests. * More factory assets under a separate directory. * Fix building conv traits. * Fix clang-format. * Add Readme doc to describe the design. * Add link to main Readme. Fix links in the builder design doc. * Clean-up data type/layout/elementwise op conversions. * Switch from dimension and tensor type specific layouts to a flat list of tensor layouts. * Fix clang-formatting. * Fix clang-format for test code. * Simplify fwd conv signature definitions in the test code. * Remove accidental edits. * Fix comment string. * Fix instance factory after rebase. * Fix tests after rebase. * Unify layout handling. * Add more conv layout unit tests. * Clang-format. * Fix merge conflicts. * Improve elementwise op handling. --------- Co-authored-by: Ville Pietilä <>
32 lines
880 B
C++
32 lines
880 B
C++
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
#pragma once
|
|
|
|
#include <gtest/gtest.h>
|
|
#include <gmock/gmock.h>
|
|
|
|
namespace ck_tile::builder::test_utils {
|
|
using namespace test;
|
|
|
|
// Common test implementation
|
|
template <typename Builder>
|
|
constexpr void run_test(const std::vector<std::string>& kernel_instance_components)
|
|
{
|
|
auto instance = typename Builder::Instance{};
|
|
|
|
const auto kernel_string = instance.GetInstanceString();
|
|
std::cout << "Generated kernel: " << kernel_string << std::endl;
|
|
EXPECT_GT(kernel_string.size(), 0);
|
|
|
|
const auto invoker_ptr = instance.MakeInvokerPointer();
|
|
EXPECT_NE(invoker_ptr, nullptr);
|
|
|
|
for(const auto& component : kernel_instance_components)
|
|
{
|
|
EXPECT_THAT(kernel_string, ::testing::HasSubstr(component));
|
|
}
|
|
}
|
|
|
|
} // namespace ck_tile::builder::test_utils
|