[RUNTIME] Separate runtime related contrib into runtime/contrib (#4207)
authorTianqi Chen <tqchen@users.noreply.github.com>
Sun, 27 Oct 2019 20:41:20 +0000 (16:41 -0400)
committerGitHub <noreply@github.com>
Sun, 27 Oct 2019 20:41:20 +0000 (16:41 -0400)
31 files changed:
cmake/modules/CUDA.cmake
cmake/modules/Metal.cmake
cmake/modules/ROCM.cmake
cmake/modules/contrib/BLAS.cmake
cmake/modules/contrib/NNPack.cmake
cmake/modules/contrib/Random.cmake
cmake/modules/contrib/Sort.cmake
src/runtime/contrib/cblas/cblas.cc [moved from src/contrib/cblas/cblas.cc with 99% similarity]
src/runtime/contrib/cblas/gemm_common.h [moved from src/contrib/cblas/gemm_common.h with 99% similarity]
src/runtime/contrib/cublas/cublas.cc [moved from src/contrib/cublas/cublas.cc with 99% similarity]
src/runtime/contrib/cublas/cublas_utils.cc [moved from src/contrib/cublas/cublas_utils.cc with 94% similarity]
src/runtime/contrib/cublas/cublas_utils.h [moved from src/contrib/cublas/cublas_utils.h with 93% similarity]
src/runtime/contrib/cudnn/conv_forward.cc [moved from src/contrib/cudnn/conv_forward.cc with 99% similarity]
src/runtime/contrib/cudnn/cudnn_utils.cc [moved from src/contrib/cudnn/cudnn_utils.cc with 98% similarity]
src/runtime/contrib/cudnn/cudnn_utils.h [moved from src/contrib/cudnn/cudnn_utils.h with 92% similarity]
src/runtime/contrib/miopen/conv_forward.cc [moved from src/contrib/miopen/conv_forward.cc with 99% similarity]
src/runtime/contrib/miopen/miopen_utils.cc [moved from src/contrib/miopen/miopen_utils.cc with 98% similarity]
src/runtime/contrib/miopen/miopen_utils.h [moved from src/contrib/miopen/miopen_utils.h with 91% similarity]
src/runtime/contrib/mps/conv.mm [moved from src/contrib/mps/conv.mm with 100% similarity]
src/runtime/contrib/mps/gemm.mm [moved from src/contrib/mps/gemm.mm with 100% similarity]
src/runtime/contrib/mps/mps_utils.h [moved from src/contrib/mps/mps_utils.h with 89% similarity]
src/runtime/contrib/mps/mps_utils.mm [moved from src/contrib/mps/mps_utils.mm with 100% similarity]
src/runtime/contrib/nnpack/convolution.cc [moved from src/contrib/nnpack/convolution.cc with 100% similarity]
src/runtime/contrib/nnpack/fully_connected.cc [moved from src/contrib/nnpack/fully_connected.cc with 100% similarity]
src/runtime/contrib/nnpack/nnpack_utils.cc [moved from src/contrib/nnpack/nnpack_utils.cc with 100% similarity]
src/runtime/contrib/nnpack/nnpack_utils.h [moved from src/contrib/nnpack/nnpack_utils.h with 88% similarity]
src/runtime/contrib/random/mt_random_engine.cc [moved from src/contrib/random/mt_random_engine.cc with 100% similarity]
src/runtime/contrib/random/random.cc [moved from src/contrib/random/random.cc with 100% similarity]
src/runtime/contrib/random/sgx_random_engine.cc [moved from src/contrib/random/sgx_random_engine.cc with 99% similarity]
src/runtime/contrib/rocblas/rocblas.cc [moved from src/contrib/rocblas/rocblas.cc with 100% similarity]
src/runtime/contrib/sort/sort.cc [moved from src/contrib/sort/sort.cc with 100% similarity]

index c2864e9..480f229 100644 (file)
@@ -40,14 +40,14 @@ if(USE_CUDA)
 
   if(USE_CUDNN)
     message(STATUS "Build with cuDNN support")
-    file(GLOB CONTRIB_CUDNN_SRCS src/contrib/cudnn/*.cc)
+    file(GLOB CONTRIB_CUDNN_SRCS src/runtime/contrib/cudnn/*.cc)
     list(APPEND RUNTIME_SRCS ${CONTRIB_CUDNN_SRCS})
     list(APPEND TVM_RUNTIME_LINKER_LIBS ${CUDA_CUDNN_LIBRARY})
   endif(USE_CUDNN)
 
   if(USE_CUBLAS)
     message(STATUS "Build with cuBLAS support")
-    file(GLOB CONTRIB_CUBLAS_SRCS src/contrib/cublas/*.cc)
+    file(GLOB CONTRIB_CUBLAS_SRCS src/runtime/contrib/cublas/*.cc)
     list(APPEND RUNTIME_SRCS ${CONTRIB_CUBLAS_SRCS})
     list(APPEND TVM_RUNTIME_LINKER_LIBS ${CUDA_CUBLAS_LIBRARY})
   endif(USE_CUBLAS)
index b651298..bde66b0 100644 (file)
@@ -24,7 +24,7 @@ if(USE_METAL)
   list(APPEND RUNTIME_SRCS ${RUNTIME_METAL_SRCS})
 
   if(USE_MPS)
-    file(GLOB MPS_CONTRIB_SRC src/contrib/mps/*.mm)
+    file(GLOB MPS_CONTRIB_SRC src/runtime/contrib/mps/*.mm)
     list(APPEND RUNTIME_SRCS ${MPS_CONTRIB_SRC})
     find_library(MPS_CONTRIB_LIB MetalPerformanceShaders)
     list(APPEND TVM_RUNTIME_LINKER_LIBS ${MPS_CONTRIB_LIB})
index a111335..b0874f3 100644 (file)
@@ -37,14 +37,14 @@ if(USE_ROCM)
 
   if(USE_MIOPEN)
     message(STATUS "Build with MIOpen support")
-    file(GLOB MIOPEN_CONTRIB_SRCS src/contrib/miopen/*.cc)
+    file(GLOB MIOPEN_CONTRIB_SRCS src/runtime/contrib/miopen/*.cc)
     list(APPEND RUNTIME_SRCS ${MIOPEN_CONTRIB_SRCS})
     list(APPEND TVM_RUNTIME_LINKER_LIBS ${ROCM_MIOPEN_LIBRARY})
   endif(USE_MIOPEN)
 
   if(USE_ROCBLAS)
     message(STATUS "Build with RocBLAS support")
-    file(GLOB ROCBLAS_CONTRIB_SRCS src/contrib/rocblas/*.cc)
+    file(GLOB ROCBLAS_CONTRIB_SRCS src/runtime/contrib/rocblas/*.cc)
     list(APPEND RUNTIME_SRCS ${ROCBLAS_CONTRIB_SRCS})
     list(APPEND TVM_RUNTIME_LINKER_LIBS ${ROCM_ROCBLAS_LIBRARY})
   endif(USE_ROCBLAS)
index 2efe877..6a58287 100644 (file)
@@ -16,7 +16,7 @@
 # under the License.
 
 # Plugin rules for cblas
-file(GLOB CBLAS_CONTRIB_SRC src/contrib/cblas/*.cc)
+file(GLOB CBLAS_CONTRIB_SRC src/runtime/contrib/cblas/*.cc)
 
 if(USE_BLAS STREQUAL "openblas")
   find_library(BLAS_LIBRARY openblas)
index 078efec..3b289d6 100644 (file)
@@ -20,7 +20,7 @@ if(USE_NNPACK)
     set(NNPACK_PATH ${CMAKE_CURRENT_SOURCE_DIR}/NNPack)
   endif()
        set(PTHREAD_POOL_PATH ${NNPACK_PATH}/deps/pthreadpool)
-  file(GLOB NNPACK_CONTRIB_SRC src/contrib/nnpack/*.cc)
+  file(GLOB NNPACK_CONTRIB_SRC src/runtime/contrib/nnpack/*.cc)
   list(APPEND RUNTIME_SRCS ${NNPACK_CONTRIB_SRC})
        include_directories(${NNPACK_PATH}/include)
        include_directories(${PTHREAD_POOL_PATH}/include)
index 1b28ec3..dae2807 100644 (file)
@@ -17,6 +17,6 @@
 
 if(USE_RANDOM)
   message(STATUS "Build with contrib.random")
-  file(GLOB RANDOM_CONTRIB_SRC src/contrib/random/random.cc)
+  file(GLOB RANDOM_CONTRIB_SRC src/runtime/contrib/random/random.cc)
   list(APPEND RUNTIME_SRCS ${RANDOM_CONTRIB_SRC})
 endif(USE_RANDOM)
index 52edd38..5537e48 100644 (file)
@@ -17,6 +17,6 @@
 
 if(USE_SORT)
   message(STATUS "Build with contrib.sort")
-  file(GLOB SORT_CONTRIB_SRC src/contrib/sort/*.cc)
+  file(GLOB SORT_CONTRIB_SRC src/runtime/contrib/sort/*.cc)
   list(APPEND RUNTIME_SRCS ${SORT_CONTRIB_SRC})
 endif(USE_SORT)
similarity index 99%
rename from src/contrib/cblas/cblas.cc
rename to src/runtime/contrib/cblas/cblas.cc
index 0f222e2..c655867 100644 (file)
@@ -18,7 +18,6 @@
  */
 
 /*!
- *  Copyright (c) 2017 by Contributors
  * \file Use external cblas library call.
  */
 #include <dmlc/logging.h>
similarity index 99%
rename from src/contrib/cblas/gemm_common.h
rename to src/runtime/contrib/cblas/gemm_common.h
index 2bcefb2..eff631d 100644 (file)
@@ -18,7 +18,6 @@
  */
 
 /*!
- *  Copyright (c) 2018 by Contributors
  * \file tvm/contrib/gemm.h
  * \brief Shared implementation of gemm
  */
similarity index 99%
rename from src/contrib/cublas/cublas.cc
rename to src/runtime/contrib/cublas/cublas.cc
index 5cee5be..f605b7c 100644 (file)
@@ -6,9 +6,9 @@
  * 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
@@ -18,7 +18,6 @@
  */
 
 /*!
- *  Copyright (c) 2018 by Contributors
  * \file Use external cblas library call.
  */
 #include <tvm/runtime/registry.h>
similarity index 94%
rename from src/contrib/cublas/cublas_utils.cc
rename to src/runtime/contrib/cublas/cublas_utils.cc
index 086c208..9953cda 100644 (file)
@@ -6,9 +6,9 @@
  * 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
  */
 
 /*!
- *  Copyright (c) 2018 by Contributors
  * \file Use external cudnn utils function
  */
 #include "cublas_utils.h"
 #include <dmlc/thread_local.h>
 #include <tvm/runtime/registry.h>
-#include "../../runtime/cuda/cuda_common.h"
+#include "../../cuda/cuda_common.h"
 
 namespace tvm {
 namespace contrib {
similarity index 93%
rename from src/contrib/cublas/cublas_utils.h
rename to src/runtime/contrib/cublas/cublas_utils.h
index 8a91373..bc677ff 100644 (file)
@@ -6,9 +6,9 @@
  * 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
@@ -22,8 +22,8 @@
  * \file Use external cudnn utils function
  */
 
-#ifndef TVM_CONTRIB_CUBLAS_CUBLAS_UTILS_H_
-#define TVM_CONTRIB_CUBLAS_CUBLAS_UTILS_H_
+#ifndef TVM_RUNTIME_CONTRIB_CUBLAS_CUBLAS_UTILS_H_
+#define TVM_RUNTIME_CONTRIB_CUBLAS_CUBLAS_UTILS_H_
 
 #include <dmlc/logging.h>
 
@@ -67,4 +67,4 @@ struct CuBlasThreadEntry {
 }  // namespace contrib
 }  // namespace tvm
 
-#endif  // TVM_CONTRIB_CUBLAS_CUBLAS_UTILS_H_
+#endif  // TVM_RUNTIME_CONTRIB_CUBLAS_CUBLAS_UTILS_H_
similarity index 99%
rename from src/contrib/cudnn/conv_forward.cc
rename to src/runtime/contrib/cudnn/conv_forward.cc
index c4d8b37..b1c4d9f 100644 (file)
@@ -6,9 +6,9 @@
  * 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
@@ -18,7 +18,6 @@
  */
 
 /*!
- *  Copyright (c) 2017 by Contributors
  * \file Use external cudnn utils function
  */
 #include <tvm/runtime/registry.h>
similarity index 98%
rename from src/contrib/cudnn/cudnn_utils.cc
rename to src/runtime/contrib/cudnn/cudnn_utils.cc
index 75bfc13..fa185e9 100644 (file)
@@ -6,9 +6,9 @@
  * 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
@@ -18,7 +18,6 @@
  */
 
 /*!
- *  Copyright (c) 2017 by Contributors
  * \file Use external cudnn utils function
  */
 #include "cudnn_utils.h"
similarity index 92%
rename from src/contrib/cudnn/cudnn_utils.h
rename to src/runtime/contrib/cudnn/cudnn_utils.h
index c753854..8538f51 100644 (file)
@@ -6,9 +6,9 @@
  * 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
  */
 
 /*!
- *  Copyright (c) 2017 by Contributors
  * \file Use external cudnn utils function
  */
 
-#ifndef TVM_CONTRIB_CUDNN_CUDNN_UTILS_H_
-#define TVM_CONTRIB_CUDNN_CUDNN_UTILS_H_
+#ifndef TVM_RUNTIME_CONTRIB_CUDNN_CUDNN_UTILS_H_
+#define TVM_RUNTIME_CONTRIB_CUDNN_CUDNN_UTILS_H_
 
 #include <dmlc/logging.h>
 #include <cudnn.h>
 #include <tvm/runtime/device_api.h>
-#include "../../runtime/cuda/cuda_common.h"
+#include "../../cuda/cuda_common.h"
 
 
 namespace tvm {
@@ -90,4 +89,4 @@ struct CuDNNThreadEntry {
 }  // namespace contrib
 }  // namespace tvm
 
-#endif  // TVM_CONTRIB_CUDNN_CUDNN_UTILS_H_
+#endif  // TVM_RUNTIME_CONTRIB_CUDNN_CUDNN_UTILS_H_
similarity index 99%
rename from src/contrib/miopen/conv_forward.cc
rename to src/runtime/contrib/miopen/conv_forward.cc
index 6479d7d..5094cef 100644 (file)
@@ -6,9 +6,9 @@
  * 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
@@ -18,7 +18,6 @@
  */
 
 /*!
- *  Copyright (c) 2017 by Contributors
  * \file Use external miopen utils function
  */
 #include <tvm/runtime/registry.h>
similarity index 98%
rename from src/contrib/miopen/miopen_utils.cc
rename to src/runtime/contrib/miopen/miopen_utils.cc
index 8faa4bd..330ccdd 100644 (file)
@@ -6,9 +6,9 @@
  * 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
@@ -18,7 +18,6 @@
  */
 
 /*!
- *  Copyright (c) 2017 by Contributors
  * \file Use external miopen utils function
  */
 #include "miopen_utils.h"
similarity index 91%
rename from src/contrib/miopen/miopen_utils.h
rename to src/runtime/contrib/miopen/miopen_utils.h
index 8f65fc7..8831e4f 100644 (file)
@@ -6,9 +6,9 @@
  * 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
  */
 
 /*!
- *  Copyright (c) 2017 by Contributors
  * \file Use external miopen utils function
  */
 
-#ifndef TVM_CONTRIB_MIOPEN_MIOPEN_UTILS_H_
-#define TVM_CONTRIB_MIOPEN_MIOPEN_UTILS_H_
+#ifndef TVM_RUNTIME_CONTRIB_MIOPEN_MIOPEN_UTILS_H_
+#define TVM_RUNTIME_CONTRIB_MIOPEN_MIOPEN_UTILS_H_
 
 #include <dmlc/logging.h>
 #include <miopen/miopen.h>
 #include <tvm/runtime/device_api.h>
 #include <string>
-#include "../../runtime/rocm/rocm_common.h"
+#include "../../rocm/rocm_common.h"
 
 namespace tvm {
 namespace contrib {
@@ -75,4 +74,4 @@ struct MIOpenThreadEntry {
 }  // namespace contrib
 }  // namespace tvm
 
-#endif  // TVM_CONTRIB_MIOPEN_MIOPEN_UTILS_H_
+#endif  // TVM_RUNTIME_CONTRIB_MIOPEN_MIOPEN_UTILS_H_
similarity index 89%
rename from src/contrib/mps/mps_utils.h
rename to src/runtime/contrib/mps/mps_utils.h
index 99288a8..728646c 100644 (file)
  */
 
 /*!
- *  Copyright (c) 2017 by Contributors
  * \file Use external mps utils function
  */
 
-#ifndef TVM_CONTRIB_MPS_MPS_UTILS_H_
-#define TVM_CONTRIB_MPS_MPS_UTILS_H_
+#ifndef TVM_RUNTIME_CONTRIB_MPS_MPS_UTILS_H_
+#define TVM_RUNTIME_CONTRIB_MPS_MPS_UTILS_H_
 
 #import <MetalPerformanceShaders/MetalPerformanceShaders.h>
 #include <dmlc/logging.h>
@@ -32,7 +31,7 @@
 #include <tvm/runtime/registry.h>
 #include <tvm/runtime/util.h>
 #include <vector>
-#include "../../runtime/metal/metal_common.h"
+#include "../../metal/metal_common.h"
 
 namespace tvm {
 namespace contrib {
@@ -56,4 +55,4 @@ struct MetalThreadEntry {
 }  // namespace contrib
 }  // namespace tvm
 
-#endif  // TVM_CONTRIB_MPS_MPS_UTILS_H_
+#endif  // TVM_RUNTIME_CONTRIB_MPS_MPS_UTILS_H_
similarity index 88%
rename from src/contrib/nnpack/nnpack_utils.h
rename to src/runtime/contrib/nnpack/nnpack_utils.h
index 9491802..8e936fc 100644 (file)
@@ -6,9 +6,9 @@
  * 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
@@ -21,8 +21,8 @@
  *  Copyright (c) 2017 by Contributors
  * \file Use external nnpack library call.
  */
-#ifndef TVM_CONTRIB_NNPACK_NNPACK_UTILS_H_
-#define TVM_CONTRIB_NNPACK_NNPACK_UTILS_H_
+#ifndef TVM_RUNTIME_CONTRIB_NNPACK_NNPACK_UTILS_H_
+#define TVM_RUNTIME_CONTRIB_NNPACK_NNPACK_UTILS_H_
 #include <tvm/runtime/registry.h>
 #include <tvm/runtime/util.h>
 #include <dmlc/thread_local.h>
@@ -41,4 +41,4 @@ struct NNPackThreadLocalEntry {
 bool NNPackConfig(uint64_t nthreads);
 }  // namespace contrib
 }  // namespace tvm
-#endif  // TVM_CONTRIB_NNPACK_NNPACK_UTILS_H_
+#endif  // TVM_RUNTIME_CONTRIB_NNPACK_NNPACK_UTILS_H_
similarity index 99%
rename from src/contrib/random/sgx_random_engine.cc
rename to src/runtime/contrib/random/sgx_random_engine.cc
index 98e2b61..8134c54 100644 (file)
@@ -6,9 +6,9 @@
  * 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
@@ -26,7 +26,7 @@
 #include <sgx_trts.h>
 #include <algorithm>
 #include <cmath>
-#include "../../runtime/sgx/common.h"
+#include "../../sgx/common.h"
 
 namespace tvm {
 namespace contrib {