mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-05-12 09:16:52 +00:00
* Re-structure ckProfiler source files * Rename profiler.cpp to main.cpp * Modularize ckProfiler operations * Add description for profiler operations * Use longer name to avoid name collision * Use macro to delay expansion * Use std::move() to avoid object copying * Prohibit users from calling dtor * Use macro to eliminate redundant code * Make friend function hidden * Add missing include directive <iostream> * Fix wrong include directives * Remove int8 from batchnorm-forward instances since it is not needed for forward training and could fail test Co-authored-by: Qianfeng Zhang <Qianfeng.Zhang@amd.com>
45 lines
1.4 KiB
C++
45 lines
1.4 KiB
C++
// SPDX-License-Identifier: MIT
|
|
// Copyright (c) 2018-2022, Advanced Micro Devices, Inc. All rights reserved.
|
|
|
|
#include <iostream>
|
|
|
|
#include "profiler/profile_batched_gemm_impl.hpp"
|
|
|
|
namespace {
|
|
using ADataType = ck::half_t;
|
|
using BDataType = ck::half_t;
|
|
using CDataType = ck::half_t;
|
|
|
|
using Row = ck::tensor_layout::gemm::RowMajor;
|
|
using Col = ck::tensor_layout::gemm::ColumnMajor;
|
|
} // namespace
|
|
|
|
int main()
|
|
{
|
|
int M = 512;
|
|
int N = 256;
|
|
int K = 128;
|
|
int BatchCount = 3;
|
|
|
|
bool pass = true;
|
|
|
|
pass = pass &&
|
|
ck::profiler::profile_batched_gemm_impl<ADataType, BDataType, CDataType, Row, Row, Row>(
|
|
true, 1, false, 1, M, N, K, K, N, N, M * K, K * N, M * N, BatchCount);
|
|
|
|
pass = pass &&
|
|
ck::profiler::profile_batched_gemm_impl<ADataType, BDataType, CDataType, Row, Col, Row>(
|
|
true, 1, false, 1, M, N, K, K, K, N, M * K, K * N, M * N, BatchCount);
|
|
|
|
pass = pass &&
|
|
ck::profiler::profile_batched_gemm_impl<ADataType, BDataType, CDataType, Col, Row, Row>(
|
|
true, 1, false, 1, M, N, K, M, N, N, M * K, K * N, M * N, BatchCount);
|
|
|
|
pass = pass &&
|
|
ck::profiler::profile_batched_gemm_impl<ADataType, BDataType, CDataType, Col, Col, Row>(
|
|
true, 1, false, 1, M, N, K, M, K, N, M * K, K * N, M * N, BatchCount);
|
|
|
|
std::cout << "test BatchedGEMM fp16: " << (pass ? "Pass" : "Fail") << std::endl;
|
|
return pass ? 0 : 1;
|
|
}
|