Skip to content

Latest commit

 

History

History
49 lines (38 loc) · 1.22 KB

File metadata and controls

49 lines (38 loc) · 1.22 KB

SYCL Build Pybind11 Extension

Building

NOTE: Install scikit-build and dpcpp before next steps.

To build on Linux, run:

python setup.py build_ext --inplace -- -G "Ninja" \
     -DCMAKE_C_COMPILER:PATH=icx \
     -DCMAKE_CXX_COMPILER:PATH=icpx \
     -DTBB_LIBRARY_DIR=$CONDA_PREFIX/lib \
     -DMKL_LIBRARY_DIR=${CONDA_PREFIX}/lib \
     -DMKL_INCLUDE_DIR=${CONDA_PREFIX}/include \
     -DTBB_INCLUDE_DIR=${CONDA_PREFIX}/include

To build on Windows, run:

python setup.py build_ext --inplace -- -G "Ninja" \
     -DCMAKE_C_COMPILER:PATH=icx \
     -DCMAKE_CXX_COMPILER:PATH=icx \
     -DTBB_LIBRARY_DIR=$CONDA_PREFIX/lib \
     -DMKL_LIBRARY_DIR=${CONDA_PREFIX}/lib \
     -DMKL_INCLUDE_DIR=${CONDA_PREFIX}/include \
     -DTBB_INCLUDE_DIR=${CONDA_PREFIX}/include

Running

To run the example, use:

python -m pytest tests

To compare Python overhead, use:

# build standad-alone executable
cmake --build $(find . -name cmake-build) --target standalone_cpp
# execute it
$(find . -name cmake-build)/standalone_cpp 1000 11
# launch Python computatin
python sycl_timing_solver.py 1000 11

Compare host times vs. C++ wall-clock times while making sure that the number of iterations is the same.