-
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] RPC server/client for simulator #10361
[Hexagon] RPC server/client for simulator #10361
Conversation
This is the C++ code for running Hexagon code on simulator via the RPC mechanism. It is intended to be integrated into the current HexagonLauncher, although the integration will require further changes to the launcher python code. The final goal is to be able to run the same file.py on either hardware or simulator without needing to edit the python file, but simply by changing the configuration of the execution platform (i.e. something like --exectute-on=simulator as a command line or in an environment variable). The exact details are still to be determined.
cc: @mehrdadh |
# Build X86 binaries: | ||
# - tvm_rpc_x86 | ||
|
||
ExternalProject_Add(x86_tvm_runtime_rpc |
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 a cpp RPC server app for x86 with the Hexagon RPC code enabled.
HEX_VA_t dispatch_v_, message_buffer_v_; | ||
std::unique_ptr<HexagonWrapper> sim_; | ||
|
||
// Sim configuration routines. |
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.
All of this configuration code was taken from src/runtime/hexagon/android/sim/hexagon_device_sim.cpp
.
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.
can you move all of these configurations to a header file and reuse it?
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.
The offload code will be removed, so this will be the only place where it appears. The files in src/runtime/hexagon/android
will be deleted.
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.
@mehrdadh Since the original code will be removed, I think it's fine to merge this as is and let @kparzysz-quic continue completing his work.
rpc->dispatch_v_ = RssV & ~0u; // ~0u is uint32_t | ||
rpc->message_buffer_v_ = RssV >> 32; | ||
|
||
LOG(INFO) << "dispatch:" << reinterpret_cast<void*>(rpc->dispatch_v_) |
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.
DLOG
or VLOG
(can be done in a follow up)
This is the C++ code for running Hexagon code on simulator via the RPC mechanism. It is intended to be integrated into the current HexagonLauncher, although the integration will require further changes to the launcher python code. The final goal is to be able to run the same file.py on either hardware or simulator without needing to edit the python file, but simply by changing the configuration of the execution platform (i.e. something like --exectute-on=simulator as a command line or in an environment variable). The exact details are still to be determined.
This is the C++ code for running Hexagon code on simulator via the RPC mechanism. It is intended to be integrated into the current
HexagonLauncher
, although the integration will require further changes to the launcher python code.The final goal is to be able to run the same file.py on either hardware or simulator without needing to edit the python file, but simply by changing the configuration of the execution platform (i.e. something like
--execute-on=simulator
as a command line or in an environment variable). The exact details are still to be determined.