Skip to content

Commit 0f5608b

Browse files
committed
address comments
1 parent 3be1121 commit 0f5608b

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

lib/Onnxifi/Base.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
namespace glow {
2424
namespace onnxifi {
2525
namespace {
26-
const std::string inferenceFunctionName = "inference";
27-
const std::string compatibilityFunctionName = "check";
26+
const char *inferenceFunctionName = "inference";
27+
const char *compatibilityFunctionName = "check";
2828
} // namespace
2929

3030
onnxStatus BackendId::checkGraphCompatibility(const void *onnxModel,
@@ -156,7 +156,7 @@ void Graph::run(
156156
phs.push_back(var);
157157
}
158158

159-
auto ctx = std::make_unique<Context>();
159+
auto ctx = llvm::make_unique<Context>();
160160

161161
// Run inference.
162162
auto &EE = backendPtr_->getEE();

lib/Onnxifi/Base.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ namespace onnxifi {
3434

3535
// TODO get rid of this once HostManager is landed.
3636
struct HostManager {
37-
bool addNetwork(Module *M) { return true; }
37+
bool addNetwork(Module *M) {
38+
llvm_unreachable("HostManager is not yet implemented.");
39+
}
3840
};
3941

4042
// TODO use the actual type here once available.
@@ -45,8 +47,11 @@ using ResultCBTy =
4547
class BackendId {
4648
public:
4749
/// Create Glow ONNXIFI backend identifier with the
48-
/// given Glow backend \p kind, \p id, \p concurrency and whether to use onnx
49-
/// or caffe2 for models (\p use_onnx).
50+
/// given Glow backend \p kind, \p id, \p concurrency, whether to use onnx
51+
/// or caffe2 for models (\p useInnx), and whether to use HostManager instead
52+
/// of ExecutionEngine for running graphs (useHostManager).
53+
/// NOTE: useHostManager is not yet supported as HostManager is yet to be
54+
/// fully implemented.
5055
explicit BackendId(glow::BackendKind kind, int id, int concurrency,
5156
bool useOnnx, bool useHostManager)
5257
: id_(id), useOnnx_(useOnnx), concurrency_(concurrency),

lib/Onnxifi/onnxifiGlow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ GLOW_ONNXIFI_LIBRARY_FUNCTION_WRAPPER(onnxGetBackendIDs)(
104104
/*id*/ 2, /*concurrency*/ 1, /*useOnnx*/ false, /*useHostManager*/ false);
105105
auto *interpreterBackendC2HostManager = new glow::onnxifi::BackendId(
106106
glow::BackendKind::Interpreter,
107-
/*id*/ 2, /*concurrency*/ 1, /*useOnnx*/ false, /*useOnnx*/ false,
107+
/*id*/ 2, /*concurrency*/ 1, /*useOnnx*/ false,
108108
/*useHostManager*/ true);
109109

110110
manager.addBackendId(interpreterBackendOnnx);

0 commit comments

Comments
 (0)