Commit 29f23128 authored by Artur Wojcik's avatar Artur Wojcik Committed by Michał Karzyński

[ONNXIFI] Change variable names (#1993)

parent f7adcbf4
......@@ -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
......@@ -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&)
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment