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
421311ed
Commit
421311ed
authored
5 years ago
by
Robert Kimball
Committed by
Scott Cyphers
5 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more info to error messages (#2894)
parent
5b0c6a32
master
v0.29.0-rc.0
v0.28.0-rc.1
v0.28.0-rc.0
v0.27.1-rc.3
v0.27.1-rc.2
v0.27.1-rc.1
v0.27.1-rc.0
v0.27.0-rc.1
v0.27.0-rc.0
v0.26.1-rc.0
v0.26.0
v0.26.0-rc.8
v0.26.0-rc.7
v0.26.0-rc.6
v0.26.0-rc.5
v0.26.0-rc.4
v0.26.0-rc.3
v0.26.0-rc.2
v0.26.0-rc.0
v0.25.1-rc.11
v0.25.1-rc.10
v0.25.1-rc.9
v0.25.1-rc.8
v0.25.1-rc.7
v0.25.1-rc.6
v0.25.1-rc.5
v0.25.1-rc.4
v0.25.1-rc.3
v0.25.1-rc.2
v0.25.1-rc.1
v0.25.1-rc.0
v0.25.0
v0.25.0-rc.3
v0.25.0-rc.2
v0.25.0-rc.1
v0.25.0-rc.0
v0.25.0-dev.0
v0.24.0
v0.24.0-rc.3
v0.24.0-rc.2
v0.24.0-rc.1
v0.24.0-rc.0
v0.23.0-rc.7
v0.23.0-rc.6
v0.23.0-rc.5
v0.23.0-rc.4
v0.23.0-rc.3
v0.23.0-rc.2
v0.23.0-rc.1
v0.23.0-rc.0
v0.22.2-rc.0
v0.22.1
v0.22.1-rc.0
v0.22.0
v0.22.0-rc.2
v0.22.0-rc.0
v0.21.0
v0.21.0-rc.1
v0.21.0-rc.0
v0.20.1-rc.4
v0.20.1-rc.3
v0.20.1-rc.2
v0.20.1-rc.1
v0.20.1-rc.0
v0.20.0-rc.2
v0.20.0-rc.1
v0.20.0-rc.0
v0.20.0-dev.0
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
backend_manager.cpp
src/ngraph/runtime/backend_manager.cpp
+23
-2
No files found.
src/ngraph/runtime/backend_manager.cpp
View file @
421311ed
...
...
@@ -98,6 +98,9 @@ shared_ptr<runtime::Backend> runtime::BackendManager::create_backend(const std::
throw
runtime_error
(
ss
.
str
());
}
#ifndef _WIN32
dlerror
();
// Clear any pending errors
#endif
function
<
runtime
::
BackendConstructor
*
()
>
get_backend_constructor_pointer
=
reinterpret_cast
<
runtime
::
BackendConstructor
*
(
*
)()
>
(
DLSYM
(
handle
,
"get_backend_constructor_pointer"
));
...
...
@@ -107,9 +110,16 @@ shared_ptr<runtime::Backend> runtime::BackendManager::create_backend(const std::
}
else
{
string
error
;
#ifndef _WIN32
const
char
*
err
=
dlerror
();
error
=
(
err
?
err
:
""
);
#endif
CLOSE_LIBRARY
(
handle
);
throw
runtime_error
(
"Backend '"
+
type
+
"' does not implement get_backend_constructor_pointer"
);
throw
runtime_error
(
"Failed to find symbol 'get_backend_constructor_pointer' in backend "
"library.
\n
Error='"
+
error
+
"'"
);
}
}
return
backend
;
...
...
@@ -152,12 +162,23 @@ DL_HANDLE runtime::BackendManager::open_shared_library(string type)
string
library_name
=
lib_prefix
+
to_lower
(
type
)
+
"_backend"
+
lib_suffix
;
string
my_directory
=
file_util
::
get_directory
(
find_my_file
());
string
library_path
=
file_util
::
path_join
(
my_directory
,
library_name
);
string
error
;
#ifdef _WIN32
SetDllDirectory
((
LPCSTR
)
my_directory
.
c_str
());
handle
=
LoadLibrary
(
library_path
.
c_str
());
#else
dlerror
();
// Clear any pending errors
handle
=
dlopen
(
library_path
.
c_str
(),
RTLD_NOW
|
RTLD_GLOBAL
);
const
char
*
err
=
dlerror
();
error
=
(
err
?
err
:
""
);
#endif
if
(
!
handle
)
{
stringstream
ss
;
ss
<<
"Unable to find backend '"
<<
type
<<
"' as file '"
<<
library_path
<<
"'"
;
ss
<<
"
\n
Open error message '"
<<
error
<<
"'"
;
throw
runtime_error
(
ss
.
str
());
}
return
handle
;
}
...
...
This diff is collapsed.
Click to expand it.
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