tqchen commented on a change in pull request #7785:
URL: https://github.com/apache/tvm/pull/7785#discussion_r621396937
##########
File path: include/tvm/tir/builtin.h
##########
@@ -386,6 +396,21 @@ TVM_DLL const Op& tvm_thread_context();
*/
TVM_DLL const Op& tvm_call_packed_lowered();
+/*!
+ * \brief Lowered version of call c-packed, the space of value and
+ * type codes are explicitly allocated.
+ *
+ * int tvm_call_packed_lowered(fname,
Review comment:
call cpacked
##########
File path: include/tvm/tir/builtin.h
##########
@@ -343,6 +343,16 @@ TVM_DLL const Op& tvm_stack_make_array();
*/
TVM_DLL const Op& tvm_call_packed();
+/*!
+ * \brief See pesudo code
+ *
+ * int tvm_call_packed(fname, TVMValue* args) {
+ * (*fname)(args, type_code_of(args), len(args));
+ * return 0;
+ * }
+ */
+TVM_DLL const Op& tvm_call_cpacked();
Review comment:
in particular, we might also want to support POD return types
##########
File path: src/relay/backend/aot_executor_codegen.cc
##########
@@ -0,0 +1,674 @@
+/*
+ * 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 relay/backend/graph_codegen.cc
+ * \brief Graph runtime codegen
+ */
+
+#include <dmlc/any.h>
+#include <tvm/ir/module.h>
+#include <tvm/relay/expr_functor.h>
+#include <tvm/runtime/device_api.h>
+#include <tvm/tir/builtin.h>
+#include <tvm/tir/expr.h>
+#include <tvm/tir/stmt.h>
+
+#include <algorithm>
+#include <list>
+#include <string>
+#include <vector>
+
+#include "compile_engine.h"
+#include "utils.h"
+
+namespace tvm {
+namespace relay {
+namespace backend {
+
+using IntegerArray = Array<Integer>;
+using ShapeVector = std::vector<std::vector<int64_t>>;
+using GraphAttrs = std::unordered_map<std::string, dmlc::any>;
Review comment:
seems the particular type is not being used here
##########
File path: include/tvm/tir/builtin.h
##########
@@ -343,6 +343,16 @@ TVM_DLL const Op& tvm_stack_make_array();
*/
TVM_DLL const Op& tvm_call_packed();
+/*!
+ * \brief See pesudo code
+ *
+ * int tvm_call_packed(fname, TVMValue* args) {
+ * (*fname)(args, type_code_of(args), len(args));
+ * return 0;
+ * }
+ */
+TVM_DLL const Op& tvm_call_cpacked();
Review comment:
https://github.com/apache/tvm/pull/7932 contains some updated
clarifications that we might want to incorporate here
##########
File path: src/relay/backend/aot_executor_codegen.cc
##########
@@ -0,0 +1,674 @@
+/*
+ * 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 relay/backend/graph_codegen.cc
+ * \brief Graph runtime codegen
+ */
+
+#include <dmlc/any.h>
+#include <tvm/ir/module.h>
+#include <tvm/relay/expr_functor.h>
+#include <tvm/runtime/device_api.h>
+#include <tvm/tir/builtin.h>
+#include <tvm/tir/expr.h>
+#include <tvm/tir/stmt.h>
+
+#include <algorithm>
+#include <list>
+#include <string>
+#include <vector>
+
+#include "compile_engine.h"
+#include "utils.h"
+
+namespace tvm {
+namespace relay {
+namespace backend {
+
+using IntegerArray = Array<Integer>;
+using ShapeVector = std::vector<std::vector<int64_t>>;
+using GraphAttrs = std::unordered_map<std::string, dmlc::any>;
Review comment:
would be great if we can avoid use of any
--
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]