Loading [MathJax]/extensions/tex2jax.js
CIRCT
21.0.0git
Toggle main menu visibility
Main Page
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
Variables
_
a
b
c
d
e
f
g
i
k
l
m
n
o
r
s
t
u
v
w
Typedefs
a
b
c
d
e
f
g
h
i
m
o
p
r
s
t
u
w
Enumerations
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
~
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
z
~
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Typedefs
a
b
c
d
e
f
g
i
k
l
m
n
o
p
r
s
t
u
v
Enumerations
Enumerator
a
b
c
d
f
i
m
n
o
p
r
s
t
u
v
w
x
z
Related Symbols
Files
File List
File Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
y
z
Variables
c
e
g
i
l
m
n
p
r
s
t
w
Typedefs
b
c
d
e
f
h
i
j
l
m
n
o
p
r
s
u
v
Enumerations
Enumerator
a
c
d
f
h
i
n
o
r
Macros
a
c
d
e
g
h
i
r
s
t
v
x
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Loading...
Searching...
No Matches
lib
Dialect
ESI
runtime
cpp
include
esi
CLI.h
Go to the documentation of this file.
1
//===- CLI.h - ESI runtime tool CLI parser common ---------------*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// This file contains the common CLI parser code for ESI runtime tools. Exposed
10
// publicly so that out-of-tree tools can use it. This is a header-only library
11
// to make compilation easier for out-of-tree tools.
12
//
13
// DO NOT EDIT!
14
// This file is distributed as part of an ESI package. The source for this file
15
// should always be modified within CIRCT (lib/dialect/ESI/runtime/cpp).
16
//
17
//===----------------------------------------------------------------------===//
18
19
// NOLINTNEXTLINE(llvm-header-guard)
20
#ifndef ESI_CLI_H
21
#define ESI_CLI_H
22
23
#include "CLI/CLI.hpp"
24
#include "
esi/Context.h
"
25
26
namespace
esi
{
27
28
/// Common options and code for ESI runtime tools.
29
class
CliParser
:
public
CLI::App {
30
public
:
31
CliParser
(
const
std::string &toolName)
32
: CLI::App(toolName),
debug
(false),
verbose
(false) {
33
add_option(
"backend"
,
backend
,
"Backend to use for connection"
)->required();
34
add_option(
"connection"
,
connStr
,
35
"Connection string to use for accelerator communication"
)
36
->required();
37
add_flag(
"--debug"
,
debug
,
"Enable debug logging"
);
38
add_flag(
"-v,--verbose"
,
verbose
,
"Enable verbose (info) logging"
);
39
require_subcommand(0, 1);
40
}
31
CliParser
(
const
std::string &toolName) {
…
}
41
42
/// Run the parser.
43
int
esiParse
(
int
argc,
const
char
**argv) {
44
CLI11_PARSE(*
this
, argc, argv);
45
if
(
debug
)
46
ctxt
= Context::withLogger<ConsoleLogger>(
Logger::Level::Debug
);
47
else
if
(
verbose
)
48
ctxt
= Context::withLogger<ConsoleLogger>(
Logger::Level::Info
);
49
return
0;
50
}
43
int
esiParse
(
int
argc,
const
char
**argv) {
…
}
51
52
/// Connect to the accelerator using the specified backend and connection.
53
std::unique_ptr<AcceleratorConnection>
connect
() {
54
return
ctxt
.
connect
(
backend
,
connStr
);
55
}
53
std::unique_ptr<AcceleratorConnection>
connect
() {
…
}
56
57
/// Get the context.
58
Context
&
getContext
() {
return
ctxt
; }
59
60
protected
:
61
Context
ctxt
;
62
63
std::string
backend
;
64
std::string
connStr
;
65
bool
debug
;
66
bool
verbose
;
67
};
29
class
CliParser
:
public
CLI::App {
…
};
68
69
}
// namespace esi
70
71
#endif
// ESI_CLI_H
Context.h
esi::CliParser
Common options and code for ESI runtime tools.
Definition
CLI.h:29
esi::CliParser::getContext
Context & getContext()
Get the context.
Definition
CLI.h:58
esi::CliParser::verbose
bool verbose
Definition
CLI.h:66
esi::CliParser::connect
std::unique_ptr< AcceleratorConnection > connect()
Connect to the accelerator using the specified backend and connection.
Definition
CLI.h:53
esi::CliParser::debug
bool debug
Definition
CLI.h:65
esi::CliParser::esiParse
int esiParse(int argc, const char **argv)
Run the parser.
Definition
CLI.h:43
esi::CliParser::backend
std::string backend
Definition
CLI.h:63
esi::CliParser::ctxt
Context ctxt
Definition
CLI.h:61
esi::CliParser::connStr
std::string connStr
Definition
CLI.h:64
esi::CliParser::CliParser
CliParser(const std::string &toolName)
Definition
CLI.h:31
esi::Context
AcceleratorConnections, Accelerators, and Manifests must all share a context.
Definition
Context.h:31
esi::Context::connect
std::unique_ptr< AcceleratorConnection > connect(std::string backend, std::string connection)
Connect to an accelerator backend.
Definition
Context.cpp:27
esi::Logger::Level::Info
@ Info
esi::Logger::Level::Debug
@ Debug
debug
Definition
debug.py:1
esi
Definition
esi.py:1
Generated on Tue Apr 22 2025 00:08:32 for CIRCT by
1.9.8