tvm
microtvm_rpc_server.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */
19 
25 #ifndef TVM_RUNTIME_CRT_MICROTVM_RPC_SERVER_H_
26 #define TVM_RUNTIME_CRT_MICROTVM_RPC_SERVER_H_
27 
28 #include <stdlib.h>
29 #include <sys/types.h>
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
43 typedef ssize_t (*microtvm_rpc_channel_write_t)(void* context, const uint8_t* data,
44  size_t num_bytes);
45 
47 typedef void* microtvm_rpc_server_t;
48 
60 microtvm_rpc_server_t MicroTVMRpcServerInit(microtvm_rpc_channel_write_t write_func,
61  void* write_func_ctx);
62 
72 tvm_crt_error_t MicroTVMRpcServerLoop(microtvm_rpc_server_t server, uint8_t** new_data,
73  size_t* new_data_size_bytes);
74 
75 #ifdef __cplusplus
76 }
77 #endif
78 
79 #endif // TVM_RUNTIME_CRT_MICROTVM_RPC_SERVER_H_
microtvm_rpc_server_t MicroTVMRpcServerInit(microtvm_rpc_channel_write_t write_func, void *write_func_ctx)
Initialize the TVM RPC Server.
ssize_t(* microtvm_rpc_channel_write_t)(void *context, const uint8_t *data, size_t num_bytes)
TVM RPC channel write function.
Definition: microtvm_rpc_server.h:43
Defines integral error codes returned by the CRT.
tvm_crt_error_t
Definition: error_codes.h:50
tvm_crt_error_t MicroTVMRpcServerLoop(microtvm_rpc_server_t server, uint8_t **new_data, size_t *new_data_size_bytes)
Do any tasks suitable for the main thread, and maybe process new incoming data.
void * microtvm_rpc_server_t
Opaque pointer type to TVM RPC Server.
Definition: microtvm_rpc_server.h:47