ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

【TVM学习四】基于Arm平台编译TVM—LLVM OpenCL CUDA openblas

2019-07-18 17:04:47  阅读:1281  来源: 互联网

标签:USE LLVM OFF Whether enable OpenCL use TVM set


参考链接:关于 llvm/clang 在 Ubuntu 下的安装?

 

补充:

           1. 我下载的是LLVM7.0.0版本,对应源码 LLVM source codeClang source code

            2. 在第四步中,进入build目录,执行cmake ../llvm -DCMAKE_BUILD_TYPE=Debug(或者Release)        

                 省略后边: -DLLVM_TARGETS_TO_BUILD=X86 

             3. 在第五步中,最好直接使用 make

                 省略后边: -j4

                  原因:使用多核编译时容易出现以下错误:c++: internal compiler error: killed (program ccplus)

                             出现该问题是因为空间不足,需要增加交换空间 (安装 CMake 错误: c++: internal compiler error: Killed

                              (program cc1plus))


在基于PC的Ubuntu16.04上测试也是可行的!!!


 

参考链接:OpenCL科普及在ubuntu 16.04 LTS上的安装

                  ubuntu安装OpenCL运行及编译环境 (主要参考其中的相关解释)

    接着,打开目录/tvm/build下的config.cmake,进行以下修改:

    # Whether enable OpenCL runtime
    set(USE_OPENCL ON)

    最后,在以上目录下继续执行:

    cmake ..

    make -j4


通过以上步骤便完成了TVM和OpenCL的安装!!!

可参考【TVM学习五】Install TVM on Local Machine (Ubuntu16.04)

 


#--------------------------------------------------------------------
#  Template custom cmake configuration for compiling
#
#  This file is used to override the build options in build.
#  If you want to change the configuration, please use the following
#  steps. Assume you are on the root directory. First copy the this
#  file so that any local changes will be ignored by git
#
#  $ mkdir build
#  $ cp cmake/config.cmake build
#
#  Next modify the according entries, and then compile by
#
#  $ cd build
#  $ cmake ..
#
#  Then buld in parallel with 8 threads
#
#  $ make -j8
#--------------------------------------------------------------------

#---------------------------------------------
# Backend runtimes.
#---------------------------------------------

# Whether enable CUDA during compile,
#
# Possible values:
# - ON: enable CUDA with cmake's auto search
# - OFF: disable CUDA
# - /path/to/cuda: use specific path to cuda toolkit
set(USE_CUDA ON)

# Whether enable ROCM runtime
#
# Possible values:
# - ON: enable ROCM with cmake's auto search
# - OFF: disable ROCM
# - /path/to/rocm: use specific path to rocm
set(USE_ROCM OFF)

# Whether enable SDAccel runtime
set(USE_SDACCEL OFF)

# Whether enable Intel FPGA SDK for OpenCL (AOCL) runtime
set(USE_AOCL OFF)

# Whether enable OpenCL runtime
set(USE_OPENCL ON)

# Whether enable Metal runtime
set(USE_METAL OFF)

# Whether enable Vulkan runtime
#
# Possible values:
# - ON: enable Vulkan with cmake's auto search
# - OFF: disable vulkan
# - /path/to/vulkan-sdk: use specific path to vulkan-sdk
set(USE_VULKAN OFF)

# Whether enable OpenGL runtime
set(USE_OPENGL OFF)

# Whether to enable SGX runtime
#
# Possible values for USE_SGX:
# - /path/to/sgxsdk: path to Intel SGX SDK
# - OFF: disable SGX
#
# SGX_MODE := HW|SIM
set(USE_SGX OFF)
set(SGX_MODE "SIM")
set(RUST_SGX_SDK "/path/to/rust-sgx-sdk")

# Whether enable RPC runtime
set(USE_RPC ON)

# Whether embed stackvm into the runtime
set(USE_STACKVM_RUNTIME OFF)

# Whether enable tiny embedded graph runtime.
set(USE_GRAPH_RUNTIME ON)

# Whether enable additional graph debug functions
set(USE_GRAPH_RUNTIME_DEBUG OFF)

# Whether build with LLVM support
# Requires LLVM version >= 4.0
#
# Possible values:
# - ON: enable llvm with cmake's find search
# - OFF: disable llvm
# - /path/to/llvm-config: enable specific LLVM when multiple llvm-dev is available.
set(USE_LLVM /data0/zzw/llvm-build/bin/llvm-config)

#---------------------------------------------
# Contrib libraries
#---------------------------------------------
# Whether use BLAS, choices: openblas, mkl, atlas, apple
set(USE_BLAS openblas)

# /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
set(USE_RANDOM OFF)

# Whether use NNPack
set(USE_NNPACK OFF)

# Whether use CuDNN
set(USE_CUDNN ON)

# Whether use cuBLAS
set(USE_CUBLAS ON)

# Whether use MIOpen
set(USE_MIOPEN OFF)

# Whether use MPS
set(USE_MPS OFF)

# Whether use rocBlas
set(USE_ROCBLAS OFF)

# Whether use contrib sort
set(USE_SORT ON)

# Build ANTLR parser for Relay text format
set(USE_ANTLR OFF)

# Whether use Relay debug mode
set(USE_RELAY_DEBUG OFF)

支持:CUDA,CUDNN,CUBLAS,OPENCL,LLVM,openblas

sudo apt-get install libopenblas-dev

sudo apt install ocl-icd-opencl-dev

标签:USE,LLVM,OFF,Whether,enable,OpenCL,use,TVM,set
来源: https://blog.csdn.net/qq_37643960/article/details/88960275

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有