areusch commented on a change in pull request #5921: URL: https://github.com/apache/incubator-tvm/pull/5921#discussion_r451715809
########## File path: src/runtime/crt/include/tvm/runtime/crt/internal/graph_runtime/graph_runtime.h ########## @@ -0,0 +1,113 @@ +/* + * 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 src/runtime/crt/include/tvm/runtime/crt/internal/graph_runtime/graph_runtime.h + * \brief Tiny graph runtime that can run graph containing only tvm PackedFunc. + */ +#ifndef TVM_RUNTIME_CRT_INCLUDE_TVM_RUNTIME_CRT_INTERNAL_GRAPH_RUNTIME_GRAPH_RUNTIME_H_ +#define TVM_RUNTIME_CRT_INCLUDE_TVM_RUNTIME_CRT_INTERNAL_GRAPH_RUNTIME_GRAPH_RUNTIME_H_ + +#include <tvm/runtime/crt/graph_runtime.h> +#include <tvm/runtime/crt/internal/common/module.h> +#include <tvm/runtime/crt/internal/common/ndarray.h> +#include <tvm/runtime/crt/internal/graph_runtime/load_json.h> + +// Memory pool entry. +typedef struct TVMGraphRuntimePoolEntry { + size_t size; + int device_type; +} TVMGraphRuntimePoolEntry; + +// Node entry +typedef struct TVMGraphRuntimeNodeEntry { + uint32_t node_id; + uint32_t index; + uint32_t version; + // JSON Loader + void (*Load)(JSONReader* reader); +} TVMGraphRuntimeNodeEntry; + +// Node +typedef struct TVMGraphRuntimeNode { + // operator type in string + char op_type[16]; + // name of the op + char name[120]; Review comment: i'm not going to touch these right now, they're orthogonal to this change. a follow-on PR can look at the graph runtime impl more thoroughly ---------------------------------------------------------------- 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]
