You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2020/07/21 03:55:20 UTC

[GitHub] [incubator-tvm] merrymercy commented on a change in pull request #6103: [Ansor][AutoTVM v2.0] Phase 1: Access Analyzer

merrymercy commented on a change in pull request #6103:
URL: https://github.com/apache/incubator-tvm/pull/6103#discussion_r457820848



##########
File path: src/auto_scheduler/compute_dag.h
##########
@@ -37,13 +37,126 @@
 
 #include <tvm/te/schedule.h>
 
+#include <unordered_map>
+#include <unordered_set>
 #include <utility>
+#include <vector>
 
 #include "loop_state.h"
 
 namespace tvm {
 namespace auto_scheduler {
 
+/*! \brief Static analysis result for a ComputeDAG */
+class AccessAnalyzerNode : public Object {
+ public:
+  template <class T>
+  using OperationMap = std::unordered_map<te::Operation, T, ObjectHash, ObjectEqual>;
+
+  /*! \brief Map an operation to all operations it reads from.
+   * For each operation pair, use a two-dimentional array to multiple multi-dimentional accesses*/
+  OperationMap<OperationMap<std::vector<std::vector<PrimExpr>>>> read_from;

Review comment:
       These fields will only be accessed by c++ code, so it is okay to use std::unordered_map and std::vector.
   No body should write a search policy in python.




----------------------------------------------------------------
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:
users@infra.apache.org