areusch commented on a change in pull request #5921: URL: https://github.com/apache/incubator-tvm/pull/5921#discussion_r451847021
########## File path: include/tvm/runtime/crt/graph_runtime.h ########## @@ -0,0 +1,110 @@ +/* + * 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. + */ + +/*! + * \file graph_runtime.h + * \brief Tiny graph runtime that can run graph containing only tvm PackedFunc. + */ +#ifndef TVM_RUNTIME_CRT_GRAPH_RUNTIME_H_ +#define TVM_RUNTIME_CRT_GRAPH_RUNTIME_H_ + +#include <dlpack/dlpack.h> +#include <tvm/runtime/c_runtime_api.h> + +struct TVMPackedFunc; +typedef struct TVMPackedFunc TVMPackedFunc; + +struct TVMModule; +typedef struct TVMModule TVMModule; + +/*! \brief operator attributes about tvm op */ +typedef struct TVMOpParam { + char func_name[120]; + uint32_t num_inputs; + uint32_t num_outputs; + uint32_t flatten_data; +} TVMOpParam; + +// Graph attribute +typedef struct TVMGraphRuntimeGraphAttr { + uint32_t storage_num_not_alloctaed; + uint32_t* storage_id; + uint32_t* device_index; + char* dltype; // "int8", "int16", "float32" + uint32_t dltype_count; + int64_t* shape; + uint32_t* ndim; + uint32_t shape_count; +} TVMGraphRuntimeGraphAttr; + +typedef DLTensor* DLTensorPtr; + +/*! + * \brief Tiny graph runtime. + * + * This runtime can be acccesibly in various language via + * TVM runtime PackedFunc API. + */ +/* class GraphRuntime : public ModuleNode { */ +typedef struct TVMGraphRuntimeAPI { Review comment: ah sorry, previous approach which I now don't use. API should be gone everywhere now ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
