diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ab2a58fe9dd1..2f1e8acc1286 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -63,6 +63,42 @@ jobs: cd build ctest --extra-verbose + gtest-cpu-sycl: + name: Test Google C++ unittest (CPU SYCL) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + steps: + - uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791 # v2.5.0 + with: + submodules: 'true' + - name: Install SYCL runtime + run: | + sudo apt-get update + wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB + sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB + rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB + echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list + sudo add-apt-repository -y "deb https://apt.repos.intel.com/oneapi all main" + sudo apt-get update + sudo apt-get install -y intel-dpcpp-cpp-compiler-2023.2.1 + source /opt/intel/oneapi/compiler/latest/env/vars.sh + source /opt/intel/oneapi/tbb/latest/env/vars.sh + + - name: Build and install XGBoost + shell: bash -l {0} + run: | + mkdir build + cd build + cmake .. -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON -DPLUGIN_SYCL=ON + make -j$(nproc) + - name: Run gtest binary + run: | + cd build + ./testxgboost --gtest_filter=Sycl* + c-api-demo: name: Test installing XGBoost lib + building the C API demo runs-on: ${{ matrix.os }}