areusch commented on a change in pull request #5921: URL: https://github.com/apache/incubator-tvm/pull/5921#discussion_r451715977
########## File path: src/runtime/crt/include/tvm/runtime/crt/internal/common/packed_func.h ########## @@ -0,0 +1,64 @@ +/* + * 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 tvm/runtime/crt/include/tvm/runtime/crt/internal/common/packed_func.h + * \brief Type-erased function used across TVM API. + */ +#ifndef TVM_RUNTIME_CRT_INCLUDE_TVM_RUNTIME_CRT_INTERNAL_COMMON_PACKED_FUNC_H_ +#define TVM_RUNTIME_CRT_INCLUDE_TVM_RUNTIME_CRT_INTERNAL_COMMON_PACKED_FUNC_H_ + +#include <assert.h> +#include <stdio.h> +#include <stdlib.h> +#include <tvm/runtime/c_runtime_api.h> + +#include "crt_config.h" +#include "module.h" + +DLDataType String2DLDataType(const char* s); + +typedef struct TVMArgs { + TVMValue values[TVM_CRT_MAX_ARGS]; + int tcodes[TVM_CRT_MAX_ARGS]; /* Data type should be identical to type_codes in TVMPackedCFunc */ + uint32_t values_count; +} TVMArgs; + +TVMArgs TVMArgs_Create(TVMValue* values, uint32_t* tcodes, uint32_t values_count); + +typedef struct TVMPackedFunc { + char name[200]; Review comment: similar thing--can't touch this in this PR as it's pretty big right 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]
