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
29f23128
Commit
29f23128
authored
Nov 08, 2018
by
Artur Wojcik
Committed by
Michał Karzyński
Nov 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ONNXIFI] Change variable names (#1993)
parent
f7adcbf4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
12 deletions
+18
-12
backend_manager.cpp
src/ngraph/frontend/onnxifi/backend_manager.cpp
+5
-3
onnxifi.cpp
src/ngraph/frontend/onnxifi/onnxifi.cpp
+3
-1
onnxifi.cpp
test/onnxifi.cpp
+10
-8
No files found.
src/ngraph/frontend/onnxifi/backend_manager.cpp
View file @
29f23128
...
...
@@ -32,7 +32,7 @@ namespace ngraph
{
// Create ONNXIFI backend for each registered nGraph backend.
// Use pointer to temporary to capture the unique handle. The handles
// must be consistent within
the single
session.
// must be consistent within
a
session.
// In spec, backends are hot-pluggable. This means two calls to
// onnxGetBackendIDs() may result in different number of backends.
// For now, we don't do the re-discovery.
...
...
@@ -68,5 +68,7 @@ namespace ngraph
});
}
}
}
}
}
// namespace onnxifi
}
// namespace ngraph
src/ngraph/frontend/onnxifi/onnxifi.cpp
View file @
29f23128
...
...
@@ -22,6 +22,8 @@
#include "backend_manager.hpp"
using
namespace
ngraph
::
onnxifi
;
extern
"C"
{
ONNXIFI_PUBLIC
ONNXIFI_CHECK_RESULT
onnxStatus
ONNXIFI_ABI
...
...
@@ -29,7 +31,7 @@ ONNXIFI_PUBLIC ONNXIFI_CHECK_RESULT onnxStatus ONNXIFI_ABI
{
try
{
ngraph
::
onnxifi
::
BackendManager
::
get_backend_ids
(
backendIDs
,
numBackends
);
BackendManager
::
get_backend_ids
(
backendIDs
,
numBackends
);
return
ONNXIFI_STATUS_SUCCESS
;
}
catch
(
const
std
::
invalid_argument
&
)
...
...
test/onnxifi.cpp
View file @
29f23128
...
...
@@ -21,12 +21,14 @@
#include "ngraph/runtime/backend_manager.hpp"
const
constexpr
std
::
size_t
g_backend_ids_count
{
10
};
// ===============================================[ onnxGetBackendIDs ] =======
constexpr
std
::
size_t
g_default_backend_ids_count
{
10
};
TEST
(
onnxifi
,
get_backend_ids
)
{
::
onnxBackendID
backendIDs
[
g_backend_ids_count
];
std
::
size_t
count
{
g_backend_ids_count
};
::
onnxBackendID
backendIDs
[
g_
default_
backend_ids_count
];
std
::
size_t
count
{
g_
default_
backend_ids_count
};
::
onnxStatus
status
{
::
onnxGetBackendIDs
(
backendIDs
,
&
count
)};
EXPECT_TRUE
(
status
==
ONNXIFI_STATUS_SUCCESS
);
EXPECT_TRUE
(
count
==
ngraph
::
runtime
::
BackendManager
::
get_registered_backends
().
size
());
...
...
@@ -42,7 +44,7 @@ TEST(onnxifi, get_backend_ids_buffer_null)
TEST
(
onnxifi
,
get_backend_ids_count_null
)
{
::
onnxBackendID
backendIDs
[
g_backend_ids_count
];
::
onnxBackendID
backendIDs
[
g_
default_
backend_ids_count
];
::
onnxStatus
status
{
::
onnxGetBackendIDs
(
backendIDs
,
nullptr
)};
EXPECT_TRUE
(
status
==
ONNXIFI_STATUS_INVALID_POINTER
);
}
...
...
@@ -55,12 +57,12 @@ TEST(onnxifi, get_backend_ids_null)
TEST
(
onnxifi
,
get_backend_ids_consistency_check
)
{
::
onnxBackendID
first_ids
[
g_backend_ids_count
];
std
::
size_t
first_count
{
g_backend_ids_count
};
::
onnxBackendID
first_ids
[
g_
default_
backend_ids_count
];
std
::
size_t
first_count
{
g_
default_
backend_ids_count
};
EXPECT_TRUE
(
::
onnxGetBackendIDs
(
first_ids
,
&
first_count
)
==
ONNXIFI_STATUS_SUCCESS
);
EXPECT_TRUE
(
first_count
==
ngraph
::
runtime
::
BackendManager
::
get_registered_backends
().
size
());
::
onnxBackendID
second_ids
[
g_backend_ids_count
];
std
::
size_t
second_count
{
g_backend_ids_count
};
::
onnxBackendID
second_ids
[
g_
default_
backend_ids_count
];
std
::
size_t
second_count
{
g_
default_
backend_ids_count
};
EXPECT_TRUE
(
::
onnxGetBackendIDs
(
second_ids
,
&
second_count
)
==
ONNXIFI_STATUS_SUCCESS
);
EXPECT_TRUE
(
second_count
==
ngraph
::
runtime
::
BackendManager
::
get_registered_backends
().
size
());
EXPECT_TRUE
(
first_count
==
second_count
);
...
...
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