Files
composable_kernel/test/gemm_reduce/gemm_reduce_fp16_xdl.cpp
linqunAMD e78a897ec0 [CK] Add command option instance_index and param_mask to run partial ck test (#2889)
* [CK] Add command option instance_index and param_mask to run partial ck test

Many CK test are instance test. it will loop all instance in the instance library. It causes test often out-of-time if we run test on simulator/emulator.
This PR add option instance_index and param_mask to reduce the workload of instance test

instance_index: only run test 1 available instance with specified index.
param_mask: filter the embedded parameter with specified mask

* fix CI error

* fix clang format

---------

Co-authored-by: illsilin_amdeng <Illia.Silin@amd.com>
2025-09-30 08:24:40 -07:00

61 lines
1.7 KiB
C++

// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2023, Advanced Micro Devices, Inc. All rights reserved.
#include <iostream>
#include "profiler/profile_gemm_reduce_impl.hpp"
static ck::index_t instance_index = -1;
int main(int argc, char** argv)
{
if(argc == 1) {}
else if(argc == 2)
{
instance_index = atoi(argv[1]);
}
else
{
std::cout << "Usage of " << argv[0] << std::endl;
std::cout << "Arg1: instance_index(-1 means all)" << std::endl;
}
using Row = ck::tensor_layout::gemm::RowMajor;
using Col = ck::tensor_layout::gemm::ColumnMajor;
int M = 512;
int N = 256;
int K = 128;
bool pass = true;
pass = pass &&
ck::profiler::
profile_gemm_reduce_impl<ck::half_t, ck::half_t, ck::half_t, float, Row, Row, Row>(
true, 1, false, false, M, N, K, K, N, N, instance_index);
pass = pass &&
ck::profiler::
profile_gemm_reduce_impl<ck::half_t, ck::half_t, ck::half_t, float, Row, Col, Row>(
true, 1, false, false, M, N, K, K, K, N, instance_index);
pass = pass &&
ck::profiler::
profile_gemm_reduce_impl<ck::half_t, ck::half_t, ck::half_t, float, Col, Row, Row>(
true, 1, false, false, M, N, K, M, N, N, instance_index);
pass = pass &&
ck::profiler::
profile_gemm_reduce_impl<ck::half_t, ck::half_t, ck::half_t, float, Col, Col, Row>(
true, 1, false, false, M, N, K, M, K, N, instance_index);
if(pass)
{
std::cout << "test GEMM+Reduce fp16: Pass" << std::endl;
return 0;
}
else
{
std::cout << "test GEMM+Reduce fp16: Fail" << std::endl;
return -1;
}
}