You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by tk...@apache.org on 2022/11/03 16:32:12 UTC

[tvm] branch main updated: [build][doc] Fix clang doxygen warnings (#13270)

This is an automated email from the ASF dual-hosted git repository.

tkonolige pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new 9df3a33ff4 [build][doc] Fix clang doxygen warnings (#13270)
9df3a33ff4 is described below

commit 9df3a33ff454024b116467537096271b23947fda
Author: Christian Convey <cc...@octoml.ai>
AuthorDate: Thu Nov 3 12:32:04 2022 -0400

    [build][doc] Fix clang doxygen warnings (#13270)
    
    Fix occurrences of clang's `-Wdocumentation-unknown-command` warning.
---
 src/relay/backend/annotate_used_memory.cc |  4 ++++
 src/relay/collage/mock_cost_estimator.h   | 10 ++++++++++
 2 files changed, 14 insertions(+)

diff --git a/src/relay/backend/annotate_used_memory.cc b/src/relay/backend/annotate_used_memory.cc
index 4dcdb2e541..001d7635e7 100644
--- a/src/relay/backend/annotate_used_memory.cc
+++ b/src/relay/backend/annotate_used_memory.cc
@@ -52,6 +52,7 @@ namespace backend {
  * A simple example:
  *
  * Before:
+ * \verbatim
  * def @main(%input: Tensor[(1, 2, 2, 4), int8]) -> Tensor[(1, 2, 2, 4), int8] {
  *   let %x_0 = fn (%x: Tensor[(1, 2, 2, 4), int8], Primitive=1) -> Tensor[(1, 2, 2, 4), int8] {
  *     nn.max_pool2d(%x, pool_size=[1, 1], padding=[0, 0, 0, 0])
@@ -59,8 +60,10 @@ namespace backend {
  *   let %x_1 = %x_0(%input);
  *   %x_1
  * }
+ * \endverbatim
  *
  * After:
+ * \verbatim
  * def @main(%input: Tensor[(1, 2, 2, 4), int8], io_used_memory=32) -> Tensor[(1, 2, 2, 4), int8] {
  *   let %x_0: fn (%x: Tensor[(1, 2, 2, 4), int8], Primitive=1, used_memory=[32]) -> Tensor[(1, 2,
  * 2, 4), int8] {
@@ -69,6 +72,7 @@ namespace backend {
  *   let %x_1: Tensor[(1, 2, 2, 4), int8] = %x_0(%input);
  *   %x_1
  * }
+ * \endverbatim
  *
  * Note that in the simple example above io_used_memory and used_memory are the same since there
  * is only one primitive function.
diff --git a/src/relay/collage/mock_cost_estimator.h b/src/relay/collage/mock_cost_estimator.h
index f47cb71fb6..3aa97923a2 100644
--- a/src/relay/collage/mock_cost_estimator.h
+++ b/src/relay/collage/mock_cost_estimator.h
@@ -34,6 +34,13 @@ namespace tvm {
 namespace relay {
 namespace collage {
 
+// Clang (15.0.3, at least) validly complains about `@main`, but it invalidly
+// complains even about `\c @main`.
+#if __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdocumentation-unknown-command"
+#endif
+
 /*!
  * \brief A mock cost estimator which can determine the cost of a candidate based on both
  * the candidate's target and the number of operator calls inside it.
@@ -69,6 +76,9 @@ class MockCostEstimatorNode : public CostEstimatorNode {
 
   friend class MockCostEstimator;
 };
+#if __clang__
+#pragma clang diagnostic pop
+#endif
 
 class MockCostEstimator : public CostEstimator {
  public: