Skip to content
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

"switch (dt)" does not include case "PLAIDML_DATA_BFLOAT16" in plaidml_translate.cpp #447

Open
dbonner opened this issue Jan 18, 2020 · 1 comment

Comments

@dbonner
Copy link

dbonner commented Jan 18, 2020

ngraph-bridge fails to build with the plaidml backend, giving an error when compiling:
ngraph-bridge/build_cmake/ngraph/src/ngraph/runtime/plaidml/plaidml_translate.cpp

ngraph-bridge/build_cmake/ngraph/src/ngraph/runtime/plaidml/plaidml_translate.cpp:105:13: warning: 
      enumeration value 'PLAIDML_DATA_BFLOAT16' not handled in switch [-Wswitch]
    switch (dt)
            ^
ngraph-bridge/build_cmake/ngraph/src/ngraph/runtime/plaidml/plaidml_translate.cpp:105:13: note: 
      add missing switch cases
    switch (dt)
            ^
ngraph-bridge/build_cmake/ngraph/src/ngraph/runtime/plaidml/plaidml_translate.cpp:124:1: error: 
      control may reach end of non-void function [-Werror,-Wreturn-type]

I edited ngraph/runtime/plaidml/plaidml_translate.cpp and added under switch (dt):
case PLAIDML_DATA_BFLOAT16: return "as_bfloat16(" + tensor_name + ", 16)";

It then built successfully.

@dbonner
Copy link
Author

dbonner commented Jan 25, 2020

I have made a pull request at the ngraph repo:
compare code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant