From 0a3941be6d927f0177a4bfec37524280e32d8aef Mon Sep 17 00:00:00 2001 From: Dmitry Razdoburdin Date: Sat, 6 Jul 2024 20:10:54 +0200 Subject: [PATCH] [sycl] Improve build configuration. (#10548) Co-authored-by: Dmitry Razdoburdin <> --- .github/workflows/main.yml | 2 +- .github/workflows/python_tests.yml | 2 +- CMakeLists.txt | 2 -- plugin/CMakeLists.txt | 4 ++-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f5ecb94f6..001e17b51 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -95,7 +95,7 @@ jobs: run: | mkdir build cd build - cmake .. -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON -DPLUGIN_SYCL=ON -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX + cmake .. -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON -DPLUGIN_SYCL=ON -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX make -j$(nproc) - name: Run gtest binary for SYCL run: | diff --git a/.github/workflows/python_tests.yml b/.github/workflows/python_tests.yml index e6eec86c8..83f0ad495 100644 --- a/.github/workflows/python_tests.yml +++ b/.github/workflows/python_tests.yml @@ -294,7 +294,7 @@ jobs: run: | mkdir build cd build - cmake .. -DPLUGIN_SYCL=ON -DCMAKE_PREFIX_PATH=$CONDA_PREFIX + cmake .. -DPLUGIN_SYCL=ON -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DCMAKE_PREFIX_PATH=$CONDA_PREFIX make -j$(nproc) - name: Install Python package run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index bb526ad02..f7cf8a6cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,6 @@ cmake_minimum_required(VERSION 3.18 FATAL_ERROR) if(PLUGIN_SYCL) - set(CMAKE_CXX_COMPILER "g++") - set(CMAKE_C_COMPILER "gcc") string(REPLACE " -isystem ${CONDA_PREFIX}/include" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") endif() diff --git a/plugin/CMakeLists.txt b/plugin/CMakeLists.txt index 5d20e120e..c0c31f3a1 100644 --- a/plugin/CMakeLists.txt +++ b/plugin/CMakeLists.txt @@ -10,14 +10,14 @@ if(PLUGIN_SYCL) target_compile_definitions(plugin_sycl PUBLIC -DXGBOOST_USE_SYCL=1) target_link_libraries(plugin_sycl PUBLIC -fsycl) set_target_properties(plugin_sycl PROPERTIES - COMPILE_FLAGS -fsycl + COMPILE_FLAGS "-fsycl -fno-sycl-id-queries-fit-in-int" CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON POSITION_INDEPENDENT_CODE ON) if(USE_OPENMP) find_package(OpenMP REQUIRED) set_target_properties(plugin_sycl PROPERTIES - COMPILE_FLAGS "-fsycl -qopenmp") + COMPILE_FLAGS "-fsycl -fno-sycl-id-queries-fit-in-int -qopenmp") endif() # Get compilation and link flags of plugin_sycl and propagate to objxgboost target_link_libraries(objxgboost PUBLIC plugin_sycl)