This repository was archived by the owner on Sep 26, 2025. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathsetup.py
More file actions
57 lines (51 loc) · 1.98 KB
/
Copy pathsetup.py
File metadata and controls
57 lines (51 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from setuptools import setup, Extension
from pybind11.setup_helpers import Pybind11Extension
import dpctl
from setuptools.command.build_ext import build_ext
class custom_build_ext(build_ext):
def build_extensions(self):
self.compiler.set_executable("compiler_so", "icpx -fsycl -fPIC")
self.compiler.set_executable("compiler_cxx", "icpx -fsycl -fPIC")
self.compiler.set_executable("linker_so", "icpx -fsycl -shared -fpic -fsycl-device-code-split=per_kernel")
build_ext.build_extensions(self)
ext_modules = [
Pybind11Extension(
"kde_setuptools._pybind11_kde",
["./src/pybind11_kde.cpp",],
include_dirs=["./src", dpctl.get_include(),]
),
Extension(
"kde_setuptools._cython_kde",
["./src/cy_kde.pyx",],
include_dirs=["./src", dpctl.get_include(),],
language="c++"
),
]
setup(
name="kde_setuptools",
author="Intel Corporation",
version="0.0.1",
description="An example of data-parallel Python extensions built with setuptools and oneAPI DPC++",
long_description="""
Example of using oneAPI to build data-parallel extension using setuptools.
Part of oneAPI for Scientific Python community virtual poster.
Also see README.md
""",
license="Apache 2.0",
url="https://intelpython.github.io/oneAPI-for-SciPy",
ext_modules=ext_modules,
cmdclass={"build_ext": custom_build_ext}
)