Skip to content

Commit a84c615

Browse files
committed
Merge branch 'fix_full_array_dtype' of https://github.com/IntelPython/dpctl into fix_full_array_dtype
2 parents 0985218 + 805f063 commit a84c615

File tree

68 files changed

+1735
-368
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1735
-368
lines changed

.flake8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ per-file-ignores =
3232
examples/cython/sycl_buffer/_buffer_example.pyx: E999, E225, E402
3333
examples/cython/sycl_direct_linkage/_buffer_example.pyx: E999, E225, E402
3434
examples/cython/usm_memory/blackscholes.pyx: E999, E225, E226, E402
35+
examples/cython/use_dpctl_sycl/use_dpctl_sycl/_cython_api.pyx: E999, E225, E226, E402

.github/workflows/conda-package.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,13 @@ jobs:
160160
. $CONDA/etc/profile.d/conda.sh
161161
conda activate test_dpctl
162162
export OCL_ICD_FILENAMES=libintelocl.so
163-
export SYCL_ENABLE_HOST_DEVICE=1
164163
python -c "import dpctl; dpctl.lsplatform()"
165164
- name: Run tests
166165
run: |
167166
. $CONDA/etc/profile.d/conda.sh
168167
conda activate test_dpctl
169168
# echo "libintelocl.so" | tee /etc/OpenCL/vendors/intel-cpu.icd
170169
export OCL_ICD_FILENAMES=libintelocl.so
171-
export SYCL_ENABLE_HOST_DEVICE=1
172170
# clinfo -l
173171
python -m pytest -p no:faulthandler --pyargs $MODULE_NAME
174172
@@ -297,14 +295,12 @@ jobs:
297295
shell: cmd /C CALL {0}
298296
run: |
299297
python -c "import sys; print(sys.executable)"
300-
set SYCL_ENABLE_HOST_DEVICE=1
301298
python -c "import dpctl; dpctl.lsplatform()"
302299
python -c "import dpctl; print(dpctl.get_devices(backend='opencl', device_type='gpu'))"
303300
python -c "import dpctl; print(dpctl.get_num_devices(backend='opencl', device_type='gpu'))"
304301
- name: Run tests
305302
shell: cmd /C CALL {0}
306303
run: |
307-
set SYCL_ENABLE_HOST_DEVICE=1
308304
python -c "import sys; print(sys.executable)"
309305
python -m pytest -p no:faulthandler --pyargs ${{ env.MODULE_NAME }}
310306
@@ -435,7 +431,6 @@ jobs:
435431
run: |
436432
source $CONDA/etc/profile.d/conda.sh
437433
export OCL_ICD_FILENAMES=libintelocl.so
438-
export SYCL_ENABLE_HOST_DEVICE=1
439434
conda activate examples
440435
conda list
441436
cd examples/pybind11
@@ -473,7 +468,12 @@ jobs:
473468
CC=dpcpp CXX=dpcpp LDSHARED="dpcpp -shared" \
474469
python setup.py build_ext --inplace || exit 1
475470
conda deactivate
476-
LD_LIBRARY_PATH=${CONDA_PREFIX}/lib python run.py || exit 1
471+
if [ -e tests ]
472+
then
473+
LD_LIBRARY_PATH=${CONDA_PREFIX}/lib python -m pytest tests || exit 1
474+
else
475+
LD_LIBRARY_PATH=${CONDA_PREFIX}/lib python run.py || exit 1
476+
fi
477477
popd
478478
done
479479
cd ../c
@@ -492,7 +492,6 @@ jobs:
492492
cd examples/python
493493
source $CONDA/etc/profile.d/conda.sh
494494
export OCL_ICD_FILENAMES=libintelocl.so
495-
export SYCL_ENABLE_HOST_DEVICE=1
496495
conda activate examples
497496
for script in $(find . \( -not -name "_*" -and -name "*.py" \))
498497
do
@@ -598,7 +597,6 @@ jobs:
598597
conda activate test_dpctl
599598
# echo "libintelocl.so" | tee /etc/OpenCL/vendors/intel-cpu.icd
600599
export OCL_ICD_FILENAMES=libintelocl.so
601-
export SYCL_ENABLE_HOST_DEVICE=1
602600
python -c "import dpctl; dpctl.lsplatform()"
603601
export ARRAY_API_TESTS_MODULE=dpctl.tensor
604602
cd /home/runner/work/array-api-tests

.github/workflows/generate-coverage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
shell: bash -l {0}
8686
run: |
8787
source /opt/intel/oneapi/setvars.sh
88-
SYCL_ENABLE_HOST_DEVICE=1 python scripts/gen_coverage.py
88+
python scripts/gen_coverage.py
8989
9090
- name: Install coverall dependencies
9191
shell: bash -l {0}

.github/workflows/os-llvm-sycl-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,4 @@ jobs:
119119
sycl-ls
120120
CC=clang CXX=clang++ python setup.py develop -G Ninja
121121
python -c "import dpctl; dpctl.lsplatform()" || exit 1
122-
SYCL_ENABLE_HOST_DEVICE=1 python -m pytest -v dpctl/tests
122+
python -m pytest -v dpctl/tests

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818
* Added `dpctl.utils.onetrace_enabled` context manager for targeted trace collection [#903](https://github.com/IntelPython/dpctl/pull/903).
1919
* Added support for `stream` keyword in `__dlpack__` method, enabling support for sending `usm_ndarray` using mpi4py [#906](https://github.com/IntelPython/dpctl/pull/906).
2020
* `dpctl.tensor.asarray` can now transition data between incompatible devices, [#951](https://github.com/IntelPython/dpctl/pull/951).
21+
* Introduced `"syclinterface/dpctl_sycl_types_casters.hpp"` header file with declaration of conversion routines between SYCL type pointers and SyclInterface library opaque pointers [#960](https://github.com/IntelPython/dpctl/pull/960).
22+
* Added C-API to `dpctl.program.SyclKernel` and `dpctl.program.SyclProgram`. Added type casters for new types to "dpctl4pybind11" and added an example demonstrating its use [#970](https://github.com/IntelPython/dpctl/pull/970).
23+
* Introduced "dpctl/sycl.pxd" Cython declaration file to streamline use of SYCL functions from Cython, and added an example demonstrating its use [#981](https://github.com/IntelPython/dpctl/pull/981).
24+
* Added experimental support for sharing data allocated on sub-devices via dlpack [#984](https://github.com/IntelPython/dpctl/pull/984).
25+
* Added `dpctl.SyclDevice.sub_group_sizes` property to retrieve supported sizes of sub-group by the device [#985](https://github.com/IntelPython/dpctl/pull/985).
2126

2227
### Changed
2328
* Improved queue compatibility testing in `dpctl.tensor`'s implementation module [#900](https://github.com/IntelPython/dpctl/pull/900).
@@ -27,13 +32,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2732
* Refactored `dpctl.tensor`'s implementation module [#941](https://github.com/IntelPython/dpctl/pull/941) to streamline adding new functionality. Streamlined `dpctl::tensor::usm_ndarray` class implementation.
2833
* Added debugging messaging in case when `DPCTLDynamicLib::getSymbol` encounters errors [#956](https://github.com/IntelPython/dpctl/pull/956).
2934
* Updated code base according to changes in DPC++ compiler [#952](https://github.com/IntelPython/dpctl/pull/952), [#957](https://github.com/IntelPython/dpctl/pull/957), [#958](https://github.com/IntelPython/dpctl/pull/958).
35+
* Changed `dpctl` to use pybind11 2.10.1 [#967](https://github.com/IntelPython/dpctl/pull/967).
3036

3137
### Fixed
3238
* Improved SyclDevice constructor error message [#893](https://github.com/IntelPython/dpctl/pull/893).
3339
* Fixed issue gh-890 about `dpctl.tensor.reshape` function [#915](https://github.com/IntelPython/dpctl/pull/915).
3440
* Fixed unexpected `UnboundLocalError` exception in [#922](https://github.com/IntelPython/dpctl/pull/922).
3541
* Fixed bugs in `dpctl.tensor.arange` in [#945](https://github.com/IntelPython/dpctl/pull/945).
3642
* Fixed issue with type inferencing in `dpctl.tensor.asarray` in [#949](https://github.com/IntelPython/dpctl/pull/949).
43+
* Added missing docstrings for `dpctl.SyclDevice` properties [#964](https://github.com/IntelPython/dpctl/pull/964).
3744

3845
## [0.13.0] - 07/28/2022
3946

MANIFEST.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
recursive-include dpctl/include *.h
2+
recursive-include dpctl/include *.hpp
23
include dpctl/include/dpctl4pybind11.hpp
34
recursive-include dpctl *.pxd
45
recursive-include dpctl *.cmake
@@ -12,6 +13,8 @@ include dpctl/_sycl_event.h
1213
include dpctl/_sycl_event_api.h
1314
include dpctl/memory/_memory.h
1415
include dpctl/memory/_memory_api.h
16+
include dpctl/program/_program.h
17+
include dpctl/program/_program_api.h
1518
include dpctl/tensor/_usmarray.h
1619
include dpctl/tensor/_usmarray_api.h
1720
recursive-include dpctl/tensor/include *

conda-recipe/meta.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ requirements:
2626
run:
2727
- python
2828
- {{ pin_compatible('numpy', min_pin='x.x', max_pin='x') }}
29-
- dpcpp-cpp-rt >=2022.1
29+
- {{ pin_compatible('dpcpp-cpp-rt', min_pin='x.x', max_pin='x') }} # [py<=39]
30+
- dpcpp-cpp-rt >=2022.2 # [py>39]
3031

3132
test:
3233
requires:

dpctl/_backend.pxd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ cdef extern from "syclinterface/dpctl_sycl_device_interface.h":
204204
cdef uint64_t DPCTLDevice_GetGlobalMemCacheSize(const DPCTLSyclDeviceRef DRef)
205205
cdef _global_mem_cache_type DPCTLDevice_GetGlobalMemCacheType(
206206
const DPCTLSyclDeviceRef DRef)
207+
cdef size_t *DPCTLDevice_GetSubGroupSizes(const DPCTLSyclDeviceRef DRef,
208+
size_t *res_len)
207209

208210

209211
cdef extern from "syclinterface/dpctl_sycl_device_manager.h":
@@ -263,6 +265,7 @@ cdef extern from "syclinterface/dpctl_sycl_event_interface.h":
263265
cdef extern from "syclinterface/dpctl_sycl_kernel_interface.h":
264266
cdef size_t DPCTLKernel_GetNumArgs(const DPCTLSyclKernelRef KRef)
265267
cdef void DPCTLKernel_Delete(DPCTLSyclKernelRef KRef)
268+
cdef DPCTLSyclKernelRef DPCTLKernel_Copy(const DPCTLSyclKernelRef KRef)
266269
cdef size_t DPCTLKernel_GetWorkGroupSize(const DPCTLSyclKernelRef KRef)
267270
cdef size_t DPCTLKernel_GetPreferredWorkGroupSizeMultiple(const DPCTLSyclKernelRef KRef)
268271
cdef size_t DPCTLKernel_GetPrivateMemSize(const DPCTLSyclKernelRef KRef)
@@ -341,6 +344,7 @@ cdef extern from "syclinterface/dpctl_sycl_kernel_bundle_interface.h":
341344
cdef bool DPCTLKernelBundle_HasKernel(DPCTLSyclKernelBundleRef KBRef,
342345
const char *KernelName)
343346
cdef void DPCTLKernelBundle_Delete(DPCTLSyclKernelBundleRef KBRef)
347+
cdef DPCTLSyclKernelBundleRef DPCTLKernelBundle_Copy(const DPCTLSyclKernelBundleRef KBRef)
344348

345349

346350
cdef extern from "syclinterface/dpctl_sycl_queue_interface.h":

dpctl/_device_selection.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from ._sycl_device_factory import get_devices
2222

2323

24-
def select_device_with_aspects(required_aspects, excluded_aspects=[]):
24+
def select_device_with_aspects(required_aspects, excluded_aspects=None):
2525
"""Selects the root :class:`dpctl.SyclDevice` that has the highest
2626
default selector score among devices that have all aspects in the
2727
`required_aspects` list, and do not have any aspects in `excluded_aspects`
@@ -41,10 +41,16 @@ def select_device_with_aspects(required_aspects, excluded_aspects=[]):
4141
dpctl.select_device_with_aspects(
4242
['usm_shared_allocations'], excluded_aspects=['custom'])
4343
"""
44+
if excluded_aspects is None:
45+
excluded_aspects = []
4446
if isinstance(required_aspects, str):
45-
required_aspects = [required_aspects]
47+
required_aspects = [
48+
required_aspects,
49+
]
4650
if isinstance(excluded_aspects, str):
47-
excluded_aspects = [excluded_aspects]
51+
excluded_aspects = [
52+
excluded_aspects,
53+
]
4854
seq = collections.abc.Sequence
4955
input_types_ok = isinstance(required_aspects, seq) and isinstance(
5056
excluded_aspects, seq
@@ -55,7 +61,7 @@ def select_device_with_aspects(required_aspects, excluded_aspects=[]):
5561
"e.g. lists, of strings"
5662
)
5763
for asp in chain(required_aspects, excluded_aspects):
58-
if type(asp) != str:
64+
if not isinstance(asp, str):
5965
raise TypeError("The list objects must be of a string type")
6066
if not hasattr(SyclDevice, "has_aspect_" + asp):
6167
raise AttributeError(f"The {asp} aspect is not supported in dpctl")

0 commit comments

Comments
 (0)