mirror of
https://github.com/ROCm/composable_kernel.git
synced 2026-05-17 11:30:02 +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>
[ROCm/composable_kernel commit: 8784a72e23]
31 lines
735 B
C++
31 lines
735 B
C++
// SPDX-License-Identifier: MIT
|
|
// Copyright (c) 2018-2022, Advanced Micro Devices, Inc. All rights reserved.
|
|
|
|
#include <cstdlib>
|
|
#include <iostream>
|
|
|
|
#include "profiler_operation_registry.hpp"
|
|
|
|
static void print_helper_message()
|
|
{
|
|
std::cout << "arg1: tensor operation " << ProfilerOperationRegistry::GetInstance() << std::endl;
|
|
}
|
|
|
|
int main(int argc, char* argv[])
|
|
{
|
|
if(argc == 1)
|
|
{
|
|
print_helper_message();
|
|
}
|
|
else if(const auto operation = ProfilerOperationRegistry::GetInstance().Get(argv[1]);
|
|
operation.has_value())
|
|
{
|
|
return (*operation)(argc, argv);
|
|
}
|
|
else
|
|
{
|
|
std::cerr << "cannot find operation: " << argv[1] << std::endl;
|
|
return EXIT_FAILURE;
|
|
}
|
|
}
|