You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by ma...@apache.org on 2021/05/26 21:13:57 UTC

[tvm] branch main updated: [Cuda][Codegen] Check for cuda include dir in /usr/include. (#8135)

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

masahi 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 95f71f9  [Cuda][Codegen] Check for cuda include dir in /usr/include. (#8135)
95f71f9 is described below

commit 95f71f982f946c49b4acb2c8d936bbe7c7ddf25a
Author: Lunderberg <Lu...@users.noreply.github.com>
AuthorDate: Wed May 26 14:13:39 2021 -0700

    [Cuda][Codegen] Check for cuda include dir in /usr/include. (#8135)
    
    Currently, on linux platforms, only checks for cuda install directory
    in /usr/local/cuda/include.  The `nvidia-cuda-dev` package of Ubuntu
    20.04 installs at /usr/include, so it would be good to check that
    location as well.
    
    Co-authored-by: Eric Lunderberg <el...@octoml.ai>
---
 src/target/opt/build_cuda_on.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/target/opt/build_cuda_on.cc b/src/target/opt/build_cuda_on.cc
index 1a0f089..4a2917d 100644
--- a/src/target/opt/build_cuda_on.cc
+++ b/src/target/opt/build_cuda_on.cc
@@ -67,6 +67,10 @@ std::string FindCUDAIncludePath() {
   if (stat(cuda_include_path.c_str(), &st) == 0) {
     return cuda_include_path;
   }
+
+  if (stat("/usr/include/cuda.h", &st) == 0) {
+    return "/usr/include";
+  }
 #endif
   LOG(FATAL) << "Cannot find cuda include path."
              << "CUDA_PATH is not set or CUDA is not installed in the default installation path."