Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.
Merged
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
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
63 changes: 55 additions & 8 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ on:
push:
branches: [main]

permissions: read-all

jobs:
setup_develop:
name: Build packages with DPC++
build_and_test_kde_setuptools:
name: Build kde_setuptools with DPC++
runs-on: Ubuntu-latest

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}

Expand All @@ -32,32 +34,77 @@ jobs:
run: echo $CONDA/bin >> $GITHUB_PATH

- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4.1.1
with:
fetch-depth: 0

- name: Install dependencies
run: |
conda install python=3.10 dpctl -c dppy/label/dev -c intel -c conda-forge --override-channels
pip install --no-cache-dir cython scikit-build pybind11 pytest cmake ninja
source $CONDA/etc/profile.d/conda.sh
conda create -n build_kde_setuptools python=3.10 dpctl -c dppy/label/dev -c intel -c conda-forge --override-channels
conda activate build_kde_setuptools
pip install --no-cache-dir cython pybind11 pytest cmake ninja
conda list

- name: Build kde_setuptools
run: |
source /opt/intel/oneapi/setvars.sh
export OCL_ICD_FILENAMES=libintelocl.so
pushd kde_setuptools
source $CONDA/etc/profile.d/conda.sh
conda activate build_kde_setuptools
python setup.py develop
python -m pytest tests
popd


build_and_test_kde_skbuild:
name: Build kde_skbuild with DPC++
runs-on: Ubuntu-latest

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}

- name: Add Intel repository
run: |
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
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
sudo apt-get update

- name: Install Intel OneAPI
run: |
sudo apt-get install intel-oneapi-compiler-dpcpp-cpp
sudo apt-get install intel-oneapi-tbb

- name: Add conda to system path
run: echo $CONDA/bin >> $GITHUB_PATH

- name: Checkout repo
uses: actions/checkout@v4.1.1
with:
fetch-depth: 0

- name: Install dependencies
run: |
source $CONDA/etc/profile.d/conda.sh
conda create -n build_kde_skbuild python=3.10 dpctl -c dppy/label/dev -c intel -c conda-forge --override-channels
conda activate build_kde_skbuild
pip install --no-cache-dir cython scikit-build pybind11 pytest cmake ninja
conda list

- name: Build kde_skbuild
run: |
source /opt/intel/oneapi/setvars.sh
export OCL_ICD_FILENAMES=libintelocl.so
pushd kde_skbuild
source $CONDA/etc/profile.d/conda.sh
conda activate build_kde_skbuild
CC=icx CXX=icpx python setup.py develop -G Ninja \
-- -DCMAKE_VERBOSE_MAKEFILE=ON \
-DDPCTL_MODULE_PATH=$(python -m dpctl --cmakedir)
-- -DCMAKE_VERBOSE_MAKEFILE=ON
python -m pytest tests
popd
2 changes: 1 addition & 1 deletion common_ext/cy_kde.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 Intel Corporation
# Copyright 2022-2024 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion common_ext/py_kde.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Intel Corporation
// Copyright 2022-2024 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion common_src/kde.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Intel Corporation
// Copyright 2022-2024 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
59 changes: 0 additions & 59 deletions common_src/main.cpp

This file was deleted.

2 changes: 1 addition & 1 deletion kde_setuptools/kde_setuptools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 Intel Corporation
# Copyright 2022-2024 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion kde_setuptools/setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 Intel Corporation
# Copyright 2022-2024 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion kde_setuptools/tests/test_cy_kde.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 Intel Corporation
# Copyright 2022-2024 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion kde_setuptools/tests/test_py_kde.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2022 Intel Corporation
# Copyright 2022-2024 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
10 changes: 0 additions & 10 deletions kde_skbuild/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,11 @@ cmake_minimum_required(VERSION 3.22...3.27 FATAL_ERROR)

project(oneapi_kde_skbuild VERSION 0.1 LANGUAGES C CXX DESCRIPTION "Example of DPC++-based Python extension")

if (NOT DEFINED DPCTL_MODULE_PATH)
if (DEFINED ENV{DPCTL_MODULE_PATH})
set(DPCTL_MODULE_PATH $ENV{DPCTL_MODULE_PATH})
else ()
message(FATAL_ERROR "Specify DPCTL_MODULE_PATH, either via cmake or as environment varibale")
endif()
endif()

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${DPCTL_MODULE_PATH})
find_package(IntelSYCL REQUIRED)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)


# Define CMAKE_INSTALL_xxx: LIBDIR, INCLUDEDIR
include(GNUInstallDirs)

Expand Down
9 changes: 4 additions & 5 deletions kde_skbuild/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# Building this extension

Assuming `numpy`, `Cython`, `pybind11`, `pytest`, `scikit-build`, `cmake >=3.21`, and `ninja` are installed
and DCP++ has been activated:
Assuming `numpy`, `Cython`, `pybind11`, `pytest`, `scikit-build`, `cmake >=3.21`, `dpctl`, and `ninja` are
installed and DCP++ has been activated:

```bash
CC=icx CXX=icpx python setup.py develop -G Ninja -- -DDPCTL_MODULE_PATH=$(python -m dpctl --cmakedir)
CC=icx CXX=icpx python setup.py develop -G Ninja
pytest -m tests
```

Scikit-build enables building Python native extensions using CMake. This package leverage integration DPC++
with CMake [dpcpp-cmake-integration] as well as integration of `dpctl` with CMake.

**Note**: Building this package requires the using latest development version of `dpctl`.
This can be installed using conda package manager using
The latest version of `dpctl` can be installed using conda package manager using

```bash
conda install -c dppy/label/dev dpctl
Expand Down