mkatanbaf commented on code in PR #10967: URL: https://github.com/apache/tvm/pull/10967#discussion_r861413477
########## src/runtime/minrpc/minrpc_interfaces.h: ########## @@ -0,0 +1,63 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#ifndef TVM_RUNTIME_MINRPC_MINRPC_INTERFACES_H_ +#define TVM_RUNTIME_MINRPC_MINRPC_INTERFACES_H_ + +#include <tvm/runtime/c_runtime_api.h> + +#include "rpc_reference.h" + +namespace tvm { +namespace runtime { + +/*! + * \brief Return interface used in ExecInterface to generate and sent the responses. + */ +class ReturnInterface { + public: + virtual ~ReturnInterface() {} + virtual void ReturnVoid() = 0; + virtual void ReturnHandle(void* handle) = 0; + virtual void ReturnException(const char* msg) = 0; + virtual void ReturnPackedSeq(const TVMValue* arg_values, const int* type_codes, int num_args) = 0; + virtual void ReturnCopyAck(uint64_t* num_bytes, uint8_t** data_ptr) = 0; + virtual void ReturnLastTVMError() = 0; + virtual void ThrowError(RPCServerStatus code, RPCCode info = RPCCode::kNone) = 0; +}; + +/*! + * \brief Execute interface used in MinRPCServer to process different received commands + */ +class ExecInterface { + public: + virtual ~ExecInterface() {} + virtual void ExecInitServer(int* num_args) = 0; Review Comment: done -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
