Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
N
ngraph
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ngraph
Commits
a2d97200
Commit
a2d97200
authored
Jan 11, 2018
by
Christian Convey
Committed by
Christian Convey
Jan 11, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better error message from runtime::Manager.
parent
4345e39d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
1 deletion
+35
-1
manager.cpp
src/ngraph/runtime/manager.cpp
+10
-1
CMakeLists.txt
test/CMakeLists.txt
+1
-0
runtime_manager.cpp
test/runtime_manager.cpp
+24
-0
No files found.
src/ngraph/runtime/manager.cpp
View file @
a2d97200
...
...
@@ -91,7 +91,16 @@ Manager::FactoryMap& Manager::get_factory_map()
std
::
shared_ptr
<
Manager
>
Manager
::
get
(
const
std
::
string
&
name
)
{
Manager
::
load_plugins
(
RUNTIME_PLUGIN_LIBS
);
return
get_factory_map
().
at
(
name
)(
name
);
auto
iter
=
get_factory_map
().
find
(
name
);
if
(
iter
==
get_factory_map
().
end
())
{
throw
ngraph_error
(
"No nGraph runtime with name '"
+
name
+
"' has been registered."
);
}
Factory
&
f
=
iter
->
second
;
return
f
(
name
);
}
Manager
::
Factory
Manager
::
register_factory
(
const
std
::
string
&
name
,
Factory
factory
)
...
...
test/CMakeLists.txt
View file @
a2d97200
...
...
@@ -36,6 +36,7 @@ set (SRC
pass_liveness.cpp
pass_manager.cpp
pass_memory_layout.cpp
runtime_manager.cpp
serialize.cpp
pattern.cpp
shape.cpp
...
...
test/runtime_manager.cpp
0 → 100644
View file @
a2d97200
// ----------------------------------------------------------------------------
// Copyright 2018 Nervana Systems Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// ----------------------------------------------------------------------------
#include "gtest/gtest.h"
#include "ngraph/ngraph.hpp"
using
namespace
std
;
TEST
(
runtime_manager
,
invalidName
)
{
ASSERT_THROW
(
ngraph
::
runtime
::
Manager
::
get
(
"COMPLETELY-BOGUS-MANAGER-NAME"
),
ngraph
::
ngraph_error
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment