[sycl] Improve build configuration. (#10548)
Co-authored-by: Dmitry Razdoburdin <>
This commit is contained in:
parent
00264eb72b
commit
0a3941be6d
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@ -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: |
|
||||
|
||||
2
.github/workflows/python_tests.yml
vendored
2
.github/workflows/python_tests.yml
vendored
@ -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: |
|
||||
|
||||
@ -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()
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user