Skip to content

Commit

Permalink
[RUNTIME] Separate runtime related contrib into runtime/contrib
Browse files Browse the repository at this point in the history
  • Loading branch information
tqchen committed Oct 27, 2019
1 parent 13b2856 commit 551fbfe
Show file tree
Hide file tree
Showing 31 changed files with 51 additions and 62 deletions.
4 changes: 2 additions & 2 deletions cmake/modules/CUDA.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/Metal.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
4 changes: 2 additions & 2 deletions cmake/modules/ROCM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/contrib/BLAS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/contrib/NNPack.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/contrib/Random.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion cmake/modules/contrib/Sort.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/

/*!
* Copyright (c) 2017 by Contributors
* \file Use external cblas library call.
*/
#include <dmlc/logging.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/

/*!
* Copyright (c) 2018 by Contributors
* \file tvm/contrib/gemm.h
* \brief Shared implementation of gemm
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -18,7 +18,6 @@
*/

/*!
* Copyright (c) 2018 by Contributors
* \file Use external cblas library call.
*/
#include <tvm/runtime/registry.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -18,13 +18,12 @@
*/

/*!
* 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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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>

Expand Down Expand Up @@ -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_
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -18,7 +18,6 @@
*/

/*!
* Copyright (c) 2017 by Contributors
* \file Use external cudnn utils function
*/
#include <tvm/runtime/registry.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -18,7 +18,6 @@
*/

/*!
* Copyright (c) 2017 by Contributors
* \file Use external cudnn utils function
*/
#include "cudnn_utils.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -18,17 +18,16 @@
*/

/*!
* 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 {
Expand Down Expand Up @@ -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_
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -18,7 +18,6 @@
*/

/*!
* Copyright (c) 2017 by Contributors
* \file Use external miopen utils function
*/
#include <tvm/runtime/registry.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -18,7 +18,6 @@
*/

/*!
* Copyright (c) 2017 by Contributors
* \file Use external miopen utils function
*/
#include "miopen_utils.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -18,18 +18,17 @@
*/

/*!
* 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 {
Expand Down Expand Up @@ -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_
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@
*/

/*!
* 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>
Expand All @@ -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 {
Expand All @@ -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_
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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>
Expand All @@ -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_
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 551fbfe

Please sign in to comment.