tkonolige commented on code in PR #12839:
URL: https://github.com/apache/tvm/pull/12839#discussion_r974692999


##########
CMakeLists.txt:
##########
@@ -460,6 +461,42 @@ if(USE_PIPELINE_EXECUTOR)
   list(APPEND RUNTIME_SRCS ${RUNTIME_PIPELINE_SRCS})
 endif(USE_PIPELINE_EXECUTOR)
 
+#Caches the build.
+#Note that ccache-3.x doesn't support nvcc well, so CUDA kernels may never hit 
the cache and still
+#need to be re-compiled every time. Using ccache 4.0+ can resolve this issue.
+
+if(USE_CCACHE) # True for AUTO, ON, /path/to/ccache
+  if(DEFINED CXX_COMPILER_LAUNCHER OR DEFINED C_COMPILER_LAUNCHER)
+    message(STATUS "CXX_COMPILER_LAUNCHER or C_COMPILER_LAUNCHER already 
defined, not using ccache")
+  else()
+    if("${USE_CCACHE}" STREQUAL "AUTO") # Auto mode
+      find_program(CCACHE_FOUND ccache)
+      if(CCACHE_FOUND)
+        message(STATUS "Found the path to ccache, enabling ccache")
+        set(PATH_TO_CCACHE ccache)
+      else()
+        message(STATUS "Didn't find the path to CCACHE, disabling ccache")
+      endif(CCACHE_FOUND)
+    elseif("${USE_CCACHE}" MATCHES ${IS_TRUE_PATTERN})

Review Comment:
   I think the logic is clearer this way.



-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@tvm.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to