File tree Expand file tree Collapse file tree
examples/pybind11/use_dpctl_sycl_queue Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,13 +24,8 @@ find_package(Python REQUIRED COMPONENTS Development.Module NumPy)
2424find_package (Dpctl REQUIRED )
2525
2626set (py_module_name _use_queue_device)
27- set (_sources use_queue_device/_example.cpp)
28- pybind11_add_module (${py_module_name}
29- MODULE
30- ${_sources}
31- )
27+ set (_sources src/use_queue_device/_example.cpp)
28+ pybind11_add_module (${py_module_name} MODULE ${_sources} )
3229add_sycl_to_target (TARGET ${py_module_name} SOURCES ${_sources} )
3330target_include_directories (${py_module_name} PUBLIC ${Dpctl_INCLUDE_DIRS} )
34- install (TARGETS ${py_module_name}
35- DESTINATION use_queue_device
36- )
31+ install (TARGETS ${py_module_name} DESTINATION use_queue_device)
Original file line number Diff line number Diff line change @@ -12,17 +12,19 @@ extensions.
1212To build the extension, run:
1313```
1414source /opt/intel/oneapi/compiler/latest/env/vars.sh
15- CXX=icpx python setup.py build_ext --inplace
15+ CXX=icpx python -m pip install .
1616python -m pytest tests
1717python example.py
1818```
1919
2020# Sample output
2121
2222```
23- (idp) [17:25:27 ansatnuc04 use_dpctl_syclqueue]$ python example.py
24- EU count returned by Pybind11 extension 24
25- EU count computed by dpctl 24
23+ $ python example.py
24+ EU count returned by Pybind11 extension 96
25+ EU count computed by dpctl 96
26+ Device's global memory size: 7445078016 bytes
27+ Device's local memory size: 65536 bytes
2628
2729Computing modular reduction using SYCL on a NumPy array
2830Offloaded result agrees with reference one computed by NumPy
Original file line number Diff line number Diff line change 1+ # Data Parallel Control (dpctl)
2+ #
3+ # Copyright 2020-2025 Intel Corporation
4+ #
5+ # Licensed under the Apache License, Version 2.0 (the "License");
6+ # you may not use this file except in compliance with the License.
7+ # You may obtain a copy of the License at
8+ #
9+ # http://www.apache.org/licenses/LICENSE-2.0
10+ #
11+ # Unless required by applicable law or agreed to in writing, software
12+ # distributed under the License is distributed on an "AS IS" BASIS,
13+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+ # See the License for the specific language governing permissions and
15+ # limitations under the License.
16+
17+ [build-system ]
18+ build-backend = " scikit_build_core.build"
19+ requires = [
20+ " scikit-build-core>=0.8.0" ,
21+ " dpctl" ,
22+ " numpy >=1.23"
23+ ]
24+
25+ [project ]
26+ authors = [{name = " Intel Corporation" }]
27+ dependencies = [" numpy" , " dpctl" ]
28+ description = " An example of SYCL-powered Python package (with pybind11)"
29+ license = {text = " Apache 2.0" }
30+ name = " use_queue_device"
31+ requires-python = " >=3.10"
32+ version = " 0.0.1"
33+
34+ [project .urls ]
35+ Repository = " https://github.com/IntelPython/dpctl"
36+
37+ [tool .scikit-build ]
38+ build-dir = " build/{wheel_tag}"
39+ wheel.packages = [" src/use_queue_device" ]
Load diff This file was deleted.
File renamed without changes.
File renamed without changes.
You can’t perform that action at this time.
0 commit comments