-
Notifications
You must be signed in to change notification settings - Fork 63
sindhu/register backends #392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
cafa3a4
8158725
7299be4
d9922af
89fd3c7
34c8026
f046ea4
faa1343
358e154
63da9ff
1f0c075
7704247
b267ba1
531c490
da1adab
6706cbf
367d3db
fdb3753
f0ae2f9
efcc707
ce20965
6adc41c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -164,6 +164,13 @@ int main(int argc, char** argv) { | |
| return -1; | ||
| } | ||
|
|
||
| // Register cpu backend for static linking | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need to register here, since we have a registration in create backend?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah it was failing otherwise because we are using set backend here
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TODO: Revisit this to see if we can remove registering here and register only in BackendManager.
sindhu-nervana marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| // [TODO]: Revisit this to see if we can remove registering here and register | ||
| // only in BackendManager. | ||
| #if defined(NGRAPH_BRIDGE_STATIC_LIB_ENABLE) | ||
| ngraph_register_cpu_backend(); | ||
| #endif | ||
|
|
||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right now we create only CPU backend here, hence the ifdef is only for CPU. But suggestions for future is we can query the backend we are trying to set/create and register just that backend if NGRAPH_BRIDGE_STATIC_LIB_ENABLE is enabled |
||
| const char* backend = "CPU"; | ||
| if (SetNGraphBackend(backend) != tf::Status::OK()) { | ||
| std::cout << "Error: Cannot set the backend: " << backend << std::endl; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -160,6 +160,11 @@ int main(int argc, char** argv) { | |
| return -1; | ||
| } | ||
|
|
||
| // Register cpu backend for static linking | ||
| #if defined(NGRAPH_BRIDGE_STATIC_LIB_ENABLE) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment |
||
| ngraph_register_cpu_backend(); | ||
| #endif | ||
|
|
||
| const char* backend = "CPU"; | ||
| if (SetNGraphBackend(backend) != tf::Status::OK()) { | ||
| std::cout << "Error: Cannot set the backend: " << backend << std::endl; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,8 +62,7 @@ TEST(OpByOpCapability, Backend) { | |
| ASSERT_OK(BackendManager::GetCurrentlySetBackendName(&ng_backend_type)); | ||
|
|
||
| // Map with all the backends, and what the boolean is_supported should be | ||
| std::map<std::string, bool> backend_map{ | ||
| {"CPU", true}, {"INTERPRETER", true}, {"NOP", false}}; | ||
| std::map<std::string, bool> backend_map{{"CPU", true}, {"INTERPRETER", true}}; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed NOP case here because we do not have static library available for this backend, so we cannot register NOP with static builds - so this test will fail. |
||
|
|
||
| // Tests three cases of (Backend, is_supported=true/false) | ||
| // 1. CPU, true | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.