sys-sage
Loading...
Searching...
No Matches
mt4g.hpp
1#ifndef MT4G_PARSER
2#define MT4G_PARSER
3
4#include "sys-sage.hpp"
5#include <string>
6
7namespace sys_sage {
8
9 /*
10 * @brief Construct a complete GPU topology by parsing an mt4g output file.
11 * The topology will be represented by a newly created Chip component.
12 *
13 * @param parent The parent of the newly created Chip component.
14 * @param path The path to the mt4g output file.
15 * @param gpuId - The ID used for the Chip component.
16 *
17 * @return 0 on success, 1 on failure.
18 */
19 int ParseMt4g(Component *parent, const std::string &path, int gpuId);
20
21 /*
22 * @brief Construct a complete GPU topology by parsing an mt4g output file.
23 * The topology will be represented by a given Chip component.
24 *
25 * @param gpu The Chip component used to represent the topology.
26 * @param path The path to the mt4g output file.
27 *
28 * @return 0 on success, 1 on failure.
29 */
30 int ParseMt4g(Chip *gpu, const std::string &path);
31
32 /*
33 * @brief Construct a complete GPU topology by parsing an mt4g output file.
34 * The topology will be represented by a newly created Chip component.
35 * Equivalent to `ParseMt4g`.
36 *
37 * @param parent The parent of the newly created Chip component.
38 * @param path The path to the mt4g output file.
39 * @param gpuId - The ID used for the Chip component.
40 *
41 * @return 0 on success, 1 on failure.
42 */
43 int ParseMt4g_v1_x(Component *parent, const std::string &path, int gpuId);
44
45 /*
46 * @brief Construct a complete GPU topology by parsing an mt4g output file.
47 * The topology will be represented by a given Chip component.
48 * Equivalent to `ParseMt4g`.
49 *
50 * @param gpu The Chip component used to represent the topology.
51 * @param path The path to the mt4g output file.
52 *
53 * @return 0 on success, 1 on failure.
54 */
55 int ParseMt4g_v1_x(Chip *gpu, const std::string &path);
56
57 /*
58 * @brief Construct a complete GPU topology by parsing an mt4g output file.
59 * The topology will be represented by a newly created Chip component.
60 * This parser is made for version v0.1 of mt4g and is not compatible
61 * with version v1.x and above.
62 *
63 * @param parent The parent of the newly created Chip component.
64 * @param path The path to the mt4g output file.
65 * @param gpuId - The ID used for the Chip component.
66 * @param delim (default ";") The delimiter used in the CSV file.
67 *
68 * @return 0 on success, 1 on failure.
69 */
70 int ParseMt4g_v0_1(Component* parent, const std::string &path, int gpuId, const std::string delim = ";");
71
72 /*
73 * @brief Construct a complete GPU topology by parsing an mt4g output file.
74 * The topology will be represented by a given Chip component.
75 * This parser is made for version v0.1 of mt4g and is not compatible
76 * with version v1.x and above.
77 *
78 * @param gpu The Chip component used to represent the topology.
79 * @param path The path to the mt4g output file.
80 * @param delim (default ";") The delimiter used in the CSV file.
81 *
82 * @return 0 on success, 1 on failure.
83 */
84 int ParseMt4g_v0_1(Chip* gpu, const std::string &path, const std::string delim = ";");
85
86}
87
88#endif