"library/vscode:/vscode.git/clone" did not exist on "7acbf104df333f80910731949789518a14f2be08"
profiler.cpp 735 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
// 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()
{
11
    std::cout << "arg1: tensor operation " << ProfilerOperationRegistry::GetInstance() << std::endl;
12
13
14
15
16
17
18
19
}

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