Skip to content

Commit e6da513

Browse files
Merge pull request #1028 from IntelPython/fix-debug-build-linker-relocation-truncated-to-fit
Transitioned dpctl to require DPC++ 2023, removed host related functions, fixed linker crash, enabled SyclKernel.max_sub_group_size property
2 parents dca9722 + 3db9c8d commit e6da513

File tree

55 files changed

+100
-543
lines changed

Some content is hidden

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

55 files changed

+100
-543
lines changed

.github/workflows/generate-coverage.yaml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,17 @@ jobs:
9696
- name: Upload coverage data to coveralls.io
9797
shell: bash -l {0}
9898
run: |
99+
echo "Processing c-api-coverage"
100+
export DPCTL_LCOV_FN=$(find _skbuild -name dpctl.lcov)
101+
grep "/tmp" $DPCTL_LCOV_FN
99102
coveralls-lcov -v -n \
100-
$(find _skbuild -name dpctl.lcov) > dpctl-c-api-coverage.json
103+
$DPCTL_LCOV_FN > dpctl-c-api-coverage.json
104+
echo "Processing pytest-coverage"
105+
export DPCTL_PYTEST_LCOV=$(find . -name dpctl_pytest.lcov)
106+
grep "/tmp" $DPCTL_PYTEST_LCOV
101107
coveralls-lcov -v -n \
102-
$(find . -name dpctl_pytest.lcov) > pytest-dpctl-c-api-coverage.json
103-
# merge json files
108+
$DPCTL_PYTEST_LCOV > pytest-dpctl-c-api-coverage.json
109+
echo "Merging JSON files"
104110
python -c "import json; \
105111
fh1 = open('dpctl-c-api-coverage.json', 'r'); \
106112
f1 = json.load(fh1); fh1.close(); \
@@ -113,6 +119,7 @@ jobs:
113119
ls -lh dpctl-c-api-coverage.json pytest-dpctl-c-api-coverage.json \
114120
combined-dpctl-c-api-coverage.json \
115121
$(find _skbuild -name dpctl.lcov) $(find . -name dpctl_pytest.lcov)
122+
echo "Merging combined files with coverage data"
116123
coveralls --service=github --merge=combined-dpctl-c-api-coverage.json
117124
env:
118125
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/generate-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
source /opt/intel/oneapi/setvars.sh
6464
wget https://github.com/vovkos/doxyrest/releases/download/doxyrest-2.1.2/doxyrest-2.1.2-linux-amd64.tar.xz
6565
tar xf doxyrest-2.1.2-linux-amd64.tar.xz
66-
python setup.py develop -G Ninja --build-type=Debug \
66+
python setup.py develop -G Ninja --build-type=Release \
6767
-- \
6868
-DCMAKE_C_COMPILER:PATH=$(which icx) \
6969
-DCMAKE_CXX_COMPILER:PATH=$(which icpx) \

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
### Added
1010

11+
* Added `dpctl.program.SyclKernel.max_sub_group_size` property [#1208](https://github.com/IntelPython/dpctl/pull/1028).
12+
1113
### Changed
1214

15+
* Removed `dpctl.select_host_device`, `dpctl.has_host_device`, `dpctl.SyclDevice.is_host`, and `dpctl.SyclDevice.has_aspect_host` since support for host device has been removed in DPC++ 2023 and from SYCL 2020 spec [#1208](https://github.com/IntelPython/dpctl/pull/1028).
16+
1317
### Fixed
1418

1519

dpctl/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ if(WIN32)
1818
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Ox ${WARNING_FLAGS}")
1919
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Ox ${WARNING_FLAGS}")
2020
set(CMAKE_C_FLAGS_DEBUG
21-
"${CMAKE_C_FLAGS_DEBUG} ${WARNING_FLAGS} -O0 -ggdb3 -DDEBUG"
21+
"${CMAKE_C_FLAGS_DEBUG} ${WARNING_FLAGS} -O0 -g1 -DDEBUG"
2222
)
2323
set(CMAKE_CXX_FLAGS_DEBUG
24-
"${CMAKE_CXX_FLAGS_DEBUG} ${WARNING_FLAGS} -O0 -ggdb3 -DDEBUG"
24+
"${CMAKE_CXX_FLAGS_DEBUG} ${WARNING_FLAGS} -O0 -g1 -DDEBUG"
2525
)
2626
set(DPCTL_LDFLAGS "/link /NXCompat /DynamicBase")
2727
elseif(UNIX)
@@ -57,10 +57,10 @@ elseif(UNIX)
5757
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 ${CFLAGS}")
5858
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 ${CXXFLAGS}")
5959
set(CMAKE_C_FLAGS_DEBUG
60-
"${CMAKE_C_FLAGS_DEBUG} ${CFLAGS} -O0 -ggdb3 -DDEBUG"
60+
"${CMAKE_C_FLAGS_DEBUG} ${CFLAGS} -O0 -g1 -DDEBUG"
6161
)
6262
set(CMAKE_CXX_FLAGS_DEBUG
63-
"${CMAKE_CXX_FLAGS_DEBUG} ${CXXFLAGS} -O0 -ggdb3 -DDEBUG"
63+
"${CMAKE_CXX_FLAGS_DEBUG} ${CXXFLAGS} -O0 -g1 -DDEBUG"
6464
)
6565
set(DPCTL_LDFLAGS "-z,noexecstack,-z,relro,-z,now")
6666
else()

dpctl/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,10 @@
4848
has_accelerator_devices,
4949
has_cpu_devices,
5050
has_gpu_devices,
51-
has_host_device,
5251
select_accelerator_device,
5352
select_cpu_device,
5453
select_default_device,
5554
select_gpu_device,
56-
select_host_device,
5755
)
5856
from ._sycl_event import SyclEvent
5957
from ._sycl_platform import SyclPlatform, get_platforms, lsplatform

dpctl/_backend.pxd

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ cdef extern from "syclinterface/dpctl_sycl_enum_types.h":
3737
ctypedef enum _backend_type 'DPCTLSyclBackendType':
3838
_ALL_BACKENDS 'DPCTL_ALL_BACKENDS'
3939
_CUDA 'DPCTL_CUDA'
40-
_HOST 'DPCTL_HOST'
4140
_LEVEL_ZERO 'DPCTL_LEVEL_ZERO'
4241
_OPENCL 'DPCTL_OPENCL'
4342
_UNKNOWN_BACKEND 'DPCTL_UNKNOWN_BACKEND'
@@ -49,7 +48,6 @@ cdef extern from "syclinterface/dpctl_sycl_enum_types.h":
4948
_CPU 'DPCTL_CPU'
5049
_CUSTOM 'DPCTL_CUSTOM'
5150
_GPU 'DPCTL_GPU'
52-
_HOST_DEVICE 'DPCTL_HOST_DEVICE'
5351
_UNKNOWN_DEVICE 'DPCTL_UNKNOWN_DEVICE'
5452

5553
ctypedef enum _arg_data_type 'DPCTLKernelArgType':
@@ -174,7 +172,6 @@ cdef extern from "syclinterface/dpctl_sycl_device_interface.h":
174172
cdef bool DPCTLDevice_IsAccelerator(const DPCTLSyclDeviceRef DRef)
175173
cdef bool DPCTLDevice_IsCPU(const DPCTLSyclDeviceRef DRef)
176174
cdef bool DPCTLDevice_IsGPU(const DPCTLSyclDeviceRef DRef)
177-
cdef bool DPCTLDevice_IsHost(const DPCTLSyclDeviceRef DRef)
178175
cdef bool DPCTLDevice_GetSubGroupIndependentForwardProgress(const DPCTLSyclDeviceRef DRef)
179176
cdef uint32_t DPCTLDevice_GetPreferredVectorWidthChar(const DPCTLSyclDeviceRef DRef)
180177
cdef uint32_t DPCTLDevice_GetPreferredVectorWidthShort(const DPCTLSyclDeviceRef DRef)
@@ -236,7 +233,6 @@ cdef extern from "syclinterface/dpctl_sycl_device_selector_interface.h":
236233
DPCTLSyclDeviceSelectorRef DPCTLCPUSelector_Create()
237234
DPCTLSyclDeviceSelectorRef DPCTLFilterSelector_Create(const char *)
238235
DPCTLSyclDeviceSelectorRef DPCTLGPUSelector_Create()
239-
DPCTLSyclDeviceSelectorRef DPCTLHostSelector_Create()
240236
void DPCTLDeviceSelector_Delete(DPCTLSyclDeviceSelectorRef)
241237
int DPCTLDeviceSelector_Score(DPCTLSyclDeviceSelectorRef, DPCTLSyclDeviceRef)
242238

@@ -271,8 +267,7 @@ cdef extern from "syclinterface/dpctl_sycl_kernel_interface.h":
271267
cdef size_t DPCTLKernel_GetPreferredWorkGroupSizeMultiple(const DPCTLSyclKernelRef KRef)
272268
cdef size_t DPCTLKernel_GetPrivateMemSize(const DPCTLSyclKernelRef KRef)
273269
cdef uint32_t DPCTLKernel_GetMaxNumSubGroups(const DPCTLSyclKernelRef KRef)
274-
## Next line is commented out due to issue in DPC++ runtime
275-
# cdef uint32_t DPCTLKernel_GetMaxSubGroupSize(const DPCTLSyclKernelRef KRef)
270+
cdef uint32_t DPCTLKernel_GetMaxSubGroupSize(const DPCTLSyclKernelRef KRef)
276271
cdef uint32_t DPCTLKernel_GetCompileNumSubGroups(const DPCTLSyclKernelRef KRef)
277272
cdef uint32_t DPCTLKernel_GetCompileSubGroupSize(const DPCTLSyclKernelRef KRef)
278273

dpctl/_sycl_device.pyx

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ from ._backend cimport ( # noqa: E211
7373
DPCTLDevice_IsAccelerator,
7474
DPCTLDevice_IsCPU,
7575
DPCTLDevice_IsGPU,
76-
DPCTLDevice_IsHost,
7776
DPCTLDeviceMgr_GetDeviceInfoStr,
7877
DPCTLDeviceMgr_GetDevices,
7978
DPCTLDeviceMgr_GetPositionInDevices,
@@ -162,8 +161,6 @@ cdef list _get_devices(DPCTLDeviceVectorRef DVRef):
162161
cdef str _backend_type_to_filter_string_part(_backend_type BTy):
163162
if BTy == _backend_type._CUDA:
164163
return "cuda"
165-
elif BTy == _backend_type._HOST:
166-
return "host"
167164
elif BTy == _backend_type._LEVEL_ZERO:
168165
return "level_zero"
169166
elif BTy == _backend_type._OPENCL:
@@ -181,8 +178,6 @@ cdef str _device_type_to_filter_string_part(_device_type DTy):
181178
return "cpu"
182179
elif DTy == _device_type._GPU:
183180
return "gpu"
184-
elif DTy == _device_type._HOST_DEVICE:
185-
return "host"
186181
else:
187182
return "unknown"
188183

@@ -222,7 +217,6 @@ cdef class SyclDevice(_SyclDevice):
222217
:func:`dpctl.select_cpu_device()`,
223218
:func:`dpctl.select_default_device()`,
224219
:func:`dpctl.select_gpu_device()`,
225-
:func:`dpctl.select_host_device()`.
226220
227221
228222
:Example:
@@ -359,8 +353,6 @@ cdef class SyclDevice(_SyclDevice):
359353
)
360354
if BTy == _backend_type._CUDA:
361355
return backend_type.cuda
362-
elif BTy == _backend_type._HOST:
363-
return backend_type.host
364356
elif BTy == _backend_type._LEVEL_ZERO:
365357
return backend_type.level_zero
366358
elif BTy == _backend_type._OPENCL:
@@ -388,21 +380,9 @@ cdef class SyclDevice(_SyclDevice):
388380
return device_type.cpu
389381
elif DTy == _device_type._GPU:
390382
return device_type.gpu
391-
elif DTy == _device_type._HOST_DEVICE:
392-
return device_type.host
393383
else:
394384
raise ValueError("Unknown device type.")
395385

396-
@property
397-
def has_aspect_host(self):
398-
""" Returns True if this device is a host device, False otherwise.
399-
400-
Returns:
401-
bool: Indicates if the device is a host device.
402-
"""
403-
cdef _aspect_type AT = _aspect_type._host
404-
return DPCTLDevice_HasAspect(self._device_ref, AT)
405-
406386
@property
407387
def has_aspect_cpu(self):
408388
""" Returns True if this device is a CPU device, False otherwise.
@@ -729,15 +709,6 @@ cdef class SyclDevice(_SyclDevice):
729709
"""
730710
return DPCTLDevice_IsGPU(self._device_ref)
731711

732-
@property
733-
def is_host(self):
734-
""" Returns True if the SyclDevice instance is a SYCL host device.
735-
736-
Returns:
737-
bool: True if the SyclDevice is a SYCL host device, else False.
738-
"""
739-
return DPCTLDevice_IsHost(self._device_ref)
740-
741712
@property
742713
def max_work_item_dims(self):
743714
""" Returns the maximum dimensions that specify the global and local
@@ -866,11 +837,9 @@ cdef class SyclDevice(_SyclDevice):
866837
int: The maximum number of sub-groups support per work-group by
867838
the device.
868839
"""
869-
cdef uint32_t max_num_sub_groups = 0
870-
if (not self.is_host):
871-
max_num_sub_groups = (
872-
DPCTLDevice_GetMaxNumSubGroups(self._device_ref)
873-
)
840+
cdef uint32_t max_num_sub_groups = (
841+
DPCTLDevice_GetMaxNumSubGroups(self._device_ref)
842+
)
874843
return max_num_sub_groups
875844

876845
@property

dpctl/_sycl_device_factory.pxd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@ cpdef SyclDevice select_accelerator_device()
3131
cpdef SyclDevice select_cpu_device()
3232
cpdef SyclDevice select_default_device()
3333
cpdef SyclDevice select_gpu_device()
34-
cpdef SyclDevice select_host_device()
3534
cpdef list get_devices(backend=*, device_type=*)
3635
cpdef int get_num_devices(backend=*, device_type=*)
3736
cpdef cpp_bool has_gpu_devices()
3837
cpdef cpp_bool has_cpu_devices()
3938
cpdef cpp_bool has_accelerator_devices()
40-
cpdef cpp_bool has_host_device()

dpctl/_sycl_device_factory.pyx

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ from ._backend cimport ( # noqa: E211
3939
DPCTLDeviceVector_Size,
4040
DPCTLDeviceVectorRef,
4141
DPCTLGPUSelector_Create,
42-
DPCTLHostSelector_Create,
4342
DPCTLSyclDeviceRef,
4443
DPCTLSyclDeviceSelectorRef,
4544
_backend_type,
@@ -56,12 +55,10 @@ __all__ = [
5655
"select_cpu_device",
5756
"select_default_device",
5857
"select_gpu_device",
59-
"select_host_device",
6058
"get_num_devices",
6159
"has_cpu_devices",
6260
"has_gpu_devices",
6361
"has_accelerator_devices",
64-
"has_host_device",
6562
]
6663

6764

@@ -71,8 +68,6 @@ cdef _backend_type _string_to_dpctl_sycl_backend_ty(str backend_str):
7168
return _backend_type._ALL_BACKENDS
7269
elif backend_str == "cuda":
7370
return _backend_type._CUDA
74-
elif backend_str == "host":
75-
return _backend_type._HOST
7671
elif backend_str == "level_zero":
7772
return _backend_type._LEVEL_ZERO
7873
elif backend_str == "opencl":
@@ -95,8 +90,6 @@ cdef _device_type _string_to_dpctl_sycl_device_ty(str dty_str):
9590
return _device_type._CUSTOM
9691
elif dty_str == "gpu":
9792
return _device_type._GPU
98-
elif dty_str == "host":
99-
return _device_type._HOST_DEVICE
10093
else:
10194
return _device_type._UNKNOWN_DEVICE
10295

@@ -106,8 +99,6 @@ cdef _backend_type _enum_to_dpctl_sycl_backend_ty(BTy):
10699
return _backend_type._ALL_BACKENDS
107100
elif BTy == backend_type.cuda:
108101
return _backend_type._CUDA
109-
elif BTy == backend_type.host:
110-
return _backend_type._HOST
111102
elif BTy == backend_type.level_zero:
112103
return _backend_type._LEVEL_ZERO
113104
elif BTy == backend_type.opencl:
@@ -129,8 +120,6 @@ cdef _device_type _enum_to_dpctl_sycl_device_ty(DTy):
129120
return _device_type._CUSTOM
130121
elif DTy == device_type_t.gpu:
131122
return _device_type._GPU
132-
elif DTy == device_type_t.host:
133-
return _device_type._HOST_DEVICE
134123
else:
135124
return _device_type._UNKNOWN_DEVICE
136125

@@ -288,19 +277,6 @@ cpdef cpp_bool has_accelerator_devices():
288277
return <cpp_bool>num_accelerator_dev
289278

290279

291-
cpdef cpp_bool has_host_device():
292-
""" A helper function to check if there are any SYCL Host devices available.
293-
294-
Returns:
295-
bool: ``True`` if ``sycl::device_type::host`` devices are present,
296-
``False`` otherwise.
297-
"""
298-
cdef int num_host_dev = DPCTLDeviceMgr_GetNumDevices(
299-
_device_type._HOST_DEVICE
300-
)
301-
return <cpp_bool>num_host_dev
302-
303-
304280
cpdef SyclDevice select_accelerator_device():
305281
""" A wrapper for SYCL's ``accelerator_selector`` class.
306282
@@ -379,23 +355,3 @@ cpdef SyclDevice select_gpu_device():
379355
raise SyclDeviceCreationError("Device unavailable.")
380356
Device = SyclDevice._create(DRef)
381357
return Device
382-
383-
384-
cpdef SyclDevice select_host_device():
385-
""" A wrapper for SYCL's ``host_selector`` class.
386-
387-
Returns:
388-
dpctl.SyclDevice: A Python object wrapping the SYCL ``device``
389-
returned by the SYCL ``host_selector``.
390-
Raises:
391-
dpctl.SyclDeviceCreationError: If the SYCL ``host_selector`` is
392-
unable to select a ``device``.
393-
"""
394-
cdef DPCTLSyclDeviceSelectorRef DSRef = DPCTLHostSelector_Create()
395-
cdef DPCTLSyclDeviceRef DRef = DPCTLDevice_CreateFromSelector(DSRef)
396-
# Free up the device selector
397-
DPCTLDeviceSelector_Delete(DSRef)
398-
if DRef is NULL:
399-
raise SyclDeviceCreationError("Host device is unavailable.")
400-
Device = SyclDevice._create(DRef)
401-
return Device

dpctl/_sycl_event.pyx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,6 @@ cdef class SyclEvent(_SyclEvent):
302302
return backend_type.opencl
303303
elif BE == _backend_type._LEVEL_ZERO:
304304
return backend_type.level_zero
305-
elif BE == _backend_type._HOST:
306-
return backend_type.host
307305
elif BE == _backend_type._CUDA:
308306
return backend_type.cuda
309307
else:

dpctl/_sycl_platform.pyx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,6 @@ cdef class SyclPlatform(_SyclPlatform):
251251
)
252252
if BTy == _backend_type._CUDA:
253253
return backend_type.cuda
254-
elif BTy == _backend_type._HOST:
255-
return backend_type.host
256254
elif BTy == _backend_type._LEVEL_ZERO:
257255
return backend_type.level_zero
258256
elif BTy == _backend_type._OPENCL:

dpctl/_sycl_queue.pyx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,8 +676,6 @@ cdef class SyclQueue(_SyclQueue):
676676
return backend_type.opencl
677677
elif BE == _backend_type._LEVEL_ZERO:
678678
return backend_type.level_zero
679-
elif BE == _backend_type._HOST:
680-
return backend_type.host
681679
elif BE == _backend_type._CUDA:
682680
return backend_type.cuda
683681
else:

dpctl/enum_types.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ class device_type(Enum):
5454
cpu = auto()
5555
custom = auto()
5656
gpu = auto()
57-
host = auto()
5857

5958

6059
class backend_type(Enum):
@@ -74,7 +73,6 @@ class backend_type(Enum):
7473

7574
all = auto()
7675
cuda = auto()
77-
host = auto()
7876
level_zero = auto()
7977
opencl = auto()
8078

0 commit comments

Comments
 (0)