-
Notifications
You must be signed in to change notification settings - Fork 74k
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
Remove C++ content from tensorflow/c/c_api_macros.h #52313
Conversation
@mihaimaruseac At the moment upgrade of tensorflow-io's dependency to TF 2.7.0rc0 is not working due to the C++ inclusion. For that it might make sense to include this PR to 2.7 if there is still enough time. |
@yongtang The C++ part is wrapped with cc: @jbaiocchi |
Thanks @mihaimaruseac @penpornk. The issue is because of the following:
So the issue is not really about C++ itself, but the include of Below are the included headers within "status.h":
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yongtang Thank you for the explanation! I agree with refactoring them out. However, I don't think platform/status.h
is the right place.
Would you mind creating a new file //tensorflow/c/c_api_macros_internal.h
? (This will also require updating the dependencies to c_api_macros.h
for //tensorflow/c/experimental/stream_executor
and //tensorflow/c/experimental/pluggable_profiler
.) -- Or I can also do it. Let me know.
This PR tries to remove C++ conent from tensorflow/c/c_api_macros.h so that it is possible to include this file from an external plugin without depending on tensorflow's C++ headers (tensorflow/core/platform/status.h). The reason for this move is that for external plugins (e.g., file systems plugins) that utilize C API, it cannot include status.h as otherwise the whole tensorflow's C++ library will be a dependency. This defeat the purpose of C APi modular plugin. This PR place C++ content to tensorflow/core/platform/status.h instead so that everything will still be combined both for C external plugins and C++ plugins. (Note the C++ inclusion was added in PR 51647.) Signed-off-by: Yong Tang <yong.tang.github@outlook.com> Update to create c_api_macros_internal.h based on review feedback Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
5bb3c7b
to
3cd9b31
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much!
@mihaimaruseac @penpornk wondering if there is any update on this PR? It would be great if this PR can be part of the 2.7 release as external plugin will be impacted. |
This PR tries to remove C++ conent from tensorflow/c/c_api_macros.h
so that it is possible to include this file from an external plugin
without depending on tensorflow's C++ headers (tensorflow/core/platform/status.h).
The reason for this move is that for external plugins (e.g., file systems plugins)
that utilize C API, it cannot include status.h as otherwise the whole tensorflow's
C++ library will be a dependency. This defeat the purpose of C APi modular plugin.
This PR place C++ content to tensorflow/core/platform/status.h instead so that
everything will still be combined both for C external plugins and C++ plugins.
(Note the C++ inclusion was added in PR #51647.)
Signed-off-by: Yong Tang yong.tang.github@outlook.com