@@ -45,13 +45,19 @@ namespace hexagon {
4545
4646class HexagonTransportChannel : public RPCChannel {
4747 public:
48- explicit HexagonTransportChannel (const std::string& uri, int remote_stack_size_bytes) {
48+ explicit HexagonTransportChannel (const std::string& uri, int remote_stack_size_bytes,
49+ uint32_t receive_buf_size_bytes) {
4950 if (_handle != AEE_EUNKNOWN) return ;
5051
5152 enable_unsigned_pd (true );
5253 set_remote_stack_size (remote_stack_size_bytes);
54+
5355 AEEResult rc = hexagon_rpc_open (uri.c_str (), &_handle);
5456 ICHECK (rc == AEE_SUCCESS) << " hexagon_rpc_open failed. URI: " << uri.c_str ();
57+
58+ rc = hexagon_rpc_init (_handle, receive_buf_size_bytes);
59+ ICHECK (rc == AEE_SUCCESS) << " hexagon_rpc_set_receive_buf_size failed. receive_buf_size_bytes: "
60+ << receive_buf_size_bytes;
5561 }
5662
5763 size_t Send (const void * data, size_t size) override {
@@ -105,10 +111,15 @@ class HexagonTransportChannel : public RPCChannel {
105111
106112TVM_REGISTER_GLOBAL (" tvm.contrib.hexagon.create_hexagon_session" )
107113 .set_body([](TVMArgs args, TVMRetValue* rv) {
114+ ICHECK (args.size () >= 4 ) << args.size () << " is less than 4" ;
115+
108116 std::string session_name = args[0 ];
109117 int remote_stack_size_bytes = args[1 ];
118+ // For simulator, the third parameter is sim_args, ignore it.
119+ int hexagon_rpc_receive_buf_size_bytes = args[3 ];
110120 HexagonTransportChannel* hexagon_channel =
111- new HexagonTransportChannel (hexagon_rpc_URI CDSP_DOMAIN, remote_stack_size_bytes);
121+ new HexagonTransportChannel (hexagon_rpc_URI CDSP_DOMAIN, remote_stack_size_bytes,
122+ static_cast <uint32_t >(hexagon_rpc_receive_buf_size_bytes));
112123 std::unique_ptr<RPCChannel> channel (hexagon_channel);
113124 auto ep = RPCEndpoint::Create (std::move (channel), session_name, " " , NULL );
114125 auto sess = CreateClientSession (ep);
0 commit comments