profiler.cpp 735 Bytes
Newer Older
Chao Liu's avatar
Chao Liu committed
1
2
3
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2022, Advanced Micro Devices, Inc. All rights reserved.

4
5
#include <cstdlib>
#include <iostream>
6

7
#include "profiler_operation_registry.hpp"
8
9
10

static void print_helper_message()
{
11
    std::cout << "arg1: tensor operation " << ProfilerOperationRegistry::GetInstance() << std::endl;
12
}
13
14
15

int main(int argc, char* argv[])
{
16
17
18
    if(argc == 1)
    {
        print_helper_message();
19
    }
20
21
    else if(const auto operation = ProfilerOperationRegistry::GetInstance().Get(argv[1]);
            operation.has_value())
Chao Liu's avatar
Chao Liu committed
22
    {
23
        return (*operation)(argc, argv);
24
    }
25
26
    else
    {
27
28
        std::cerr << "cannot find operation: " << argv[1] << std::endl;
        return EXIT_FAILURE;
29
    }
30
}