Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ extend-ignore = E203, W503
show-source = True

exclude =
versioneer.py
dpctl/_version.py
build
conda.recipe
.git
Expand Down
3 changes: 3 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dpctl/_version.py export-subst
.git_archival.txt export-subst
8 changes: 4 additions & 4 deletions .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -687,8 +687,8 @@ jobs:
conda install -n ${{ env.EXAMPLES_ENV_NAME }} -y cmake ninja $CHANNELS || exit 1
echo "Cmake and Ninja installed"
# shellcheck disable=SC2086
conda install -n ${{ env.EXAMPLES_ENV_NAME }} -y pybind11 cython scikit-build $CHANNELS || exit 1
echo "scikit-build installed"
conda install -n ${{ env.EXAMPLES_ENV_NAME }} -y pybind11 cython cython-cmake scikit-build-core $CHANNELS || exit 1
echo "scikit-build-core installed"
# shellcheck disable=SC2086
conda install -n ${{ env.EXAMPLES_ENV_NAME }} -y mkl-dpcpp \
mkl-devel-dpcpp dpcpp_cpp_rt "${DPCTL_DEPENDS}" \
Expand Down Expand Up @@ -720,7 +720,7 @@ jobs:
while IFS= read -r d; do
pushd "$d" > /dev/null
conda activate --stack build_env
CC=icx CXX=icpx python setup.py build_ext --inplace -G Ninja || exit 1
CC=icx CXX=icpx python -m pip install --no-build-isolation --no-deps -e . || exit 1
conda deactivate
if [ -e tests ]; then
LD_LIBRARY_PATH="${CONDA_PREFIX}/lib" python -m pytest tests || exit 1
Expand All @@ -739,7 +739,7 @@ jobs:
while IFS= read -r d; do
pushd "$d" > /dev/null
conda activate --stack "${{ env.BUILD_ENV_NAME }}"
CC=icx CXX=icpx python setup.py build_ext --inplace -G Ninja || exit 1
CC=icx CXX=icpx python -m pip install --no-build-isolation --no-deps -e . || exit 1
conda deactivate
python -m pytest tests || exit 1
popd > /dev/null
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Checkout repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# versioneer needs the tags to compute the package version
# setuptools-scm needs the tags to compute the package version
fetch-depth: 0

- name: Add Intel repository
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:

- name: Install dpctl dependencies
run: |
pip install numpy cython setuptools"<80" scikit-build cmake ninja versioneer[toml]==0.29
pip install numpy cython scikit-build-core setuptools-scm cython-cmake cmake ninja

- name: Report compiler version
run: |
Expand Down Expand Up @@ -98,9 +98,9 @@ jobs:
run: |
set -o pipefail
source "${ONEAPI_ROOT}/setvars.sh"
rm -rf _skbuild
# --skip-editable: the in-place build_ext already compiled everything
# Coverity needs to see, a pip install would only repeat it
rm -rf build
# --skip-editable: a regular install is enough for Coverity to see
# all compilation units
cov-build --dir cov-int \
python scripts/build_locally.py --oneapi --skip-editable --verbose \
2>&1 | tee cov-build.log
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/generate-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
- name: Install dpctl dependencies
shell: bash -l {0}
run: |
pip install numpy cython setuptools"<80" pytest pytest-cov scikit-build cmake coverage[toml] versioneer[toml]==0.29
pip install numpy cython pytest pytest-cov scikit-build-core setuptools-scm cython-cmake cmake ninja coverage[toml]

- name: Build dpctl with coverage
shell: bash -l {0}
Expand All @@ -113,7 +113,7 @@ jobs:
shell: bash -l {0}
run: |
echo "Processing c-api-coverage"
DPCTL_LCOV_FN=$(find _skbuild -name dpctl.lcov)
DPCTL_LCOV_FN=$(find build/coverage -name dpctl.lcov)
export DPCTL_LCOV_FN
grep "/tmp" "$DPCTL_LCOV_FN"
coveralls-lcov -v -n \
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/generate-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,9 @@ jobs:
if: ${{ !github.event.pull_request || github.event.action != 'closed' }}
shell: bash -l {0}
run: |
pip install numpy cython setuptools">=70.1" scikit-build cmake sphinx"<7.2" pydot graphviz furo \
pip install numpy cython scikit-build-core setuptools-scm cython-cmake cmake ninja sphinx"<7.2" pydot graphviz furo \
sphinxcontrib-programoutput sphinxcontrib-googleanalytics sphinx-design \
sphinxcontrib-jsmath sphinx-copybutton sphinxcontrib-spelling \
versioneer[toml]==0.29
sphinxcontrib-jsmath sphinx-copybutton sphinxcontrib-spelling
- name: Checkout repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand All @@ -78,7 +77,7 @@ jobs:
tar xf doxyrest-2.1.2-linux-amd64.tar.xz
python scripts/gen_docs.py --doxyrest-root="$(pwd)/doxyrest-2.1.2-linux-amd64" --verbose --multiversion --clean || exit 1
python -c "import dpctl; print(dpctl.__version__)" || exit 1
mv "$(find _skbuild -type d -path "*/cmake-install/docs/docs" | head -n 1)" ~/docs
mv build/docs/docs/docs ~/docs
git clean -dfx
git reset --hard
- name: Publish docs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/os-llvm-sycl-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:
- name: Install dpctl dependencies
shell: bash -l {0}
run: |
pip install numpy cython setuptools"<80" pytest scikit-build cmake ninja versioneer[toml]==0.29
pip install numpy cython pytest scikit-build-core setuptools-scm cython-cmake cmake ninja

- name: Checkout repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ __pycache__/

# CMake build and local install directory
build
_skbuild
build_cmake
install

Expand Down
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ repos:
rev: 26.5.1
hooks:
- id: black
exclude: "versioneer.py|dpctl/_version.py"
- repo: https://github.com/pycqa/isort
rev: 9.0.1
hooks:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Bump minimum NumPy version to 1.26 [gh-2192](https://github.com/IntelPython/dpctl/pull/2192)
* Rewrote USM Python examples into a single example [gh-2292](https://github.com/IntelPython/dpctl/pull/2292)
* Registered `DPCTL_PARTITION_AFFINITY_DOMAIN_UNKNOWN` enumerator when `DPCTLDevice_GetPartitionAffinityDomains` receives an unrecognized value from the SYCL runtime [gh-2324](https://github.com/IntelPython/dpctl/pull/2324)
* Build with `scikit-build-core` instead of `scikit-build` and `setuptools`, and compute the version with `setuptools-scm` instead of `versioneer` [gh-2341](https://github.com/IntelPython/dpctl/issues/2341)

### Deprecated
* Deprecated `dpctl.program` submodule in favor of `dpctl.compiler`, which provides a better description of the purpose of the submodule in exposing DPC++ compilation-related functionality [gh-2317](https://github.com/IntelPython/dpctl/pull/2317)
Expand Down
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ target_link_libraries(DpctlCAPI INTERFACE DPCTLSyclInterfaceHeaders)

install(DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}/dpctl/apis/include/
DESTINATION ${CMAKE_INSTALL_PREFIX}/dpctl/include
DESTINATION dpctl/include
FILES_MATCHING REGEX "\\.h(pp)?$"
)

Expand All @@ -137,9 +137,15 @@ file(GLOB _cmake_scripts ${CMAKE_SOURCE_DIR}/cmake/*.cmake)
install(FILES ${_cmake_scripts}
DESTINATION dpctl/resources/cmake
)
# Installed into the environment prefix, not site-packages
if(DEFINED SKBUILD_DATA_DIR)
set(_dpctl_config_dest ${SKBUILD_DATA_DIR}/lib/cmake/dpctl)
else()
set(_dpctl_config_dest lib/cmake/dpctl)
endif()
install(FILES
${CMAKE_SOURCE_DIR}/cmake/dpctl-config.cmake
DESTINATION lib/cmake/dpctl
DESTINATION ${_dpctl_config_dest}
)

if (DPCTL_GENERATE_DOCS)
Expand Down
5 changes: 3 additions & 2 deletions conda-recipe-cf/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ REM A workaround for activate-dpcpp.bat issue to be addressed in 2021.4
set "LIB=%BUILD_PREFIX%\Library\lib;%BUILD_PREFIX%\compiler\lib;%LIB%"
set "INCLUDE=%BUILD_PREFIX%\include;%INCLUDE%"

"%PYTHON%" setup.py clean --all

REM useful for building in resources constrained VMs (public CI)
set "CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=FALSE"

Expand All @@ -22,6 +20,9 @@ set "CC=icx"
set "CXX=icx"

set "CMAKE_GENERATOR=Ninja"
:: Set by the VS activation, but not supported by Ninja
set "CMAKE_GENERATOR_PLATFORM="
set "CMAKE_GENERATOR_TOOLSET="
:: Make CMake verbose
set "VERBOSE=1"

Expand Down
4 changes: 0 additions & 4 deletions conda-recipe-cf/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ export ICPXCFG
ICXCFG="$(pwd)/icpx_for_conda.cfg"
export ICXCFG

if [ -e "_skbuild" ]; then
${PYTHON} setup.py clean --all
fi

export CC=icx
export CXX=icpx

Expand Down
12 changes: 3 additions & 9 deletions conda-recipe-cf/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,13 @@ requirements:
- pybind11 >=3.0.2
- intel-sycl-rt
- intel-cmplr-lib-rt
# Ensure we are using latest version of setuptools, since we don't need
# editable environments for release.
- setuptools >=69
- wheel >=0.43
- python-build >=1.1
- scikit-build >=0.17.0
- scikit-build-core >=0.11
- setuptools-scm >=8
- cython-cmake >=0.2
- cython >=3.1.0 # [py>=313]
- cython >=3.0.10 # [py<313]
- numpy
# WARNING: check with doc how to upgrade
- versioneer ==0.29
# versioneer dependency
- tomli # [py<311]
run:
- python
- {{ pin_compatible('intel-sycl-rt', min_pin='x.x', max_pin='x') }}
Expand Down
5 changes: 3 additions & 2 deletions conda-recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ REM A workaround for activate-dpcpp.bat issue to be addressed in 2021.4
set "LIB=%BUILD_PREFIX%\Library\lib;%BUILD_PREFIX%\compiler\lib;%LIB%"
set "INCLUDE=%BUILD_PREFIX%\include;%INCLUDE%"

"%PYTHON%" setup.py clean --all

REM Overriding IPO is useful for building in resources constrained VMs (public CI)
if DEFINED OVERRIDE_INTEL_IPO (
set "CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=FALSE"
Expand All @@ -20,6 +18,9 @@ set "CC=icx"
set "CXX=icx"

set "CMAKE_GENERATOR=Ninja"
:: Set by the VS activation, but not supported by Ninja
set "CMAKE_GENERATOR_PLATFORM="
set "CMAKE_GENERATOR_TOOLSET="
:: Make CMake verbose
set "VERBOSE=1"

Expand Down
4 changes: 0 additions & 4 deletions conda-recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ export ICXCFG
read -r GLIBC_MAJOR GLIBC_MINOR <<<"$(conda list '^sysroot_linux-64$' \
| tail -n 1 | awk '{print $2}' | grep -oP '\d+' | head -n 2 | tr '\n' ' ')"

if [ -e "_skbuild" ]; then
${PYTHON} setup.py clean --all
fi

export CC=icx
export CXX=icpx

Expand Down
17 changes: 4 additions & 13 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,13 @@ requirements:
- pybind11 >=2.13
- {{ pin_compatible('intel-sycl-rt', min_pin='x.x', max_pin='x') }}
- {{ pin_compatible('intel-cmplr-lib-rt', min_pin='x.x', max_pin='x') }}
# Ensure we are using latest version of setuptools, since we don't need
# editable environments for release.
- setuptools >=69
- python-build >=1.1
- wheel >=0.43
- cmake >=3.29.0
- ninja >=1.11.1 # [not win]
{% for dep in py_build_deps %}
{% if dep.startswith('ninja') %}
- {{ dep.split(';')[0] }} # [not win]
{% elif dep.startswith('cmake') %}
- {{ dep }}
{% elif dep.startswith('build>=') %}
- {{ 'python-' ~ dep }}
{% else %}
- {{ dep|replace('_','-') }}
{% endif %}
{% endfor %}
# versioneer dependency
- tomli # [py<311]
- opencl-headers >=2025.06.13 # [win]
run:
- python
Expand Down
2 changes: 1 addition & 1 deletion docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ if (DPCTL_ENABLE_DOXYREST)
endif()

# Set the location where the generated docs are saved
set(DOC_OUTPUT_DIR ${CMAKE_INSTALL_PREFIX}/docs)
set(DOC_OUTPUT_DIR ${CMAKE_BINARY_DIR}/docs)

# set(INDEX_NO_DOXYREST_IN ${CMAKE_CURRENT_SOURCE_DIR}/index_no_doxyrest.rst.in)
# set(INDEX_DOXYREST_IN ${CMAKE_CURRENT_SOURCE_DIR}/index_doxyrest.rst.in)
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Generating The Documentation

The helper script ``scripts/gen_docs.py`` is the preferred way to generate the
documentation. The generated documentation HTML pages are installed to the
``CMAKE_INSTALL_PREFIX/docs`` directory.
``docs`` directory in the CMake build directory.

----------------------------
```bash
Expand Down
4 changes: 2 additions & 2 deletions docs/doc_sources/api_reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ The package ``dpctl`` provides
* Extension generators
- :ref:`Declarations <dpctl_cython_api>` for classes defined in :py:mod:`dpctl` and supporting functions for use in `Cython <cython_docs_>`_.
- :ref:`Integration <dpctl_pybind11_api>` with `pybind11 <pybind11_docs_>`_ defines type casters connecting SYCL classes and Python classes, as well as defines C++ classes wrapping a Python object for :mod:`dpctl.memory` objects.
- :ref:`Integration <dpctl_cmake_support>` with `CMake <cmake_docs_>`_ to simplify building DPC++-based Python extension using `scikit-build <skbuild_docs_>`_.
- :ref:`Integration <dpctl_cmake_support>` with `CMake <cmake_docs_>`_ to simplify building DPC++-based Python extension using `scikit-build-core <skbuild_docs_>`_.
* C API for DPC++ runtime
- :doc:`DPCTLSyclInterface C library <libsyclinterface/generated/index>`


.. _cmake_docs: https://cmake.org/documentation/
.. _cython_docs: https://cython.readthedocs.io/en/latest/
.. _skbuild_docs: https://scikit-build.readthedocs.io/en/latest/
.. _skbuild_docs: https://scikit-build-core.readthedocs.io/en/latest/
.. _pybind11_docs: https://pybind11.readthedocs.io/en/stable/

.. toctree::
Expand Down
2 changes: 1 addition & 1 deletion docs/doc_sources/beginners_guides/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ One way to create such environment is as follows:

conda create -n dev_dpctl -c conda-forge python=3.12 pip
conda activate dev_dpctl
pip install --no-cache-dir numpy cython scikit-build cmake ninja pytest
pip install --no-cache-dir numpy cython cython-cmake scikit-build-core setuptools-scm cmake ninja pytest

Using such environment and with DPC++ compiler activated, build the project using

Expand Down
Loading