-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Hexagon] Tighten requirements on inclusion of runtime sources #11635
[Hexagon] Tighten requirements on inclusion of runtime sources #11635
Conversation
are included in the runtime build. Specifically only include them when building for hexagon rpc on hardware and do not include them for x86 (host, simulator) or android builds.
Co-authored-by: Adam Straw <astraw@octoml.ai> Co-authored-by: Karl Koscher <kkoscher@octoml.ai>
cmake/modules/Hexagon.cmake
Outdated
@@ -116,7 +116,7 @@ function(add_hexagon_wrapper_paths) | |||
link_directories("${HEXAGON_TOOLCHAIN}/lib/iss") | |||
endfunction() | |||
|
|||
if(BUILD_FOR_HEXAGON OR USE_HEXAGON_RPC) | |||
if(BUILD_FOR_HEXAGON OR ("${USE_HEXAGON_RPC}" STREQUAL "HEXAGON")) |
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.
When would BUILD_FOR_HEXAGON
be false, but USE_HEXAGON_RPC
be "HEXAGON"
? It seems like the latter implies the former...
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.
BUILD_FOR_HEXAGON is false for the runtime android and x86 build targeted by the hexagon_api, and USE_HEXAGON_RPC is true for these cases. Thus I want to tighten the requirement so that hexagon sources are not brought in to the tvm_runtime builds (initiated by the hexagon_api cmake) when we aren't building for hexagon.
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.
What I mean is that it seems that (${USE_HEXAGON_RPC} == "HEXAGON") => BUILD_FOR_HEXAGON
. Unless I'm missing something, you can just remove USE_HEXAGON_RPC
from x86/android builds (and also from this check).
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.
I tested with if(BUILD_FOR_HEXAGON)
and it appears to work at least for PR #11653 which depends on this PR to pass CI.
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.
We may be able to "remove USE_HEXAGON_RPC
from x86/android builds" in hexagon_api/CMakeLists.txt
as @kparzysz-quic suggests but I am getting some strange results when doing so. I reverted the changes to that file in this PR.
Changing to if(BUILD_FOR_HEXAGON)
and removing the API check works and accomplishes the original intent of the PR.
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.
LGTM; thanks @csullivan
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.
Let's unblock dependent PRs. We can refine this later if necessary.
Only include Hexagon runtime sources when building for hexagon rpc on hardware and do not include them
for x86 (host, simulator) or android builds.
Duplicate of #11595.
cc @mehrdadh