mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-05-03 05:01:25 +00:00
Dlejeune/ck tile 2d multiple reductions (#3147)
* WIP * Add Unit tests for the Multi Reduction Kernel * clang format * Rename multiblock to threadwise * Multiblock WIP * Fix multi reduce multi block unit tests * Multi Reduce Tile Engine: WIP * refactoring + try addressing precision error * Fix multiops examples * Cleanup * Clean up tile engine's reduce op * Update changelog * Fix remod/clang * Fix dates * Fix documentation & missing file * Fix comments * Use the update_tile api in the multi-block kernel * Unify threadwise/multiblock into a single kernel + default multiblock output to float in tests * Add TileParitioner * Cleanup * Add warning when no data to process, in the example * Refactoring Reduce kernel Tile Partioner + cleanup * Move the tile partioner to its own file * Add missing includes * Fix copyright header with update_amd_copyright_headers.py * Fix change of interface in Reduce2dProblem --------- Co-authored-by: Damien Lejeune <damien.lejeune@amd.com> Co-authored-by: Adam Osewski <19374865+aosewski@users.noreply.github.com>
This commit is contained in:
34
test/ck_tile/reduce/test_multi_reduce2d_common.hpp
Normal file
34
test/ck_tile/reduce/test_multi_reduce2d_common.hpp
Normal file
@@ -0,0 +1,34 @@
|
||||
// Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ck_tile/ops/elementwise.hpp"
|
||||
// Overload methods required for the parametrize tests
|
||||
|
||||
// Overload for PassThrough (no parameter)
|
||||
inline ck_tile::element_wise::PassThrough make_elementwise_op(int32_t,
|
||||
ck_tile::element_wise::PassThrough)
|
||||
{
|
||||
return ck_tile::element_wise::PassThrough{};
|
||||
}
|
||||
|
||||
// Overload for UnaryDivide (needs parameter)
|
||||
inline ck_tile::element_wise::UnaryDivide make_elementwise_op(int32_t total_reduce_elements,
|
||||
ck_tile::element_wise::UnaryDivide)
|
||||
{
|
||||
return ck_tile::element_wise::UnaryDivide{total_reduce_elements};
|
||||
}
|
||||
|
||||
// Overload for UnarySquare (no parameter)
|
||||
inline ck_tile::element_wise::UnarySquare make_elementwise_op(int32_t,
|
||||
ck_tile::element_wise::UnarySquare)
|
||||
{
|
||||
return ck_tile::element_wise::UnarySquare{};
|
||||
}
|
||||
|
||||
template <typename... Ops>
|
||||
auto make_elementwise_ops_tuple(int32_t total_reduce_elements, ck_tile::tuple<Ops...>)
|
||||
{
|
||||
return ck_tile::make_tuple(make_elementwise_op(total_reduce_elements, Ops{})...);
|
||||
}
|
||||
Reference in New Issue
Block a user