зеркало из https://github.com/microsoft/LightGBM.git
[CUDA] added support for Clang (#3886)
This commit is contained in:
Родитель
763b5f3cdc
Коммит
b8cfaf61a7
16
.ci/setup.sh
16
.ci/setup.sh
|
@ -35,6 +35,7 @@ else # Linux
|
|||
apt-utils \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
cmake \
|
||||
curl \
|
||||
git \
|
||||
iputils-ping \
|
||||
|
@ -48,16 +49,16 @@ else # Linux
|
|||
unzip \
|
||||
wget \
|
||||
zip
|
||||
if [[ $COMPILER == "clang" ]]; then
|
||||
sudo apt-get install --no-install-recommends -y \
|
||||
clang \
|
||||
libomp-dev
|
||||
fi
|
||||
|
||||
export LANG="en_US.UTF-8"
|
||||
export LC_ALL="${LANG}"
|
||||
sudo locale-gen ${LANG}
|
||||
sudo update-locale
|
||||
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
cmake \
|
||||
clang \
|
||||
libomp-dev
|
||||
fi
|
||||
if [[ $TASK == "mpi" ]]; then
|
||||
sudo apt-get update
|
||||
|
@ -84,6 +85,11 @@ else # Linux
|
|||
lsb-release \
|
||||
software-properties-common \
|
||||
wget
|
||||
if [[ $COMPILER == "clang" ]]; then
|
||||
apt-get install --no-install-recommends -y \
|
||||
clang \
|
||||
libomp-dev
|
||||
fi
|
||||
curl -sL https://apt.kitware.com/keys/kitware-archive-latest.asc | apt-key add -
|
||||
apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main" -y
|
||||
apt-get update
|
||||
|
|
|
@ -11,7 +11,6 @@ on:
|
|||
env:
|
||||
github_actions: 'true'
|
||||
os_name: linux
|
||||
compiler: gcc
|
||||
task: cuda
|
||||
conda_env: test-env
|
||||
|
||||
|
@ -25,12 +24,15 @@ jobs:
|
|||
matrix:
|
||||
include:
|
||||
- method: source
|
||||
compiler: gcc
|
||||
python_version: 3.7
|
||||
cuda_version: "11.2.0"
|
||||
- method: pip
|
||||
compiler: clang
|
||||
python_version: 3.8
|
||||
cuda_version: "10.0"
|
||||
- method: wheel
|
||||
compiler: gcc
|
||||
python_version: 3.9
|
||||
cuda_version: "9.0"
|
||||
steps:
|
||||
|
@ -69,7 +71,7 @@ jobs:
|
|||
cat > docker.env <<EOF
|
||||
GITHUB_ACTIONS=${{ env.github_actions }}
|
||||
OS_NAME=${{ env.os_name }}
|
||||
COMPILER=${{ env.compiler }}
|
||||
COMPILER=${{ matrix.compiler }}
|
||||
TASK=${{ env.task }}
|
||||
METHOD=${{ matrix.method }}
|
||||
CONDA_ENV=${{ env.conda_env }}
|
||||
|
|
|
@ -24,11 +24,7 @@ else()
|
|||
cmake_minimum_required(VERSION 3.0)
|
||||
endif()
|
||||
|
||||
if(USE_CUDA)
|
||||
PROJECT(lightgbm LANGUAGES C CXX CUDA)
|
||||
else()
|
||||
PROJECT(lightgbm LANGUAGES C CXX)
|
||||
endif()
|
||||
PROJECT(lightgbm LANGUAGES C CXX)
|
||||
|
||||
if(__INTEGRATE_OPENCL)
|
||||
set(__INTEGRATE_OPENCL ON CACHE BOOL "" FORCE)
|
||||
|
@ -117,6 +113,8 @@ else()
|
|||
endif(USE_MPI)
|
||||
|
||||
if(USE_CUDA)
|
||||
SET(CMAKE_CUDA_HOST_COMPILER "${CMAKE_CXX_COMPILER}")
|
||||
enable_language(CUDA)
|
||||
SET(USE_OPENMP ON CACHE BOOL "CUDA requires OpenMP" FORCE)
|
||||
endif(USE_CUDA)
|
||||
|
||||
|
|
|
@ -590,11 +590,11 @@ The CUDA-based build is a separate implementation and requires an NVIDIA graphic
|
|||
Linux
|
||||
^^^^^
|
||||
|
||||
On Linux a CUDA version of LightGBM can be built using **CUDA**, **CMake** and **gcc**.
|
||||
On Linux a CUDA version of LightGBM can be built using **CUDA**, **CMake** and **gcc** or **Clang**.
|
||||
|
||||
The following dependencies should be installed before compilation:
|
||||
|
||||
- **CUDA** 9.0 or later libraries. Please refer to `this detailed guide`_.
|
||||
- **CUDA** 9.0 or later libraries. Please refer to `this detailed guide`_. Pay great attention to the minimum required versions of host compilers listed in the table from that guide and use only recommended versions of compilers.
|
||||
|
||||
- **CMake** 3.16 or later.
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче