Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
9b8cb1b6
Commit
9b8cb1b6
authored
Jun 26, 2018
by
Tao Lv
Committed by
Tianqi Chen
Jun 25, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Contrib: add mkl blas support (#1336)
parent
80a7d491
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
1 deletions
+21
-1
CMakeLists.txt
+1
-0
cmake/config.cmake
+6
-1
cmake/modules/contrib/BLAS.cmake
+10
-0
src/contrib/cblas/cblas.cc
+4
-0
No files found.
CMakeLists.txt
View file @
9b8cb1b6
...
@@ -42,6 +42,7 @@ tvm_option(INSTALL_DEV "Install compiler infrastructure" OFF)
...
@@ -42,6 +42,7 @@ tvm_option(INSTALL_DEV "Install compiler infrastructure" OFF)
# Contrib library options
# Contrib library options
tvm_option
(
USE_BLAS
"The blas library to be linked"
none
)
tvm_option
(
USE_BLAS
"The blas library to be linked"
none
)
tvm_option
(
USE_MKL_PATH
"MKL root path when use MKL blas"
none
)
tvm_option
(
USE_CUDNN
"Build with cuDNN"
OFF
)
tvm_option
(
USE_CUDNN
"Build with cuDNN"
OFF
)
tvm_option
(
USE_CUBLAS
"Build with cuBLAS"
OFF
)
tvm_option
(
USE_CUBLAS
"Build with cuBLAS"
OFF
)
tvm_option
(
USE_MIOPEN
"Build with ROCM:MIOpen"
OFF
)
tvm_option
(
USE_MIOPEN
"Build with ROCM:MIOpen"
OFF
)
...
...
cmake/config.cmake
View file @
9b8cb1b6
...
@@ -77,9 +77,14 @@ set(USE_LLVM OFF)
...
@@ -77,9 +77,14 @@ set(USE_LLVM OFF)
#---------------------------------------------
#---------------------------------------------
# Contrib libraries
# Contrib libraries
#---------------------------------------------
#---------------------------------------------
# Whether use BLAS, choices: openblas,
atlas, b
las, apple
# Whether use BLAS, choices: openblas,
mkl, at
las, apple
set
(
USE_BLAS none
)
set
(
USE_BLAS none
)
# /path/to/mkl: mkl root path when use mkl blas library
# set(USE_MKL_PATH /opt/intel/mkl) for UNIX
# set(USE_MKL_PATH ../IntelSWTools/compilers_and_libraries_2018/windows/mkl) for WIN32
set
(
USE_MKL_PATH none
)
# Whether use contrib.random in runtime
# Whether use contrib.random in runtime
set
(
USE_RANDOM OFF
)
set
(
USE_RANDOM OFF
)
...
...
cmake/modules/contrib/BLAS.cmake
View file @
9b8cb1b6
...
@@ -6,6 +6,16 @@ if(USE_BLAS STREQUAL "openblas")
...
@@ -6,6 +6,16 @@ if(USE_BLAS STREQUAL "openblas")
list
(
APPEND TVM_RUNTIME_LINKER_LIBS
${
BLAS_LIBRARY
}
)
list
(
APPEND TVM_RUNTIME_LINKER_LIBS
${
BLAS_LIBRARY
}
)
list
(
APPEND RUNTIME_SRCS
${
CBLAS_CONTRIB_SRC
}
)
list
(
APPEND RUNTIME_SRCS
${
CBLAS_CONTRIB_SRC
}
)
message
(
STATUS
"Use BLAS library "
${
BLAS_LIBRARY
}
)
message
(
STATUS
"Use BLAS library "
${
BLAS_LIBRARY
}
)
elseif
(
USE_BLAS STREQUAL
"mkl"
)
if
(
NOT IS_DIRECTORY
${
USE_MKL_PATH
}
)
set
(
USE_MKL_PATH /opt/intel/mkl
)
endif
()
find_library
(
BLAS_LIBRARY mkl_rt
${
USE_MKL_PATH
}
/lib/
${
USE_MKL_PATH
}
/lib/intel64
)
include_directories
(
${
USE_MKL_PATH
}
/include
)
list
(
APPEND TVM_RUNTIME_LINKER_LIBS
${
BLAS_LIBRARY
}
)
list
(
APPEND RUNTIME_SRCS
${
CBLAS_CONTRIB_SRC
}
)
add_definitions
(
-DUSE_MKL_BLAS=1
)
message
(
STATUS
"Use BLAS library "
${
BLAS_LIBRARY
}
)
elseif
(
USE_BLAS STREQUAL
"atlas"
OR USE_BLAS STREQUAL
"blas"
)
elseif
(
USE_BLAS STREQUAL
"atlas"
OR USE_BLAS STREQUAL
"blas"
)
find_library
(
BLAS_LIBRARY cblas
)
find_library
(
BLAS_LIBRARY cblas
)
list
(
APPEND TVM_RUNTIME_LINKER_LIBS
${
BLAS_LIBRARY
}
)
list
(
APPEND TVM_RUNTIME_LINKER_LIBS
${
BLAS_LIBRARY
}
)
...
...
src/contrib/cblas/cblas.cc
View file @
9b8cb1b6
...
@@ -7,7 +7,11 @@
...
@@ -7,7 +7,11 @@
#include <dmlc/logging.h>
#include <dmlc/logging.h>
extern
"C"
{
extern
"C"
{
#if USE_MKL_BLAS == 1
#include <mkl_cblas.h>
#else
#include <cblas.h>
#include <cblas.h>
#endif
}
}
namespace
tvm
{
namespace
tvm
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment